Changeset 10759


Ignore:
Timestamp:
Jun 15, 2010, 3:35:40 PM (12 years ago)
Author:
charles
Message:

(trunk gtk) #3295 "transmission updates the blocklist even when the blocklist is disabled" -- fixed in trunk for 2.00

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/main.c

    r10700 r10759  
    645645
    646646        /* on startup, check & see if it's time to update the blocklist */
    647         if( pref_flag_get( PREF_KEY_BLOCKLIST_UPDATES_ENABLED )
    648             && ( time( NULL ) - pref_int_get( "blocklist-date" ) > ( 60 * 60 * 24 * 7 ) ) )
    649                 tr_core_blocklist_update( cbdata->core );
     647        if( pref_flag_get( TR_PREFS_KEY_BLOCKLIST_ENABLED ) ) {
     648            if( pref_flag_get( PREF_KEY_BLOCKLIST_UPDATES_ENABLED ) ) {
     649                const int64_t last_time = pref_int_get( "blocklist-date" );
     650                const int SECONDS_IN_A_WEEK = 7 * 24 * 60 * 60;
     651                const time_t now = time( NULL );
     652                if( last_time + SECONDS_IN_A_WEEK < now )
     653                    tr_core_blocklist_update( cbdata->core );
     654            }
     655        }
    650656
    651657        /* if there's no magnet link handler registered, register us */
Note: See TracChangeset for help on using the changeset viewer.