Ignore:
Timestamp:
Jul 9, 2009, 6:18:14 PM (12 years ago)
Author:
titer
Message:

Set some sensible default folders for Haiku

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/platform.c

    r8163 r8792  
    1818  #include <CoreFoundation/CoreFoundation.h>
    1919 #endif
    20 
     20 #ifdef __HAIKU__
     21  #include <FindDirectory.h>
     22 #endif
    2123 #define _XOPEN_SOURCE 600  /* needed for recursive locks. */
    2224 #ifndef __USE_UNIX98
     
    272274        SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata );
    273275        path = tr_buildPath( appdata, "Transmission", NULL );
     276#elif defined( __HAIKU__ )
     277        char buf[MAX_PATH_LENGTH];
     278        find_directory( B_USER_SETTINGS_DIRECTORY, -1, true, buf, sizeof(buf) );
     279        path = tr_buildPath( buf, "Transmission", NULL );
    274280#else
    275281        path = tr_buildPath( getHomeDir( ), ".transmission", NULL );
     
    432438            SHGetFolderPath( NULL, CSIDL_APPDATA, NULL, 0, appdata );
    433439            s = tr_buildPath( appdata, appname, NULL );
     440#elif defined( __HAIKU__ )
     441            char buf[MAX_PATH_LENGTH];
     442            find_directory( B_USER_SETTINGS_DIRECTORY, -1, true, buf, sizeof(buf) );
     443            s = tr_buildPath( buf, appname, NULL );
    434444#else
    435445            if( ( s = getenv( "XDG_CONFIG_HOME" ) ) )
     
    487497
    488498        if( user_dir == NULL )
     499#ifdef __HAIKU__
     500            user_dir = tr_buildPath( getHomeDir( ), "Desktop", NULL );
     501#else
    489502            user_dir = tr_buildPath( getHomeDir( ), "Downloads", NULL );
     503#endif
    490504
    491505        tr_free( content );
Note: See TracChangeset for help on using the changeset viewer.