Ignore:
Timestamp:
Dec 13, 2008, 11:17:36 PM (12 years ago)
Author:
charles
Message:

(trunk) #1559: Simplify tr_sessionInitFull

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r7232 r7367  
    409409
    410410const char*
    411 tr_getDefaultConfigDir( void )
     411tr_getDefaultConfigDir( const char * appname )
    412412{
    413413    static char * s = NULL;
     414
     415    if( !appname || !*appname )
     416        appname = "Transmission";
    414417
    415418    if( !s )
     
    422425        {
    423426#ifdef SYS_DARWIN
    424             s = tr_buildPath( getHomeDir( ), "Library",
    425                               "Application Support", "Transmission", NULL );
     427            s = tr_buildPath( getHomeDir( ), "Library", "Application Support",
     428                              appname, NULL );
    426429#elif defined( WIN32 )
    427430            char appdata[MAX_PATH]; /* SHGetFolderPath() requires MAX_PATH */
    428431            SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata );
    429             s = tr_buildPath( appdata, "Transmission", NULL );
     432            s = tr_buildPath( appdata, appname, NULL );
    430433#else
    431434            if( ( s = getenv( "XDG_CONFIG_HOME" ) ) )
    432                 s = tr_buildPath( s, "transmission", NULL );
     435                s = tr_buildPath( s, appname, NULL );
    433436            else
    434                 s = tr_buildPath( getHomeDir( ), ".config", "transmission", NULL );
     437                s = tr_buildPath( getHomeDir( ), ".config", appname, NULL );
    435438#endif
    436439        }
Note: See TracChangeset for help on using the changeset viewer.