# HG changeset patch # User giacomo # Date 1168893562 28800 # Node ID eb71fec30e9a5701115a3b9b0a8c40a8a7838c17 # Parent 9326f6a1f0243ce490aa49a2516625bab460d697 [svn] - added audacious_get_localdir() in util.c/h, returns a string with the full path of audacious local datadir diff -r 9326f6a1f024 -r eb71fec30e9a ChangeLog --- a/ChangeLog Mon Jan 15 09:48:56 2007 -0800 +++ b/ChangeLog Mon Jan 15 12:39:22 2007 -0800 @@ -1,3 +1,10 @@ +2007-01-15 17:48:56 +0000 Giacomo Lozito + revision [3688] + - removed a couple of useless gdk calls in mainwin_real_hide() + trunk/src/audacious/ui_main.c | 4 ---- + 1 file changed, 4 deletions(-) + + 2007-01-15 17:18:27 +0000 Giacomo Lozito revision [3686] - in playlistwin_hide(), pass focus to the player main window only if it's visible diff -r 9326f6a1f024 -r eb71fec30e9a src/audacious/util.h --- a/src/audacious/util.h Mon Jan 15 09:48:56 2007 -0800 +++ b/src/audacious/util.h Mon Jan 15 12:39:22 2007 -0800 @@ -141,6 +141,8 @@ GdkPixbuf *audacious_create_colorized_pixbuf(GdkPixbuf *src, gint red, gint green, gint blue); +gchar *audacious_get_localdir(void); + G_END_DECLS #endif diff -r 9326f6a1f024 -r eb71fec30e9a src/libaudacious/util.c --- a/src/libaudacious/util.c Mon Jan 15 09:48:56 2007 -0800 +++ b/src/libaudacious/util.c Mon Jan 15 12:39:22 2007 -0800 @@ -24,6 +24,7 @@ # include "config.h" #endif +#include #include #include @@ -92,6 +93,30 @@ return dialog; } + +/** + * audacious_get_localdir: + * + * Returns a string with the full path of Audacious local datadir (where config files are placed). + * It's useful in order to put in the right place custom config files for audacious plugins. + * + * Return value: a string with full path of Audacious local datadir (should be freed after use) + **/ +gchar* +audacious_get_localdir(void) +{ + gchar *datadir; + gchar *tmp; + + if ( (tmp = getenv("XDG_CONFIG_HOME")) == NULL ) + datadir = g_build_filename( g_get_home_dir() , ".config" , "audacious" , NULL ); + else + datadir = g_build_filename( tmp , "audacious" , NULL ); + + return datadir; +} + + /** * xmms_check_realtime_priority: *