Changeset 8027


Ignore:
Timestamp:
Mar 5, 2009, 2:42:28 AM (13 years ago)
Author:
charles
Message:

(1.5x gtk) #1773: First run - error in Properties

Location:
branches/1.5x/gtk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/1.5x/gtk/main.c

    r7910 r8027  
    407407    tr_notify_init( );
    408408    didinit = cf_init( configDir, NULL ); /* must come before actions_init */
    409     tr_prefs_init_global( );
     409    tr_prefs_init_defaults( );
    410410
    411411    myUIManager = gtk_ui_manager_new ( );
     
    439439    if( didlock && ( didinit || cf_init( configDir, &err ) ) )
    440440    {
     441        const char * str;
    441442        GtkWindow * win;
    442443        tr_session * session;
     444
     445        /* ensure the directories are created */
     446       if(( str = pref_string_get( PREF_KEY_DIR_WATCH )))
     447           mkdir_p( str, 0777 );
     448       if(( str = pref_string_get( TR_PREFS_KEY_DOWNLOAD_DIR )))
     449           mkdir_p( str, 0777 );
    443450
    444451        /* initialize the libtransmission session */
  • branches/1.5x/gtk/tr-prefs.c

    r7953 r8027  
    3434 */
    3535void
    36 tr_prefs_init_global( void )
     36tr_prefs_init_defaults( void )
    3737{
    3838    const char * str;
     
    4343    str = NULL;
    4444    if( !str ) str = g_get_user_special_dir( G_USER_DIRECTORY_DESKTOP );
     45    if( !str ) str = g_get_user_special_dir( G_USER_DIRECTORY_DOWNLOAD );
    4546    if( !str ) str = tr_getDefaultDownloadDir( );
    46     mkdir_p( str, 0777 );
    4747    pref_string_set_default ( PREF_KEY_DIR_WATCH, str );
    4848    pref_flag_set_default   ( PREF_KEY_DIR_WATCH_ENABLED, FALSE );
     
    8080#endif
    8181    if( !str ) str = tr_getDefaultDownloadDir( );
    82     mkdir_p( str, 0777 );
    8382    pref_string_set_default ( TR_PREFS_KEY_DOWNLOAD_DIR, str );
    8483
  • branches/1.5x/gtk/tr-prefs.h

    r7722 r8027  
    2020
    2121/* if you add a key here,  you /must/ add its
    22  * default in tr_prefs_init_global( void ) */
     22 * default in tr_prefs_init_defaults( void ) */
    2323
    2424#define PREF_KEY_SCHED_LIMIT_ENABLED        "sched-limit-enabled"
     
    5151#define PREF_KEY_MAIN_WINDOW_Y              "main-window-y"
    5252
    53 void tr_prefs_init_global( void );
     53void tr_prefs_init_defaults( void );
    5454
    5555#endif
Note: See TracChangeset for help on using the changeset viewer.