changeset 2340:eb71fec30e9a trunk

[svn] - added audacious_get_localdir() in util.c/h, returns a string with the full path of audacious local datadir
author giacomo
date Mon, 15 Jan 2007 12:39:22 -0800
parents 9326f6a1f024
children 02a850a2533b
files ChangeLog src/audacious/util.h src/libaudacious/util.c
diffstat 3 files changed, 34 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- 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 <james@develia.org>
+  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 <james@develia.org>
   revision [3686]
   - in playlistwin_hide(), pass focus to the player main window only if it's visible
--- 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
--- 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 <stdlib.h>
 #include <glib.h>
 #include <gtk/gtk.h>
 
@@ -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:
  *