gpointing-device-settings r288 - in trunk: src test
- From: hiikezoe svn gnome org
- To: svn-commits-list gnome org
- Subject: gpointing-device-settings r288 - in trunk: src test
- Date: Sun, 29 Mar 2009 09:44:10 +0000 (UTC)
Author: hiikezoe
Date: Sun Mar 29 09:44:09 2009
New Revision: 288
URL: http://svn.gnome.org/viewvc/gpointing-device-settings?rev=288&view=rev
Log:
added gpds_get_icon_file_directory.
Modified:
trunk/src/gpds-utils.c
trunk/src/gpds-utils.h
trunk/test/test-utils.c
Modified: trunk/src/gpds-utils.c
==============================================================================
--- trunk/src/gpds-utils.c (original)
+++ trunk/src/gpds-utils.c Sun Mar 29 09:44:09 2009
@@ -32,6 +32,15 @@
return dir ? dir : GPDS_UIDIR;
}
+const gchar *
+gpds_get_icon_file_directory (void)
+{
+ const gchar *dir;
+
+ dir = g_getenv("GPDS_ICON_DIR");
+ return dir ? dir : GPDS_ICONDIR;
+}
+
/*
vi:ts=4:nowrap:ai:expandtab:sw=4
*/
Modified: trunk/src/gpds-utils.h
==============================================================================
--- trunk/src/gpds-utils.h (original)
+++ trunk/src/gpds-utils.h Sun Mar 29 09:44:09 2009
@@ -25,6 +25,7 @@
G_BEGIN_DECLS
const gchar *gpds_get_ui_file_directory (void);
+const gchar *gpds_get_icon_file_directory (void);
G_END_DECLS
Modified: trunk/test/test-utils.c
==============================================================================
--- trunk/test/test-utils.c (original)
+++ trunk/test/test-utils.c Sun Mar 29 09:44:09 2009
@@ -3,8 +3,10 @@
#include <gcutter.h>
void test_get_ui_file_directory (void);
+void test_get_icon_file_directory (void);
static gchar *ui_dir;
+static gchar *icon_dir;
void
setup (void)
@@ -14,6 +16,10 @@
ui_dir = g_strdup(g_getenv("GPDS_UI_DIR"));
g_unsetenv("GPDS_UI_DIR");
}
+ if (g_getenv("GPDS_ICON_DIR")) {
+ icon_dir = g_strdup(g_getenv("GPDS_ICON_DIR"));
+ g_unsetenv("GPDS_ICON_DIR");
+ }
}
void
@@ -22,6 +28,9 @@
if (ui_dir)
g_setenv("GPDS_UI_DIR", ui_dir, FALSE);
g_free(ui_dir);
+ if (icon_dir)
+ g_setenv("GPDS_ICON_DIR", icon_dir, FALSE);
+ g_free(icon_dir);
}
void
@@ -31,6 +40,13 @@
gpds_get_ui_file_directory());
}
+void
+test_get_icon_file_directory (void)
+{
+ cut_assert_equal_string(GPDS_ICONDIR,
+ gpds_get_icon_file_directory());
+}
+
/*
vi:ts=4:nowrap:ai:expandtab:sw=4
*/
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]