(trunk) one of the less-interesting commits in a while: remove trailing spaces from lines

This commit is contained in:
Charles Kerr 2010-01-05 23:47:50 +00:00
parent 7d266ed4d6
commit 182cbb8b90
29 changed files with 116 additions and 123 deletions

View File

@ -637,7 +637,7 @@ readargs( int argc, const char ** argv )
tr_bencDictAddStr( &top, "method", "session-stats" ); tr_bencDictAddStr( &top, "method", "session-stats" );
tr_bencDictAddInt( &top, "tag", TAG_STATS ); tr_bencDictAddInt( &top, "tag", TAG_STATS );
break; break;
case 930: case 930:
tr_bencDictAddStr( &top, "method", "torrent-set" ); tr_bencDictAddStr( &top, "method", "torrent-set" );
addIdArg( args, id ); addIdArg( args, id );
@ -705,85 +705,85 @@ readargs( int argc, const char ** argv )
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_ENABLED, TRUE ); tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_ENABLED, TRUE );
break; break;
case 971: case 971:
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_ENABLED, FALSE ); tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_ENABLED, FALSE );
break; break;
case 972: case 972:
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
tr_bencDictAddInt( args, TR_PREFS_KEY_ALT_SPEED_DOWN, numarg( optarg ) ); tr_bencDictAddInt( args, TR_PREFS_KEY_ALT_SPEED_DOWN, numarg( optarg ) );
break; break;
case 973: case 973:
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
tr_bencDictAddInt( args, TR_PREFS_KEY_ALT_SPEED_UP, numarg( optarg ) ); tr_bencDictAddInt( args, TR_PREFS_KEY_ALT_SPEED_UP, numarg( optarg ) );
break; break;
case 974: case 974:
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, TRUE ); tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, TRUE );
break; break;
case 975: case 975:
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, FALSE ); tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, FALSE );
break; break;
case 976: case 976:
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
addTime( args, TR_PREFS_KEY_ALT_SPEED_TIME_BEGIN, optarg); addTime( args, TR_PREFS_KEY_ALT_SPEED_TIME_BEGIN, optarg);
break; break;
case 977: case 977:
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
addTime( args, TR_PREFS_KEY_ALT_SPEED_TIME_END, optarg); addTime( args, TR_PREFS_KEY_ALT_SPEED_TIME_END, optarg);
break; break;
case 978: case 978:
tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddStr( &top, "method", "session-set" );
addDays( args, TR_PREFS_KEY_ALT_SPEED_TIME_DAY, optarg ); addDays( args, TR_PREFS_KEY_ALT_SPEED_TIME_DAY, optarg );
break; break;
case 980: case 980:
tr_bencDictAddStr( &top, "method", "torrent-set" ); tr_bencDictAddStr( &top, "method", "torrent-set" );
addIdArg( args, id ); addIdArg( args, id );
tr_bencDictAddInt( args, "downloadLimit", numarg( optarg ) ); tr_bencDictAddInt( args, "downloadLimit", numarg( optarg ) );
tr_bencDictAddBool( args, "downloadLimited", TRUE ); tr_bencDictAddBool( args, "downloadLimited", TRUE );
break; break;
case 981: case 981:
tr_bencDictAddStr( &top, "method", "torrent-set" ); tr_bencDictAddStr( &top, "method", "torrent-set" );
addIdArg( args, id ); addIdArg( args, id );
tr_bencDictAddBool( args, "downloadLimited", FALSE ); tr_bencDictAddBool( args, "downloadLimited", FALSE );
break; break;
case 982: case 982:
tr_bencDictAddStr( &top, "method", "torrent-set" ); tr_bencDictAddStr( &top, "method", "torrent-set" );
addIdArg( args, id ); addIdArg( args, id );
tr_bencDictAddInt( args, "uploadLimit", numarg( optarg ) ); tr_bencDictAddInt( args, "uploadLimit", numarg( optarg ) );
tr_bencDictAddBool( args, "uploadLimited", TRUE ); tr_bencDictAddBool( args, "uploadLimited", TRUE );
break; break;
case 983: case 983:
tr_bencDictAddStr( &top, "method", "torrent-set" ); tr_bencDictAddStr( &top, "method", "torrent-set" );
addIdArg( args, id ); addIdArg( args, id );
tr_bencDictAddBool( args, "uploadLimited", FALSE ); tr_bencDictAddBool( args, "uploadLimited", FALSE );
break; break;
case 984: case 984:
tr_bencDictAddStr( &top, "method", "torrent-set" ); tr_bencDictAddStr( &top, "method", "torrent-set" );
addIdArg( args, id ); addIdArg( args, id );
tr_bencDictAddBool( args, "honorsSessionLimits", TRUE ); tr_bencDictAddBool( args, "honorsSessionLimits", TRUE );
break; break;
case 985: case 985:
tr_bencDictAddStr( &top, "method", "torrent-set" ); tr_bencDictAddStr( &top, "method", "torrent-set" );
addIdArg( args, id ); addIdArg( args, id );
tr_bencDictAddBool( args, "honorsSessionLimits", FALSE ); tr_bencDictAddBool( args, "honorsSessionLimits", FALSE );
break; break;
case TR_OPT_ERR: case TR_OPT_ERR:
fprintf( stderr, "invalid option\n" ); fprintf( stderr, "invalid option\n" );
showUsage( ); showUsage( );
@ -850,20 +850,20 @@ writeFunc( void * ptr,
} }
static void static void
etaToString( char * buf, size_t buflen, int64_t eta ) etaToString( char * buf, size_t buflen, int64_t eta )
{ {
if( eta < 0 ) if( eta < 0 )
tr_snprintf( buf, buflen, "Unknown" ); tr_snprintf( buf, buflen, "Unknown" );
else if( eta < 60 ) else if( eta < 60 )
tr_snprintf( buf, buflen, "%" PRId64 "sec", eta ); tr_snprintf( buf, buflen, "%" PRId64 "sec", eta );
else if( eta < ( 60 * 60 ) ) else if( eta < ( 60 * 60 ) )
tr_snprintf( buf, buflen, "%" PRId64 " min", eta / 60 ); tr_snprintf( buf, buflen, "%" PRId64 " min", eta / 60 );
else if( eta < ( 60 * 60 * 24 ) ) else if( eta < ( 60 * 60 * 24 ) )
tr_snprintf( buf, buflen, "%" PRId64 " hrs", eta / ( 60 * 60 ) ); tr_snprintf( buf, buflen, "%" PRId64 " hrs", eta / ( 60 * 60 ) );
else else
tr_snprintf( buf, buflen, "%" PRId64 " days", eta / ( 60 * 60 * 24 ) ); tr_snprintf( buf, buflen, "%" PRId64 " days", eta / ( 60 * 60 * 24 ) );
} }
static char* static char*
tr_strltime( char * buf, int seconds, size_t buflen ) tr_strltime( char * buf, int seconds, size_t buflen )
@ -1301,28 +1301,28 @@ printDetails( tr_benc * top )
tr_benc * t; tr_benc * t;
for( i=0; (( t = tr_bencListChild( l, i ))); ++i ) for( i=0; (( t = tr_bencListChild( l, i ))); ++i )
{ {
int64_t downloadCount; int64_t downloadCount;
tr_bool hasAnnounced; tr_bool hasAnnounced;
tr_bool hasScraped; tr_bool hasScraped;
const char * host; const char * host;
tr_bool isBackup; tr_bool isBackup;
int64_t lastAnnouncePeerCount; int64_t lastAnnouncePeerCount;
const char * lastAnnounceResult; const char * lastAnnounceResult;
int64_t lastAnnounceStartTime; int64_t lastAnnounceStartTime;
tr_bool lastAnnounceSucceeded; tr_bool lastAnnounceSucceeded;
int64_t lastAnnounceTime; int64_t lastAnnounceTime;
const char * lastScrapeResult; const char * lastScrapeResult;
tr_bool lastScrapeSucceeded; tr_bool lastScrapeSucceeded;
int64_t lastScrapeStartTime; int64_t lastScrapeStartTime;
int64_t lastScrapeTime; int64_t lastScrapeTime;
int64_t leecherCount; int64_t leecherCount;
int64_t nextAnnounceTime; int64_t nextAnnounceTime;
int64_t nextScrapeTime; int64_t nextScrapeTime;
int64_t seederCount; int64_t seederCount;
int64_t tier; int64_t tier;
int64_t announceState; int64_t announceState;
int64_t scrapeState; int64_t scrapeState;
if( tr_bencDictFindInt ( t, "downloadCount", &downloadCount ) && if( tr_bencDictFindInt ( t, "downloadCount", &downloadCount ) &&
tr_bencDictFindBool( t, "hasAnnounced", &hasAnnounced ) && tr_bencDictFindBool( t, "hasAnnounced", &hasAnnounced ) &&
tr_bencDictFindBool( t, "hasScraped", &hasScraped ) && tr_bencDictFindBool( t, "hasScraped", &hasScraped ) &&
@ -1392,7 +1392,7 @@ printDetails( tr_benc * top )
printf( " Tracker had %'d seeders and %'d leechers %s ago\n", printf( " Tracker had %'d seeders and %'d leechers %s ago\n",
(int)seederCount, (int)leecherCount, buf ); (int)seederCount, (int)leecherCount, buf );
else else
printf( " Got a scrape error \"%s\" %s ago\n", printf( " Got a scrape error \"%s\" %s ago\n",
lastScrapeResult, buf ); lastScrapeResult, buf );
} }

View File

@ -536,7 +536,7 @@ addURLDialog( GtkWindow * parent, TrCore * core )
e = gtk_entry_new( ); e = gtk_entry_new( );
g_object_set_data( G_OBJECT( w ), "url-entry", e ); g_object_set_data( G_OBJECT( w ), "url-entry", e );
hig_workarea_add_row( t, &row, _( "_URL" ), e, NULL ); hig_workarea_add_row( t, &row, _( "_URL" ), e, NULL );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( w )->vbox ), t, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( GTK_DIALOG( w )->vbox ), t, TRUE, TRUE, 0 );
gtk_widget_show_all( t ); gtk_widget_show_all( t );
gtk_widget_show( w ); gtk_widget_show( w );

View File

@ -760,7 +760,6 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n )
str = tr_strltime( buf, baseline, sizeof( buf ) ); str = tr_strltime( buf, baseline, sizeof( buf ) );
} }
gtr_label_set_text( GTK_LABEL( di->eta_lb ), str ); gtr_label_set_text( GTK_LABEL( di->eta_lb ), str );
/* size_lb */ /* size_lb */
@ -2115,7 +2114,7 @@ tracker_page_new( struct DetailsImpl * di )
g_object_set( G_OBJECT( r ), "ypad", (GUI_PAD+GUI_PAD_BIG)/2, g_object_set( G_OBJECT( r ), "ypad", (GUI_PAD+GUI_PAD_BIG)/2,
"xpad", (GUI_PAD+GUI_PAD_BIG)/2, "xpad", (GUI_PAD+GUI_PAD_BIG)/2,
NULL ); NULL );
sw = gtk_scrolled_window_new( NULL, NULL ); sw = gtk_scrolled_window_new( NULL, NULL );
gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sw ), gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sw ),
GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC,
@ -2149,7 +2148,7 @@ tracker_page_new( struct DetailsImpl * di )
gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), b ); gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), b );
g_signal_connect( w, "toggled", G_CALLBACK( onBackupToggled ), di ); g_signal_connect( w, "toggled", G_CALLBACK( onBackupToggled ), di );
gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 );
return vbox; return vbox;
} }

View File

@ -72,13 +72,13 @@ get_size_in_pixels( GtkWidget * widget,
gtk_icon_size_lookup_for_settings( gtk_widget_get_settings( widget ), gtk_icon_size_lookup_for_settings( gtk_widget_get_settings( widget ),
icon_size, icon_size,
&width, &width,
&height ); &height );
return MAX( width, height ); return MAX( width, height );
} }
static IconCache * static IconCache *
icon_cache_new (GtkWidget * for_widget, icon_cache_new (GtkWidget * for_widget,
int icon_size) int icon_size)
{ {
@ -87,7 +87,7 @@ icon_cache_new (GtkWidget * for_widget,
g_return_val_if_fail( for_widget != NULL, NULL ); g_return_val_if_fail( for_widget != NULL, NULL );
icon_cache = g_new0( IconCache, 1 ); icon_cache = g_new0( IconCache, 1 );
icon_cache->icon_theme = gtk_icon_theme_get_for_screen( gtk_widget_get_screen( for_widget )); icon_cache->icon_theme = gtk_icon_theme_get_for_screen( gtk_widget_get_screen( for_widget ));
icon_cache->icon_size = get_size_in_pixels( for_widget, icon_size ); icon_cache->icon_size = get_size_in_pixels( for_widget, icon_size );
icon_cache->cache = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref); icon_cache->cache = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
@ -193,7 +193,7 @@ _get_icon_pixbuf( GIcon *icon,
return NULL; return NULL;
} }
static GdkPixbuf * static GdkPixbuf *
icon_cache_get_mime_type_icon( IconCache * icon_cache, icon_cache_get_mime_type_icon( IconCache * icon_cache,
const char * mime_type ) const char * mime_type )
@ -259,20 +259,20 @@ icon_cache_get_mime_type_icon( IconCache * icon_cache,
#endif #endif
GdkPixbuf * GdkPixbuf *
get_mime_type_icon( const char * mime_type, get_mime_type_icon( const char * mime_type,
GtkIconSize icon_size, GtkIconSize icon_size,
GtkWidget * for_widget ) GtkWidget * for_widget )
{ {
int n; int n;
switch ( icon_size ) { switch ( icon_size ) {
case GTK_ICON_SIZE_MENU: n = 1; break; case GTK_ICON_SIZE_MENU: n = 1; break;
case GTK_ICON_SIZE_SMALL_TOOLBAR: n = 2; break; case GTK_ICON_SIZE_SMALL_TOOLBAR: n = 2; break;
case GTK_ICON_SIZE_LARGE_TOOLBAR: n = 3; break; case GTK_ICON_SIZE_LARGE_TOOLBAR: n = 3; break;
case GTK_ICON_SIZE_BUTTON: n = 4; break; case GTK_ICON_SIZE_BUTTON: n = 4; break;
case GTK_ICON_SIZE_DND: n = 5; break; case GTK_ICON_SIZE_DND: n = 5; break;
case GTK_ICON_SIZE_DIALOG: n = 6; break; case GTK_ICON_SIZE_DIALOG: n = 6; break;
default /*GTK_ICON_SIZE_INVALID*/: n = 0; break; default /*GTK_ICON_SIZE_INVALID*/: n = 0; break;
} }
@ -280,10 +280,10 @@ get_mime_type_icon( const char * mime_type,
icon_cache[n] = icon_cache_new( for_widget, icon_size ); icon_cache[n] = icon_cache_new( for_widget, icon_size );
return icon_cache_get_mime_type_icon( icon_cache[n], mime_type ); return icon_cache_get_mime_type_icon( icon_cache[n], mime_type );
} }
const char * const char *
get_mime_type_from_filename( const char * file G_GNUC_UNUSED ) get_mime_type_from_filename( const char * file G_GNUC_UNUSED )
{ {
#ifdef USE_GIO_ICONS #ifdef USE_GIO_ICONS

View File

@ -106,7 +106,7 @@ onProgressDialogRefresh( gpointer data )
gtk_dialog_set_response_sensitive( d, GTK_RESPONSE_CANCEL, !b->isDone ); gtk_dialog_set_response_sensitive( d, GTK_RESPONSE_CANCEL, !b->isDone );
gtk_dialog_set_response_sensitive( d, GTK_RESPONSE_CLOSE, b->isDone ); gtk_dialog_set_response_sensitive( d, GTK_RESPONSE_CLOSE, b->isDone );
gtk_dialog_set_response_sensitive( d, GTK_RESPONSE_ACCEPT, b->isDone && !b->result ); gtk_dialog_set_response_sensitive( d, GTK_RESPONSE_ACCEPT, b->isDone && !b->result );
g_free( base ); g_free( base );
return TRUE; return TRUE;
} }
@ -465,7 +465,7 @@ make_meta_ui( GtkWindow * parent, TrCore * core )
w = hig_workarea_add_wide_checkbutton( t, &row, _( "_Private torrent" ), FALSE ); w = hig_workarea_add_wide_checkbutton( t, &row, _( "_Private torrent" ), FALSE );
ui->private_check = w; ui->private_check = w;
hig_workarea_finish( t, &row ); hig_workarea_finish( t, &row );
gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), t, TRUE, TRUE, 0 ); gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), t, TRUE, TRUE, 0 );

View File

@ -492,7 +492,7 @@ get_pixbuf_from_icon(SexyIconEntry *entry, SexyIconEntryPosition icon_pos)
gtk_icon_size_lookup (size, &w, &h); gtk_icon_size_lookup (size, &w, &h);
pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), stock_id, size, 0, NULL); pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), stock_id, size, 0, NULL);
break; break;
default: default:
return NULL; return NULL;
} }

View File

@ -246,7 +246,7 @@ getStatusString( const tr_torrent * tor,
case TR_STATUS_DOWNLOAD: case TR_STATUS_DOWNLOAD:
{ {
if( tr_torrentHasMetadata( tor ) ) if( tr_torrentHasMetadata( tor ) )
{ {
g_string_append_printf( gstr, g_string_append_printf( gstr,
ngettext( "Downloading from %1$'d of %2$'d connected peer", ngettext( "Downloading from %1$'d of %2$'d connected peer",

View File

@ -526,7 +526,7 @@ watchdir_file_free( struct watchdir_file * f )
g_free( f->filename ); g_free( f->filename );
g_free( f ); g_free( f );
} }
static gboolean static gboolean
watchFolderIdle( gpointer gcore ) watchFolderIdle( gpointer gcore )
{ {
@ -1054,7 +1054,7 @@ tr_core_add_from_url( TrCore * core, const char * url )
err = tr_ctorSetMagnet( ctor, url ); err = tr_ctorSetMagnet( ctor, url );
if( !err ) if( !err )
{ {
tr_session * session = tr_core_session( core ); tr_session * session = tr_core_session( core );
TrTorrent * gtor = tr_torrent_new_ctor( session, ctor, &err ); TrTorrent * gtor = tr_torrent_new_ctor( session, ctor, &err );

View File

@ -70,7 +70,7 @@ tr_bool tr_announcerHasBacklog( const struct tr_announcer * );
void tr_announcerResetTorrent( struct tr_announcer*, tr_torrent* ); void tr_announcerResetTorrent( struct tr_announcer*, tr_torrent* );
tr_publisher_tag tr_announcerSubscribe( struct tr_torrent_tiers * tiers, tr_publisher_tag tr_announcerSubscribe( struct tr_torrent_tiers * tiers,
tr_delivery_func func, tr_delivery_func func,
void * userData ); void * userData );

View File

@ -815,7 +815,6 @@ tr_fdGetFileLimit( const tr_session * session )
{ {
return session && session->fdInfo ? session->fdInfo->openFileLimit : -1; return session && session->fdInfo ? session->fdInfo->openFileLimit : -1;
} }
void void
tr_fdSetPeerLimit( tr_session * session, int socketLimit ) tr_fdSetPeerLimit( tr_session * session, int socketLimit )

View File

@ -30,7 +30,7 @@
enum enum
{ {
/** when we're making requests from another peer, /** when we're making requests from another peer,
batch them together to send enough requests to batch them together to send enough requests to
meet our bandwidth goals for the next N seconds */ meet our bandwidth goals for the next N seconds */
REQUEST_BUF_SECS = 10 REQUEST_BUF_SECS = 10

View File

@ -2974,7 +2974,7 @@ compareReconnectTorrents( const void * va, const void * vb )
return 0; return 0;
} }
static void static void
reconnectPulse( int foo UNUSED, short bar UNUSED, void * vmgr ) reconnectPulse( int foo UNUSED, short bar UNUSED, void * vmgr )
{ {

View File

@ -168,7 +168,7 @@ void tr_peerMgrSetBlame( tr_torrent * tor,
tr_piece_index_t pieceIndex, tr_piece_index_t pieceIndex,
int success ); int success );
enum enum
{ {
TR_PEERS_CONNECTED, TR_PEERS_CONNECTED,
TR_PEERS_ALL TR_PEERS_ALL

View File

@ -1768,7 +1768,7 @@ updateMetadataRequests( tr_peermsgs * msgs, time_t now )
static void static void
updateBlockRequests( tr_peermsgs * msgs ) updateBlockRequests( tr_peermsgs * msgs )
{ {
if( ( msgs->desiredRequestCount > 0 ) && if( ( msgs->desiredRequestCount > 0 ) &&
( msgs->peer->pendingReqsToPeer <= ( msgs->desiredRequestCount * 0.66 ) ) ) ( msgs->peer->pendingReqsToPeer <= ( msgs->desiredRequestCount * 0.66 ) ) )
{ {
int i; int i;

View File

@ -898,7 +898,7 @@ void tr_ctorSetDownloadDir( tr_ctor * ctor,
* the only place where it should be used. * the only place where it should be used.
*/ */
void tr_ctorSetIncompleteDir( tr_ctor * ctor, const char * directory ); void tr_ctorSetIncompleteDir( tr_ctor * ctor, const char * directory );
/** Set whether or not the torrent begins downloading/seeding when created. /** Set whether or not the torrent begins downloading/seeding when created.
(Default: not paused) */ (Default: not paused) */
void tr_ctorSetPaused( tr_ctor * ctor, void tr_ctorSetPaused( tr_ctor * ctor,
@ -1411,15 +1411,15 @@ typedef struct
int lastAnnouncePeerCount; int lastAnnouncePeerCount;
/* human-readable string with the result of the last announce. /* human-readable string with the result of the last announce.
if "hasAnnounced" is false, this field is undefined */ if "hasAnnounced" is false, this field is undefined */
char lastAnnounceResult[128]; char lastAnnounceResult[128];
/* when the last announce was sent to the tracker. /* when the last announce was sent to the tracker.
* if "hasAnnounced" is false, this field is undefined */ * if "hasAnnounced" is false, this field is undefined */
time_t lastAnnounceStartTime; time_t lastAnnounceStartTime;
/* whether or not the last announce was a success. /* whether or not the last announce was a success.
if "hasAnnounced" is false, this field is undefined */ if "hasAnnounced" is false, this field is undefined */
tr_bool lastAnnounceSucceeded; tr_bool lastAnnounceSucceeded;
/* when the last announce was completed. /* when the last announce was completed.
@ -1435,7 +1435,7 @@ typedef struct
time_t lastScrapeStartTime; time_t lastScrapeStartTime;
/* whether or not the last scrape was a success. /* whether or not the last scrape was a success.
if "hasAnnounced" is false, this field is undefined */ if "hasAnnounced" is false, this field is undefined */
tr_bool lastScrapeSucceeded; tr_bool lastScrapeSucceeded;
/* when the last scrape was completed. /* when the last scrape was completed.
@ -1468,7 +1468,6 @@ void tr_torrentTrackersFree( tr_tracker_stat * trackerStats,
int trackerCount ); int trackerCount );
/** /**
* @brief get the download speeds for each of this torrent's webseed sources. * @brief get the download speeds for each of this torrent's webseed sources.
@ -1679,10 +1678,10 @@ typedef struct tr_stat
@see tr_stat.leftUntilDone */ @see tr_stat.leftUntilDone */
float percentDone; float percentDone;
/** The percentage of the actual ratio to the seed ratio. This will be /** The percentage of the actual ratio to the seed ratio. This will be
equal to 1 if the ratio is reached or the torrent is set to seed forever. equal to 1 if the ratio is reached or the torrent is set to seed forever.
Range is [0..1] */ Range is [0..1] */
float percentRatio; float percentRatio;
/** Speed all data being sent for this torrent. (KiB/s) /** Speed all data being sent for this torrent. (KiB/s)
This includes piece data, protocol messages, and TCP overhead */ This includes piece data, protocol messages, and TCP overhead */

View File

@ -167,7 +167,7 @@ tr_getQueuedMessages( void )
ret = messageQueue; ret = messageQueue;
messageQueue = NULL; messageQueue = NULL;
messageQueueTail = &messageQueue; messageQueueTail = &messageQueue;
messageQueueCount = 0; messageQueueCount = 0;
tr_lockUnlock( messageLock ); tr_lockUnlock( messageLock );
@ -307,16 +307,16 @@ tr_msg( const char * file, int line,
*messageQueueTail = newmsg; *messageQueueTail = newmsg;
messageQueueTail = &newmsg->next; messageQueueTail = &newmsg->next;
++messageQueueCount; ++messageQueueCount;
if( messageQueueCount > TR_MAX_MSG_LOG ) if( messageQueueCount > TR_MAX_MSG_LOG )
{ {
tr_msg_list * old = messageQueue; tr_msg_list * old = messageQueue;
messageQueue = old->next; messageQueue = old->next;
old->next = NULL; old->next = NULL;
tr_freeMessageList(old); tr_freeMessageList(old);
--messageQueueCount; --messageQueueCount;
assert( messageQueueCount == TR_MAX_MSG_LOG ); assert( messageQueueCount == TR_MAX_MSG_LOG );
} }
} }

View File

@ -515,7 +515,7 @@ static inline void tr_removeElementFromArray( void * array,
extern time_t transmission_now; extern time_t transmission_now;
/** /**
* @brief very inexpensive form of time(NULL) * @brief very inexpensive form of time(NULL)
* @return the current epoch time in seconds * @return the current epoch time in seconds
* *
* This function returns a second counter that is updated once per second. * This function returns a second counter that is updated once per second.

View File

@ -151,7 +151,7 @@ Details :: Details( Session& session, TorrentModel& model, QWidget * parent ):
myTimer.setSingleShot( false ); myTimer.setSingleShot( false );
myTimer.start( REFRESH_INTERVAL_MSEC ); myTimer.start( REFRESH_INTERVAL_MSEC );
} }
Details :: ~Details( ) Details :: ~Details( )
{ {
} }
@ -182,7 +182,7 @@ Details :: setIds( const QSet<int>& ids )
foreach( QWidget * w, myWidgets ) foreach( QWidget * w, myWidgets )
w->setEnabled( false ); w->setEnabled( false );
onTimer( ); onTimer( );
} }
@ -229,7 +229,7 @@ Details :: refresh( )
} }
/// ///
/// activity tab /// activity tab
/// ///
// myStateLabel // myStateLabel
@ -348,7 +348,7 @@ Details :: refresh( )
string = tr( "Unknown" ); string = tr( "Unknown" );
else else
string = Utils::timeToString( baseline ); string = Utils::timeToString( baseline );
} }
} }
myETALabel->setText( string ); myETALabel->setText( string );
@ -482,8 +482,7 @@ Details :: refresh( )
string = tr( "Created by %1 on %2" ).arg( creator ).arg( date ); string = tr( "Created by %1 on %2" ).arg( creator ).arg( date );
} }
myOriginLabel->setText( string ); myOriginLabel->setText( string );
// myLocationLabel // myLocationLabel
if( torrents.empty( ) ) if( torrents.empty( ) )
string = none; string = none;
@ -782,7 +781,7 @@ Details :: refresh( )
if( single ) if( single )
myFileTreeView->update( torrents[0]->files( ) ); myFileTreeView->update( torrents[0]->files( ) );
else else
myFileTreeView->clear( ); myFileTreeView->clear( );
myHavePendingRefresh = false; myHavePendingRefresh = false;
@ -952,7 +951,6 @@ Details :: createOptionsTab( )
connect( m, SIGNAL(currentIndexChanged(int)), this, SLOT(onBandwidthPriorityChanged(int))); connect( m, SIGNAL(currentIndexChanged(int)), this, SLOT(onBandwidthPriorityChanged(int)));
hig->addRow( tr( "Torrent &priority:" ), m ); hig->addRow( tr( "Torrent &priority:" ), m );
myBandwidthPriorityCombo = m; myBandwidthPriorityCombo = m;
hig->addSectionDivider( ); hig->addSectionDivider( );
hig->addSectionTitle( tr( "Seed-Until Ratio" ) ); hig->addSectionTitle( tr( "Seed-Until Ratio" ) );

View File

@ -47,7 +47,7 @@ FileTreeItem :: ~FileTreeItem( )
const int pos = myParent->myChildren.indexOf( this ); const int pos = myParent->myChildren.indexOf( this );
if( pos >= 0 ) if( pos >= 0 )
myParent->myChildren.removeAt( pos ); myParent->myChildren.removeAt( pos );
else else
assert( 0 && "failed to remove" ); assert( 0 && "failed to remove" );
} }
} }
@ -252,7 +252,7 @@ FileTreeModel :: FileTreeModel( QObject *parent ):
{ {
rootItem = new FileTreeItem( -1 ); rootItem = new FileTreeItem( -1 );
} }
FileTreeModel :: ~FileTreeModel( ) FileTreeModel :: ~FileTreeModel( )
{ {
clear( ); clear( );
@ -299,7 +299,7 @@ FileTreeModel :: headerData( int column, Qt::Orientation orientation, int role )
default: break; default: break;
} }
} }
return data; return data;
} }
@ -602,7 +602,7 @@ FileTreeView :: FileTreeView( QWidget * parent ):
this, SIGNAL(wantedChanged(const QSet<int>&, bool))); this, SIGNAL(wantedChanged(const QSet<int>&, bool)));
} }
bool bool
FileTreeView :: eventFilter( QObject * o, QEvent * event ) FileTreeView :: eventFilter( QObject * o, QEvent * event )
{ {
if( o != this ) if( o != this )

View File

@ -36,7 +36,7 @@ HIG :: ~HIG( )
{ {
delete myGrid; delete myGrid;
} }
/*** /***
**** ****
***/ ***/

View File

@ -25,7 +25,7 @@ LicenseDialog :: LicenseDialog( QWidget * parent ):
QPlainTextEdit * t = new QPlainTextEdit( this ); QPlainTextEdit * t = new QPlainTextEdit( this );
t->setReadOnly( true ); t->setReadOnly( true );
t->setPlainText( t->setPlainText(
"The OS X client, CLI client, and parts of libtransmission are licensed under the terms of the MIT license.\n\n" "The OS X client, CLI client, and parts of libtransmission are licensed under the terms of the MIT license.\n\n"
"The Transmission daemon, GTK+ client, Qt client, Web client, and most of libtransmission are licensed under the terms of the GNU GPL version 2, with two special exceptions:\n\n" "The Transmission daemon, GTK+ client, Qt client, Web client, and most of libtransmission are licensed under the terms of the GNU GPL version 2, with two special exceptions:\n\n"
"1. The MIT-licensed portions of Transmission listed above are exempt from GPLv2 clause 2(b) and may retain their MIT license.\n\n" "1. The MIT-licensed portions of Transmission listed above are exempt from GPLv2 clause 2(b) and may retain their MIT license.\n\n"

View File

@ -472,7 +472,7 @@ TrMainWindow :: createStatusBar( )
h->addWidget( l ); h->addWidget( l );
h->addStretch( 1 ); h->addStretch( 1 );
a = new QActionGroup( this ); a = new QActionGroup( this );
a->addAction( ui.action_TotalRatio ); a->addAction( ui.action_TotalRatio );
a->addAction( ui.action_TotalTransfer ); a->addAction( ui.action_TotalTransfer );
@ -491,10 +491,10 @@ TrMainWindow :: createStatusBar( )
p->setIcon( QIcon( ":/icons/ratio.png" ) ); p->setIcon( QIcon( ":/icons/ratio.png" ) );
p->setFlat( true ); p->setFlat( true );
p->setMenu( m ); p->setMenu( m );
h->addWidget( p ); h->addWidget( p );
l = myStatsLabel = new QLabel( this ); l = myStatsLabel = new QLabel( this );
h->addWidget( l ); h->addWidget( l );
w = new QWidget( this ); w = new QWidget( this );
w->setMinimumSize( HIG::PAD_BIG, 1 ); w->setMinimumSize( HIG::PAD_BIG, 1 );
w->setMaximumSize( HIG::PAD_BIG, 1 ); w->setMaximumSize( HIG::PAD_BIG, 1 );
@ -987,7 +987,7 @@ TrMainWindow :: refreshPref( int key )
case Prefs::DSPEED_ENABLED: case Prefs::DSPEED_ENABLED:
(myPrefs.get<bool>(key) ? myDlimitOnAction : myDlimitOffAction)->setChecked( true ); (myPrefs.get<bool>(key) ? myDlimitOnAction : myDlimitOffAction)->setChecked( true );
break; break;
case Prefs::DSPEED: case Prefs::DSPEED:
myDlimitOnAction->setText( tr( "Limited at %1" ).arg( Utils::speedToString( Speed::fromKbps( myPrefs.get<int>(key) ) ) ) ); myDlimitOnAction->setText( tr( "Limited at %1" ).arg( Utils::speedToString( Speed::fromKbps( myPrefs.get<int>(key) ) ) ) );
break; break;
@ -995,7 +995,7 @@ TrMainWindow :: refreshPref( int key )
case Prefs::USPEED_ENABLED: case Prefs::USPEED_ENABLED:
(myPrefs.get<bool>(key) ? myUlimitOnAction : myUlimitOffAction)->setChecked( true ); (myPrefs.get<bool>(key) ? myUlimitOnAction : myUlimitOffAction)->setChecked( true );
break; break;
case Prefs::USPEED: case Prefs::USPEED:
myUlimitOnAction->setText( tr( "Limited at %1" ).arg( Utils::speedToString( Speed::fromKbps( myPrefs.get<int>(key) ) ) ) ); myUlimitOnAction->setText( tr( "Limited at %1" ).arg( Utils::speedToString( Speed::fromKbps( myPrefs.get<int>(key) ) ) ) );
break; break;

View File

@ -75,8 +75,8 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam
layout->addWidget( p, row, 1 ); layout->addWidget( p, row, 1 );
l->setBuddy( p ); l->setBuddy( p );
connect( p, SIGNAL(clicked(bool)), this, SLOT(onFilenameClicked())); connect( p, SIGNAL(clicked(bool)), this, SLOT(onFilenameClicked()));
if( session.isLocal( ) ) if( session.isLocal( ) )
{ {
const QFileIconProvider iconProvider; const QFileIconProvider iconProvider;
const QIcon folderIcon = iconProvider.icon( QFileIconProvider::Folder ); const QIcon folderIcon = iconProvider.icon( QFileIconProvider::Folder );
@ -93,10 +93,10 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam
l->setBuddy( p ); l->setBuddy( p );
connect( p, SIGNAL(clicked(bool)), this, SLOT(onDestinationClicked())); connect( p, SIGNAL(clicked(bool)), this, SLOT(onDestinationClicked()));
} }
myTree = new FileTreeView; myTree = new FileTreeView;
layout->addWidget( myTree, ++row, 0, 1, 2 ); layout->addWidget( myTree, ++row, 0, 1, 2 );
if( !session.isLocal( ) ) if( !session.isLocal( ) )
myTree->hideColumn( 1 ); // hide the % done, since we've no way of knowing myTree->hideColumn( 1 ); // hide the % done, since we've no way of knowing
if( session.isLocal( ) ) if( session.isLocal( ) )
@ -132,7 +132,7 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam
reload( ); reload( );
} }
Options :: ~Options( ) Options :: ~Options( )
{ {
clearInfo( ); clearInfo( );

View File

@ -436,7 +436,7 @@ PrefsDialog :: onUpdateBlocklistClicked( )
myBlocklistDialog->show( ); myBlocklistDialog->show( );
mySession.updateBlocklist( ); mySession.updateBlocklist( );
} }
void void
PrefsDialog :: encryptionEdited( int i ) PrefsDialog :: encryptionEdited( int i )
{ {
@ -680,8 +680,8 @@ PrefsDialog :: updatePref( int key )
const bool enabled( myPrefs.getBool( Prefs::RPC_ENABLED ) ); const bool enabled( myPrefs.getBool( Prefs::RPC_ENABLED ) );
const bool whitelist( myPrefs.getBool( Prefs::RPC_WHITELIST_ENABLED ) ); const bool whitelist( myPrefs.getBool( Prefs::RPC_WHITELIST_ENABLED ) );
const bool auth( myPrefs.getBool( Prefs::RPC_AUTH_REQUIRED ) ); const bool auth( myPrefs.getBool( Prefs::RPC_AUTH_REQUIRED ) );
foreach( QWidget * w, myWebWhitelistWidgets ) w->setEnabled( enabled && whitelist ); foreach( QWidget * w, myWebWhitelistWidgets ) w->setEnabled( enabled && whitelist );
foreach( QWidget * w, myWebAuthWidgets ) w->setEnabled( enabled && auth ); foreach( QWidget * w, myWebAuthWidgets ) w->setEnabled( enabled && auth );
foreach( QWidget * w, myWebWidgets ) w->setEnabled( enabled ); foreach( QWidget * w, myWebWidgets ) w->setEnabled( enabled );
break; break;
} }
@ -690,7 +690,7 @@ PrefsDialog :: updatePref( int key )
case Prefs :: PROXY_AUTH_ENABLED: { case Prefs :: PROXY_AUTH_ENABLED: {
const bool enabled( myPrefs.getBool( Prefs::PROXY_ENABLED ) ); const bool enabled( myPrefs.getBool( Prefs::PROXY_ENABLED ) );
const bool auth( myPrefs.getBool( Prefs::PROXY_AUTH_ENABLED ) ); const bool auth( myPrefs.getBool( Prefs::PROXY_AUTH_ENABLED ) );
foreach( QWidget * w, myProxyAuthWidgets ) w->setEnabled( enabled && auth ); foreach( QWidget * w, myProxyAuthWidgets ) w->setEnabled( enabled && auth );
foreach( QWidget * w, myProxyWidgets ) w->setEnabled( enabled ); foreach( QWidget * w, myProxyWidgets ) w->setEnabled( enabled );
break; break;
} }
@ -733,7 +733,6 @@ PrefsDialog :: updatePref( int key )
myIncompleteButton->setEnabled( enabled ); myIncompleteButton->setEnabled( enabled );
break; break;
} }
default: default:
break; break;

View File

@ -114,4 +114,4 @@ SessionDialog :: SessionDialog( Session& session, Prefs& prefs, QWidget * parent
connect( buttons, SIGNAL(rejected()), this, SLOT(hide())); connect( buttons, SIGNAL(rejected()), this, SLOT(hide()));
connect( buttons, SIGNAL(accepted()), this, SLOT(onAccepted())); connect( buttons, SIGNAL(accepted()), this, SLOT(onAccepted()));
top->addWidget( buttons, 0 ); top->addWidget( buttons, 0 );
} }

View File

@ -155,8 +155,8 @@ Session :: updatePref( int key )
break; break;
case Prefs :: RATIO: case Prefs :: RATIO:
sessionSet( "seedRatioLimit", myPrefs.variant(key) ); sessionSet( "seedRatioLimit", myPrefs.variant(key) );
break; break;
case Prefs :: RATIO_ENABLED: case Prefs :: RATIO_ENABLED:
sessionSet( "seedRatioLimited", myPrefs.variant(key) ); sessionSet( "seedRatioLimited", myPrefs.variant(key) );
break; break;
@ -718,7 +718,7 @@ Session :: parseResponse( const char * json, size_t jsonLength )
QString::fromUtf8(str), QString::fromUtf8(str),
QMessageBox::Close, QMessageBox::Close,
QApplication::activeWindow()); QApplication::activeWindow());
QPixmap pixmap; QPixmap pixmap;
QIcon icon = QtIconLoader :: icon( "dialog-information" ); QIcon icon = QtIconLoader :: icon( "dialog-information" );
if( !icon.isNull( ) ) { if( !icon.isNull( ) ) {
const int size = QApplication::style()->pixelMetric( QStyle::PM_LargeIconSize ); const int size = QApplication::style()->pixelMetric( QStyle::PM_LargeIconSize );

View File

@ -136,8 +136,8 @@ TorrentDelegateMin :: drawTorrent( QPainter * painter, const QStyleOptionViewIte
const QRect barArea( nameArea.left( ), const QRect barArea( nameArea.left( ),
nameArea.bottom( ), nameArea.bottom( ),
statusArea.right( ) - nameArea.left( ), statusArea.right( ) - nameArea.left( ),
BAR_HEIGHT ); BAR_HEIGHT );
// render // render
if( tor.hasError( ) ) if( tor.hasError( ) )
painter->setPen( QColor( "red" ) ); painter->setPen( QColor( "red" ) );

View File

@ -66,7 +66,7 @@ TorrentDelegate :: progressString( const Torrent& tor ) const
const bool isSeed( tor.isSeed( ) ); const bool isSeed( tor.isSeed( ) );
const uint64_t haveTotal( tor.haveTotal( ) ); const uint64_t haveTotal( tor.haveTotal( ) );
QString str; QString str;
double seedRatio; double seedRatio;
bool hasSeedRatio; bool hasSeedRatio;
if( !isDone ) if( !isDone )

View File

@ -216,7 +216,7 @@ Torrent :: setDateTime( int i, const QDateTime& value )
return changed; return changed;
} }
bool bool
Torrent :: setSize( int i, qulonglong value ) Torrent :: setSize( int i, qulonglong value )
{ {
@ -498,7 +498,6 @@ Torrent :: update( tr_benc * d )
default: default:
assert( 0 && "unhandled type" ); assert( 0 && "unhandled type" );
} }
} }
tr_benc * files; tr_benc * files;