Changeset 13273 for trunk/gtk/conf.c


Ignore:
Timestamp:
Apr 8, 2012, 4:02:48 PM (9 years ago)
Author:
jordan
Message:

(trunk, gtk) #4573 'fix crash when opening a torrent file on systems that don't define G_USER_DIRECTORY_DOWNLOAD'. Thanks to Felipe Contreras for the initial patch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gtk/conf.c

    r13107 r13273  
    6868{
    6969    const char * str;
     70    const char * special_dl_dir = g_get_user_special_dir( G_USER_DIRECTORY_DOWNLOAD );
    7071
    7172    cf_check_older_configs( );
     
    107108    tr_bencDictAddInt( d, PREF_KEY_MAIN_WINDOW_Y, 50 );
    108109
    109     str = g_get_user_special_dir( G_USER_DIRECTORY_DOWNLOAD );
    110     tr_bencDictAddStr( d, TR_PREFS_KEY_DOWNLOAD_DIR, str );
     110    tr_bencDictAddStr( d, TR_PREFS_KEY_DOWNLOAD_DIR, special_dl_dir ? special_dl_dir : str );
    111111
    112112    tr_bencDictAddStr( d, PREF_KEY_SORT_MODE, "sort-by-name" );
Note: See TracChangeset for help on using the changeset viewer.