mirror of
https://github.com/transmission/transmission
synced 2024-12-26 01:27:28 +00:00
(trunk libT) fix xdg oops
This commit is contained in:
parent
fa7f320f5b
commit
836330d834
1 changed files with 6 additions and 13 deletions
|
@ -40,7 +40,6 @@
|
|||
#include <unistd.h> /* getuid getpid close */
|
||||
|
||||
#include "transmission.h"
|
||||
#include "ggets.h"
|
||||
#include "session.h"
|
||||
#include "list.h"
|
||||
#include "platform.h"
|
||||
|
@ -444,23 +443,18 @@ tr_getDefaultConfigDir( const char * appname )
|
|||
return s;
|
||||
}
|
||||
|
||||
/* This was stolen from gthumb, though it probably originates from
|
||||
* xdg-user-dirs's xdg-user-dir-lookup.c. See:
|
||||
* http://www.redhat.com/archives/fedora-devel-list/2007-March/msg00677.html
|
||||
*/
|
||||
const char*
|
||||
tr_getDefaultDownloadDir( void )
|
||||
{
|
||||
static char * user_dir = NULL;
|
||||
|
||||
#ifdef SYS_DARWIN
|
||||
|
||||
user_dir = tr_buildPath( getHomeDir( ), "Downloads", NULL );
|
||||
|
||||
#else
|
||||
|
||||
if( user_dir == NULL )
|
||||
{
|
||||
#ifndef SYS_DARWIN
|
||||
|
||||
user_dir = tr_buildPath( getHomeDir( ), "Downloads", NULL );
|
||||
|
||||
#else
|
||||
const char * config_home;
|
||||
char * config_file;
|
||||
char * content;
|
||||
|
@ -501,9 +495,8 @@ tr_getDefaultDownloadDir( void )
|
|||
|
||||
tr_free( content );
|
||||
tr_free( config_file );
|
||||
}
|
||||
|
||||
#endif
|
||||
}
|
||||
|
||||
return user_dir;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue