diff --git a/daemon/remote.c b/daemon/remote.c index 3893d7397..4134f4f42 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -637,7 +637,7 @@ readargs( int argc, const char ** argv ) tr_bencDictAddStr( &top, "method", "session-stats" ); tr_bencDictAddInt( &top, "tag", TAG_STATS ); break; - + case 930: tr_bencDictAddStr( &top, "method", "torrent-set" ); addIdArg( args, id ); @@ -705,85 +705,85 @@ readargs( int argc, const char ** argv ) tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_ENABLED, TRUE ); break; - + case 971: tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_ENABLED, FALSE ); break; - + case 972: tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddInt( args, TR_PREFS_KEY_ALT_SPEED_DOWN, numarg( optarg ) ); break; - + case 973: tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddInt( args, TR_PREFS_KEY_ALT_SPEED_UP, numarg( optarg ) ); break; - + case 974: tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, TRUE ); break; - + case 975: tr_bencDictAddStr( &top, "method", "session-set" ); tr_bencDictAddBool( args, TR_PREFS_KEY_ALT_SPEED_TIME_ENABLED, FALSE ); break; - + case 976: tr_bencDictAddStr( &top, "method", "session-set" ); addTime( args, TR_PREFS_KEY_ALT_SPEED_TIME_BEGIN, optarg); break; - + case 977: - tr_bencDictAddStr( &top, "method", "session-set" ); + tr_bencDictAddStr( &top, "method", "session-set" ); addTime( args, TR_PREFS_KEY_ALT_SPEED_TIME_END, optarg); break; - + case 978: tr_bencDictAddStr( &top, "method", "session-set" ); addDays( args, TR_PREFS_KEY_ALT_SPEED_TIME_DAY, optarg ); break; - + case 980: tr_bencDictAddStr( &top, "method", "torrent-set" ); addIdArg( args, id ); tr_bencDictAddInt( args, "downloadLimit", numarg( optarg ) ); tr_bencDictAddBool( args, "downloadLimited", TRUE ); break; - + case 981: tr_bencDictAddStr( &top, "method", "torrent-set" ); addIdArg( args, id ); tr_bencDictAddBool( args, "downloadLimited", FALSE ); break; - + case 982: tr_bencDictAddStr( &top, "method", "torrent-set" ); addIdArg( args, id ); tr_bencDictAddInt( args, "uploadLimit", numarg( optarg ) ); tr_bencDictAddBool( args, "uploadLimited", TRUE ); break; - + case 983: tr_bencDictAddStr( &top, "method", "torrent-set" ); addIdArg( args, id ); tr_bencDictAddBool( args, "uploadLimited", FALSE ); break; - + case 984: tr_bencDictAddStr( &top, "method", "torrent-set" ); addIdArg( args, id ); tr_bencDictAddBool( args, "honorsSessionLimits", TRUE ); break; - + case 985: tr_bencDictAddStr( &top, "method", "torrent-set" ); addIdArg( args, id ); tr_bencDictAddBool( args, "honorsSessionLimits", FALSE ); break; - + case TR_OPT_ERR: fprintf( stderr, "invalid option\n" ); showUsage( ); @@ -850,20 +850,20 @@ writeFunc( void * ptr, } -static void -etaToString( char * buf, size_t buflen, int64_t eta ) -{ +static void +etaToString( char * buf, size_t buflen, int64_t eta ) +{ if( eta < 0 ) - tr_snprintf( buf, buflen, "Unknown" ); + tr_snprintf( buf, buflen, "Unknown" ); else if( eta < 60 ) - tr_snprintf( buf, buflen, "%" PRId64 "sec", eta ); + tr_snprintf( buf, buflen, "%" PRId64 "sec", eta ); 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 ) ) - tr_snprintf( buf, buflen, "%" PRId64 " hrs", eta / ( 60 * 60 ) ); + tr_snprintf( buf, buflen, "%" PRId64 " hrs", eta / ( 60 * 60 ) ); else - tr_snprintf( buf, buflen, "%" PRId64 " days", eta / ( 60 * 60 * 24 ) ); -} + tr_snprintf( buf, buflen, "%" PRId64 " days", eta / ( 60 * 60 * 24 ) ); +} static char* tr_strltime( char * buf, int seconds, size_t buflen ) @@ -1301,28 +1301,28 @@ printDetails( tr_benc * top ) tr_benc * t; for( i=0; (( t = tr_bencListChild( l, i ))); ++i ) { - int64_t downloadCount; - tr_bool hasAnnounced; - tr_bool hasScraped; + int64_t downloadCount; + tr_bool hasAnnounced; + tr_bool hasScraped; const char * host; - tr_bool isBackup; - int64_t lastAnnouncePeerCount; - const char * lastAnnounceResult; - int64_t lastAnnounceStartTime; - tr_bool lastAnnounceSucceeded; - int64_t lastAnnounceTime; - const char * lastScrapeResult; - tr_bool lastScrapeSucceeded; - int64_t lastScrapeStartTime; - int64_t lastScrapeTime; - int64_t leecherCount; - int64_t nextAnnounceTime; - int64_t nextScrapeTime; + tr_bool isBackup; + int64_t lastAnnouncePeerCount; + const char * lastAnnounceResult; + int64_t lastAnnounceStartTime; + tr_bool lastAnnounceSucceeded; + int64_t lastAnnounceTime; + const char * lastScrapeResult; + tr_bool lastScrapeSucceeded; + int64_t lastScrapeStartTime; + int64_t lastScrapeTime; + int64_t leecherCount; + int64_t nextAnnounceTime; + int64_t nextScrapeTime; int64_t seederCount; int64_t tier; int64_t announceState; int64_t scrapeState; - + if( tr_bencDictFindInt ( t, "downloadCount", &downloadCount ) && tr_bencDictFindBool( t, "hasAnnounced", &hasAnnounced ) && tr_bencDictFindBool( t, "hasScraped", &hasScraped ) && @@ -1392,7 +1392,7 @@ printDetails( tr_benc * top ) printf( " Tracker had %'d seeders and %'d leechers %s ago\n", (int)seederCount, (int)leecherCount, buf ); else - printf( " Got a scrape error \"%s\" %s ago\n", + printf( " Got a scrape error \"%s\" %s ago\n", lastScrapeResult, buf ); } diff --git a/gtk/add-dialog.c b/gtk/add-dialog.c index bf89ed7e4..90f62b319 100644 --- a/gtk/add-dialog.c +++ b/gtk/add-dialog.c @@ -536,7 +536,7 @@ addURLDialog( GtkWindow * parent, TrCore * core ) e = gtk_entry_new( ); g_object_set_data( G_OBJECT( w ), "url-entry", e ); hig_workarea_add_row( t, &row, _( "_URL" ), e, NULL ); - + gtk_box_pack_start( GTK_BOX( GTK_DIALOG( w )->vbox ), t, TRUE, TRUE, 0 ); gtk_widget_show_all( t ); gtk_widget_show( w ); diff --git a/gtk/details.c b/gtk/details.c index cbfd01191..bc1c6eb98 100644 --- a/gtk/details.c +++ b/gtk/details.c @@ -760,7 +760,6 @@ refreshInfo( struct DetailsImpl * di, tr_torrent ** torrents, int n ) str = tr_strltime( buf, baseline, sizeof( buf ) ); } gtr_label_set_text( GTK_LABEL( di->eta_lb ), str ); - /* 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, "xpad", (GUI_PAD+GUI_PAD_BIG)/2, NULL ); - + sw = gtk_scrolled_window_new( NULL, NULL ); gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW( sw ), GTK_POLICY_AUTOMATIC, @@ -2149,7 +2148,7 @@ tracker_page_new( struct DetailsImpl * di ) gtk_toggle_button_set_active( GTK_TOGGLE_BUTTON( w ), b ); g_signal_connect( w, "toggled", G_CALLBACK( onBackupToggled ), di ); gtk_box_pack_start( GTK_BOX( vbox ), w, FALSE, FALSE, 0 ); - + return vbox; } diff --git a/gtk/icons.c b/gtk/icons.c index b913c1123..db4752e54 100644 --- a/gtk/icons.c +++ b/gtk/icons.c @@ -72,13 +72,13 @@ get_size_in_pixels( GtkWidget * widget, gtk_icon_size_lookup_for_settings( gtk_widget_get_settings( widget ), icon_size, - &width, + &width, &height ); return MAX( width, height ); } -static IconCache * +static IconCache * icon_cache_new (GtkWidget * for_widget, int icon_size) { @@ -87,7 +87,7 @@ icon_cache_new (GtkWidget * for_widget, g_return_val_if_fail( for_widget != NULL, NULL ); 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->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; } - + static GdkPixbuf * icon_cache_get_mime_type_icon( IconCache * icon_cache, const char * mime_type ) @@ -259,20 +259,20 @@ icon_cache_get_mime_type_icon( IconCache * icon_cache, #endif -GdkPixbuf * +GdkPixbuf * get_mime_type_icon( const char * mime_type, GtkIconSize icon_size, GtkWidget * for_widget ) { int n; - + switch ( icon_size ) { case GTK_ICON_SIZE_MENU: n = 1; break; case GTK_ICON_SIZE_SMALL_TOOLBAR: n = 2; break; case GTK_ICON_SIZE_LARGE_TOOLBAR: n = 3; break; case GTK_ICON_SIZE_BUTTON: n = 4; 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; } @@ -280,10 +280,10 @@ get_mime_type_icon( const char * mime_type, icon_cache[n] = icon_cache_new( for_widget, icon_size ); 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 ) { #ifdef USE_GIO_ICONS diff --git a/gtk/makemeta-ui.c b/gtk/makemeta-ui.c index 4deb55a76..2e8c555fc 100644 --- a/gtk/makemeta-ui.c +++ b/gtk/makemeta-ui.c @@ -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_CLOSE, b->isDone ); gtk_dialog_set_response_sensitive( d, GTK_RESPONSE_ACCEPT, b->isDone && !b->result ); - + g_free( base ); return TRUE; } @@ -465,7 +465,7 @@ make_meta_ui( GtkWindow * parent, TrCore * core ) w = hig_workarea_add_wide_checkbutton( t, &row, _( "_Private torrent" ), FALSE ); ui->private_check = w; - + hig_workarea_finish( t, &row ); gtk_box_pack_start( GTK_BOX( GTK_DIALOG( d )->vbox ), t, TRUE, TRUE, 0 ); diff --git a/gtk/sexy-icon-entry.c b/gtk/sexy-icon-entry.c index 5888880a6..c21b2e0bc 100644 --- a/gtk/sexy-icon-entry.c +++ b/gtk/sexy-icon-entry.c @@ -492,7 +492,7 @@ get_pixbuf_from_icon(SexyIconEntry *entry, SexyIconEntryPosition icon_pos) gtk_icon_size_lookup (size, &w, &h); pixbuf = gtk_icon_theme_load_icon (gtk_icon_theme_get_default (), stock_id, size, 0, NULL); break; - + default: return NULL; } diff --git a/gtk/torrent-cell-renderer.c b/gtk/torrent-cell-renderer.c index e07b268b1..70f22850c 100644 --- a/gtk/torrent-cell-renderer.c +++ b/gtk/torrent-cell-renderer.c @@ -246,7 +246,7 @@ getStatusString( const tr_torrent * tor, case TR_STATUS_DOWNLOAD: { - if( tr_torrentHasMetadata( tor ) ) + if( tr_torrentHasMetadata( tor ) ) { g_string_append_printf( gstr, ngettext( "Downloading from %1$'d of %2$'d connected peer", diff --git a/gtk/tr-core.c b/gtk/tr-core.c index e2c00b1ee..e9c12845b 100644 --- a/gtk/tr-core.c +++ b/gtk/tr-core.c @@ -526,7 +526,7 @@ watchdir_file_free( struct watchdir_file * f ) g_free( f->filename ); g_free( f ); } - + static gboolean watchFolderIdle( gpointer gcore ) { @@ -1054,7 +1054,7 @@ tr_core_add_from_url( TrCore * core, const char * url ) err = tr_ctorSetMagnet( ctor, url ); - if( !err ) + if( !err ) { tr_session * session = tr_core_session( core ); TrTorrent * gtor = tr_torrent_new_ctor( session, ctor, &err ); diff --git a/libtransmission/announcer.h b/libtransmission/announcer.h index 351dc121f..129667293 100644 --- a/libtransmission/announcer.h +++ b/libtransmission/announcer.h @@ -70,7 +70,7 @@ tr_bool tr_announcerHasBacklog( const struct tr_announcer * ); 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, void * userData ); diff --git a/libtransmission/fdlimit.c b/libtransmission/fdlimit.c index ef0265c56..cf3fc249f 100644 --- a/libtransmission/fdlimit.c +++ b/libtransmission/fdlimit.c @@ -815,7 +815,6 @@ tr_fdGetFileLimit( const tr_session * session ) { return session && session->fdInfo ? session->fdInfo->openFileLimit : -1; } - void tr_fdSetPeerLimit( tr_session * session, int socketLimit ) diff --git a/libtransmission/peer-common.h b/libtransmission/peer-common.h index fdb8d70b9..dc06e144f 100644 --- a/libtransmission/peer-common.h +++ b/libtransmission/peer-common.h @@ -30,7 +30,7 @@ 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 meet our bandwidth goals for the next N seconds */ REQUEST_BUF_SECS = 10 diff --git a/libtransmission/peer-mgr.c b/libtransmission/peer-mgr.c index 045c1f746..af7f65ecd 100644 --- a/libtransmission/peer-mgr.c +++ b/libtransmission/peer-mgr.c @@ -2974,7 +2974,7 @@ compareReconnectTorrents( const void * va, const void * vb ) return 0; } - + static void reconnectPulse( int foo UNUSED, short bar UNUSED, void * vmgr ) { diff --git a/libtransmission/peer-mgr.h b/libtransmission/peer-mgr.h index d9f7c2ac7..e691f0d09 100644 --- a/libtransmission/peer-mgr.h +++ b/libtransmission/peer-mgr.h @@ -168,7 +168,7 @@ void tr_peerMgrSetBlame( tr_torrent * tor, tr_piece_index_t pieceIndex, int success ); -enum +enum { TR_PEERS_CONNECTED, TR_PEERS_ALL diff --git a/libtransmission/peer-msgs.c b/libtransmission/peer-msgs.c index ca4e8a8b0..d4b15d1cf 100644 --- a/libtransmission/peer-msgs.c +++ b/libtransmission/peer-msgs.c @@ -1768,7 +1768,7 @@ updateMetadataRequests( tr_peermsgs * msgs, time_t now ) static void updateBlockRequests( tr_peermsgs * msgs ) { - if( ( msgs->desiredRequestCount > 0 ) && + if( ( msgs->desiredRequestCount > 0 ) && ( msgs->peer->pendingReqsToPeer <= ( msgs->desiredRequestCount * 0.66 ) ) ) { int i; diff --git a/libtransmission/transmission.h b/libtransmission/transmission.h index bc65e01ab..20d8cb2e9 100644 --- a/libtransmission/transmission.h +++ b/libtransmission/transmission.h @@ -898,7 +898,7 @@ void tr_ctorSetDownloadDir( tr_ctor * ctor, * the only place where it should be used. */ void tr_ctorSetIncompleteDir( tr_ctor * ctor, const char * directory ); - + /** Set whether or not the torrent begins downloading/seeding when created. (Default: not paused) */ void tr_ctorSetPaused( tr_ctor * ctor, @@ -1411,15 +1411,15 @@ typedef struct int lastAnnouncePeerCount; /* 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]; /* when the last announce was sent to the tracker. * if "hasAnnounced" is false, this field is undefined */ time_t lastAnnounceStartTime; - + /* 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; /* when the last announce was completed. @@ -1435,7 +1435,7 @@ typedef struct time_t lastScrapeStartTime; /* 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; /* when the last scrape was completed. @@ -1468,7 +1468,6 @@ void tr_torrentTrackersFree( tr_tracker_stat * trackerStats, int trackerCount ); - /** * @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 */ float percentDone; - /** 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. - Range is [0..1] */ - float percentRatio; + /** 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. + Range is [0..1] */ + float percentRatio; /** Speed all data being sent for this torrent. (KiB/s) This includes piece data, protocol messages, and TCP overhead */ diff --git a/libtransmission/utils.c b/libtransmission/utils.c index 5ddda660c..7a0a8272b 100644 --- a/libtransmission/utils.c +++ b/libtransmission/utils.c @@ -167,7 +167,7 @@ tr_getQueuedMessages( void ) ret = messageQueue; messageQueue = NULL; messageQueueTail = &messageQueue; - + messageQueueCount = 0; tr_lockUnlock( messageLock ); @@ -307,16 +307,16 @@ tr_msg( const char * file, int line, *messageQueueTail = newmsg; messageQueueTail = &newmsg->next; ++messageQueueCount; - + if( messageQueueCount > TR_MAX_MSG_LOG ) { tr_msg_list * old = messageQueue; messageQueue = old->next; old->next = NULL; tr_freeMessageList(old); - + --messageQueueCount; - + assert( messageQueueCount == TR_MAX_MSG_LOG ); } } diff --git a/libtransmission/utils.h b/libtransmission/utils.h index 6754e6de8..ac1345a8e 100644 --- a/libtransmission/utils.h +++ b/libtransmission/utils.h @@ -515,7 +515,7 @@ static inline void tr_removeElementFromArray( void * array, 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 * * This function returns a second counter that is updated once per second. diff --git a/qt/details.cc b/qt/details.cc index 81dc7ec52..7af565048 100644 --- a/qt/details.cc +++ b/qt/details.cc @@ -151,7 +151,7 @@ Details :: Details( Session& session, TorrentModel& model, QWidget * parent ): myTimer.setSingleShot( false ); myTimer.start( REFRESH_INTERVAL_MSEC ); } - + Details :: ~Details( ) { } @@ -182,7 +182,7 @@ Details :: setIds( const QSet& ids ) foreach( QWidget * w, myWidgets ) w->setEnabled( false ); - + onTimer( ); } @@ -229,7 +229,7 @@ Details :: refresh( ) } /// - /// activity tab + /// activity tab /// // myStateLabel @@ -348,7 +348,7 @@ Details :: refresh( ) string = tr( "Unknown" ); else string = Utils::timeToString( baseline ); - } + } } myETALabel->setText( string ); @@ -482,8 +482,7 @@ Details :: refresh( ) string = tr( "Created by %1 on %2" ).arg( creator ).arg( date ); } myOriginLabel->setText( string ); - - + // myLocationLabel if( torrents.empty( ) ) string = none; @@ -782,7 +781,7 @@ Details :: refresh( ) if( single ) myFileTreeView->update( torrents[0]->files( ) ); - else + else myFileTreeView->clear( ); myHavePendingRefresh = false; @@ -952,7 +951,6 @@ Details :: createOptionsTab( ) connect( m, SIGNAL(currentIndexChanged(int)), this, SLOT(onBandwidthPriorityChanged(int))); hig->addRow( tr( "Torrent &priority:" ), m ); myBandwidthPriorityCombo = m; - hig->addSectionDivider( ); hig->addSectionTitle( tr( "Seed-Until Ratio" ) ); diff --git a/qt/file-tree.cc b/qt/file-tree.cc index b2a531016..006e7107c 100644 --- a/qt/file-tree.cc +++ b/qt/file-tree.cc @@ -47,7 +47,7 @@ FileTreeItem :: ~FileTreeItem( ) const int pos = myParent->myChildren.indexOf( this ); if( pos >= 0 ) myParent->myChildren.removeAt( pos ); - else + else assert( 0 && "failed to remove" ); } } @@ -252,7 +252,7 @@ FileTreeModel :: FileTreeModel( QObject *parent ): { rootItem = new FileTreeItem( -1 ); } - + FileTreeModel :: ~FileTreeModel( ) { clear( ); @@ -299,7 +299,7 @@ FileTreeModel :: headerData( int column, Qt::Orientation orientation, int role ) default: break; } } - + return data; } @@ -602,7 +602,7 @@ FileTreeView :: FileTreeView( QWidget * parent ): this, SIGNAL(wantedChanged(const QSet&, bool))); } -bool +bool FileTreeView :: eventFilter( QObject * o, QEvent * event ) { if( o != this ) diff --git a/qt/hig.cc b/qt/hig.cc index df5bffebf..49f82294e 100644 --- a/qt/hig.cc +++ b/qt/hig.cc @@ -36,7 +36,7 @@ HIG :: ~HIG( ) { delete myGrid; } - + /*** **** ***/ diff --git a/qt/license.cc b/qt/license.cc index fda0cf2ff..8d361d081 100644 --- a/qt/license.cc +++ b/qt/license.cc @@ -25,7 +25,7 @@ LicenseDialog :: LicenseDialog( QWidget * parent ): QPlainTextEdit * t = new QPlainTextEdit( this ); 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 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" diff --git a/qt/mainwin.cc b/qt/mainwin.cc index ffa8f5f20..8719a4e1a 100644 --- a/qt/mainwin.cc +++ b/qt/mainwin.cc @@ -472,7 +472,7 @@ TrMainWindow :: createStatusBar( ) h->addWidget( l ); h->addStretch( 1 ); - + a = new QActionGroup( this ); a->addAction( ui.action_TotalRatio ); a->addAction( ui.action_TotalTransfer ); @@ -491,10 +491,10 @@ TrMainWindow :: createStatusBar( ) p->setIcon( QIcon( ":/icons/ratio.png" ) ); p->setFlat( true ); p->setMenu( m ); - h->addWidget( p ); + h->addWidget( p ); l = myStatsLabel = new QLabel( this ); - h->addWidget( l ); - + h->addWidget( l ); + w = new QWidget( this ); w->setMinimumSize( HIG::PAD_BIG, 1 ); w->setMaximumSize( HIG::PAD_BIG, 1 ); @@ -987,7 +987,7 @@ TrMainWindow :: refreshPref( int key ) case Prefs::DSPEED_ENABLED: (myPrefs.get(key) ? myDlimitOnAction : myDlimitOffAction)->setChecked( true ); break; - + case Prefs::DSPEED: myDlimitOnAction->setText( tr( "Limited at %1" ).arg( Utils::speedToString( Speed::fromKbps( myPrefs.get(key) ) ) ) ); break; @@ -995,7 +995,7 @@ TrMainWindow :: refreshPref( int key ) case Prefs::USPEED_ENABLED: (myPrefs.get(key) ? myUlimitOnAction : myUlimitOffAction)->setChecked( true ); break; - + case Prefs::USPEED: myUlimitOnAction->setText( tr( "Limited at %1" ).arg( Utils::speedToString( Speed::fromKbps( myPrefs.get(key) ) ) ) ); break; diff --git a/qt/options.cc b/qt/options.cc index 9e86d2b45..3b92e026a 100644 --- a/qt/options.cc +++ b/qt/options.cc @@ -75,8 +75,8 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam layout->addWidget( p, row, 1 ); l->setBuddy( p ); connect( p, SIGNAL(clicked(bool)), this, SLOT(onFilenameClicked())); - - if( session.isLocal( ) ) + + if( session.isLocal( ) ) { const QFileIconProvider iconProvider; const QIcon folderIcon = iconProvider.icon( QFileIconProvider::Folder ); @@ -93,10 +93,10 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam l->setBuddy( p ); connect( p, SIGNAL(clicked(bool)), this, SLOT(onDestinationClicked())); } - + myTree = new FileTreeView; 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 if( session.isLocal( ) ) @@ -132,7 +132,7 @@ Options :: Options( Session& session, const Prefs& prefs, const QString& filenam reload( ); } - + Options :: ~Options( ) { clearInfo( ); diff --git a/qt/prefs-dialog.cc b/qt/prefs-dialog.cc index 13f8b5e93..295498b71 100644 --- a/qt/prefs-dialog.cc +++ b/qt/prefs-dialog.cc @@ -436,7 +436,7 @@ PrefsDialog :: onUpdateBlocklistClicked( ) myBlocklistDialog->show( ); mySession.updateBlocklist( ); } - + void PrefsDialog :: encryptionEdited( int i ) { @@ -680,8 +680,8 @@ PrefsDialog :: updatePref( int key ) const bool enabled( myPrefs.getBool( Prefs::RPC_ENABLED ) ); const bool whitelist( myPrefs.getBool( Prefs::RPC_WHITELIST_ENABLED ) ); const bool auth( myPrefs.getBool( Prefs::RPC_AUTH_REQUIRED ) ); - foreach( QWidget * w, myWebWhitelistWidgets ) w->setEnabled( enabled && whitelist ); - foreach( QWidget * w, myWebAuthWidgets ) w->setEnabled( enabled && auth ); + foreach( QWidget * w, myWebWhitelistWidgets ) w->setEnabled( enabled && whitelist ); + foreach( QWidget * w, myWebAuthWidgets ) w->setEnabled( enabled && auth ); foreach( QWidget * w, myWebWidgets ) w->setEnabled( enabled ); break; } @@ -690,7 +690,7 @@ PrefsDialog :: updatePref( int key ) case Prefs :: PROXY_AUTH_ENABLED: { const bool enabled( myPrefs.getBool( Prefs::PROXY_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 ); break; } @@ -733,7 +733,6 @@ PrefsDialog :: updatePref( int key ) myIncompleteButton->setEnabled( enabled ); break; } - default: break; diff --git a/qt/session-dialog.cc b/qt/session-dialog.cc index 0714c53e3..e526db5b2 100644 --- a/qt/session-dialog.cc +++ b/qt/session-dialog.cc @@ -114,4 +114,4 @@ SessionDialog :: SessionDialog( Session& session, Prefs& prefs, QWidget * parent connect( buttons, SIGNAL(rejected()), this, SLOT(hide())); connect( buttons, SIGNAL(accepted()), this, SLOT(onAccepted())); top->addWidget( buttons, 0 ); -} +} diff --git a/qt/session.cc b/qt/session.cc index 21fc3fd41..590d502b6 100644 --- a/qt/session.cc +++ b/qt/session.cc @@ -155,8 +155,8 @@ Session :: updatePref( int key ) break; case Prefs :: RATIO: - sessionSet( "seedRatioLimit", myPrefs.variant(key) ); - break; + sessionSet( "seedRatioLimit", myPrefs.variant(key) ); + break; case Prefs :: RATIO_ENABLED: sessionSet( "seedRatioLimited", myPrefs.variant(key) ); break; @@ -718,7 +718,7 @@ Session :: parseResponse( const char * json, size_t jsonLength ) QString::fromUtf8(str), QMessageBox::Close, QApplication::activeWindow()); - QPixmap pixmap; + QPixmap pixmap; QIcon icon = QtIconLoader :: icon( "dialog-information" ); if( !icon.isNull( ) ) { const int size = QApplication::style()->pixelMetric( QStyle::PM_LargeIconSize ); diff --git a/qt/torrent-delegate-min.cc b/qt/torrent-delegate-min.cc index 41691dd41..b9efcd11d 100644 --- a/qt/torrent-delegate-min.cc +++ b/qt/torrent-delegate-min.cc @@ -136,8 +136,8 @@ TorrentDelegateMin :: drawTorrent( QPainter * painter, const QStyleOptionViewIte const QRect barArea( nameArea.left( ), nameArea.bottom( ), statusArea.right( ) - nameArea.left( ), - BAR_HEIGHT ); - + BAR_HEIGHT ); + // render if( tor.hasError( ) ) painter->setPen( QColor( "red" ) ); diff --git a/qt/torrent-delegate.cc b/qt/torrent-delegate.cc index e149c0357..0c323f169 100644 --- a/qt/torrent-delegate.cc +++ b/qt/torrent-delegate.cc @@ -66,7 +66,7 @@ TorrentDelegate :: progressString( const Torrent& tor ) const const bool isSeed( tor.isSeed( ) ); const uint64_t haveTotal( tor.haveTotal( ) ); QString str; - double seedRatio; + double seedRatio; bool hasSeedRatio; if( !isDone ) diff --git a/qt/torrent.cc b/qt/torrent.cc index efb20685b..636ca21c0 100644 --- a/qt/torrent.cc +++ b/qt/torrent.cc @@ -216,7 +216,7 @@ Torrent :: setDateTime( int i, const QDateTime& value ) return changed; } - + bool Torrent :: setSize( int i, qulonglong value ) { @@ -498,7 +498,6 @@ Torrent :: update( tr_benc * d ) default: assert( 0 && "unhandled type" ); } - } tr_benc * files;