mirror of
https://github.com/transmission/transmission.git
synced 2025-12-24 20:35:36 +00:00
remove dead code (TR_STATUS_ACTIVE, TR_STATUS_INACTIVE)
This commit is contained in:
@@ -313,7 +313,7 @@ int main( int argc, char ** argv )
|
||||
s->peersGettingFromUs, s->peersConnected,
|
||||
s->rateUpload, getStringRatio(s->ratio) );
|
||||
}
|
||||
else if( s->status & TR_STATUS_INACTIVE )
|
||||
else if( s->status & TR_STATUS_STOPPED )
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -187,7 +187,7 @@ torrent_start( int id )
|
||||
{
|
||||
const tr_stat * st = tr_torrentStat( tor->tor );
|
||||
|
||||
if( TR_STATUS_INACTIVE & st->status )
|
||||
if( !TR_STATUS_IS_ACTIVE( st->status ) )
|
||||
{
|
||||
tr_torrentStart( tor->tor );
|
||||
savestate();
|
||||
@@ -209,7 +209,7 @@ torrent_stop( int id )
|
||||
{
|
||||
const tr_stat * st = tr_torrentStat( tor->tor );
|
||||
|
||||
if( TR_STATUS_ACTIVE & st->status )
|
||||
if( TR_STATUS_IS_ACTIVE( st->status ) )
|
||||
{
|
||||
tr_torrentStop( tor->tor );
|
||||
savestate();
|
||||
@@ -839,7 +839,7 @@ savestate( void )
|
||||
tr_bencInitStr( tr_bencDictAdd( tor, "hash" ),
|
||||
inf->hashString, 2 * SHA_DIGEST_LENGTH, 1 );
|
||||
tr_bencInitInt( tr_bencDictAdd( tor, "paused" ),
|
||||
( TR_STATUS_INACTIVE & st->status ? 1 : 0 ) );
|
||||
!TR_STATUS_IS_ACTIVE( st->status ) );
|
||||
tr_bencInitStr( tr_bencDictAdd( tor, "directory" ),
|
||||
tr_torrentGetFolder( ii->tor ), -1, 1 );
|
||||
if( pexset )
|
||||
|
||||
@@ -193,8 +193,8 @@ refreshTorrentActions( GtkTreeSelection * s )
|
||||
{
|
||||
int status = 0;
|
||||
gtk_tree_selection_selected_foreach( s, accumulateStatusForeach, &status );
|
||||
action_sensitize( "pause-torrent", (status & TR_STATUS_ACTIVE) != 0);
|
||||
action_sensitize( "start-torrent", (status & TR_STATUS_INACTIVE) != 0);
|
||||
action_sensitize( "pause-torrent", TR_STATUS_IS_ACTIVE(status) );
|
||||
action_sensitize( "start-torrent", !TR_STATUS_IS_ACTIVE(status) );
|
||||
action_sensitize( "remove-torrent", status != 0);
|
||||
action_sensitize( "verify-torrent", status != 0);
|
||||
action_sensitize( "show-torrent-details", status != 0);
|
||||
|
||||
@@ -858,8 +858,7 @@ ipc_addstat( benc_val_t * list, int tor,
|
||||
tr_bencInitInt( item, st->peersGettingFromUs );
|
||||
break;
|
||||
case IPC_ST_RUNNING:
|
||||
tr_bencInitInt( item,
|
||||
( TR_STATUS_INACTIVE & st->status ? 0 : 1 ) );
|
||||
tr_bencInitInt( item, TR_STATUS_IS_ACTIVE(st->status) );
|
||||
break;
|
||||
case IPC_ST_STATE:
|
||||
if( TR_STATUS_CHECK_WAIT & st->status )
|
||||
@@ -878,7 +877,7 @@ ipc_addstat( benc_val_t * list, int tor,
|
||||
{
|
||||
tr_bencInitStr( item, "seeding", -1, 1 );
|
||||
}
|
||||
else if( TR_STATUS_INACTIVE & st->status )
|
||||
else if( TR_STATUS_STOPPED & st->status )
|
||||
{
|
||||
tr_bencInitStr( item, "paused", -1, 1 );
|
||||
}
|
||||
|
||||
@@ -610,10 +610,7 @@ typedef enum
|
||||
}
|
||||
tr_torrent_status;
|
||||
|
||||
#define TR_STATUS_ACTIVE \
|
||||
(TR_STATUS_CHECK_WAIT|TR_STATUS_CHECK|TR_STATUS_DOWNLOAD|TR_STATUS_DONE|TR_STATUS_SEED)
|
||||
#define TR_STATUS_INACTIVE \
|
||||
(TR_STATUS_STOPPED)
|
||||
#define TR_STATUS_IS_ACTIVE(s) ((s) != TR_STATUS_STOPPED)
|
||||
|
||||
/***********************************************************************
|
||||
* tr_stat
|
||||
|
||||
Reference in New Issue
Block a user