aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-03-17 06:10:34 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-03-17 06:10:34 +0800
commitf369aa1633fd6d1c02680e97006bc53e4b8e44eb (patch)
treec78ac2dceb543b6d989f96f693c861c5a612ec41 /libempathy
parent841b4512d41749ea2229f1ceb6ec7b77f9c78e81 (diff)
downloadgsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.gz
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.bz2
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.lz
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.xz
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.tar.zst
gsoc2013-empathy-f369aa1633fd6d1c02680e97006bc53e4b8e44eb.zip
Use empathy_file_lookup for glade files since some are in libempathy-gtk/ and others in src/
svn path=/trunk/; revision=813
Diffstat (limited to 'libempathy')
-rw-r--r--libempathy/empathy-utils.c19
-rw-r--r--libempathy/empathy-utils.h3
2 files changed, 21 insertions, 1 deletions
diff --git a/libempathy/empathy-utils.c b/libempathy/empathy-utils.c
index 25e0860d2..07cd6802e 100644
--- a/libempathy/empathy-utils.c
+++ b/libempathy/empathy-utils.c
@@ -587,3 +587,22 @@ empathy_presence_from_str (const gchar *str)
return MC_PRESENCE_AVAILABLE;
}
+gchar *
+empathy_file_lookup (const gchar *filename, const gchar *subdir)
+{
+ gchar *path;
+
+ if (!subdir) {
+ subdir = ".";
+ }
+
+ path = g_build_filename (g_getenv ("EMPATHY_SRCDIR"), subdir, filename, NULL);
+ if (!g_file_test (path, G_FILE_TEST_EXISTS)) {
+ g_free (path);
+ path = g_build_filename (DATADIR, "empathy", filename, NULL);
+ }
+
+ return path;
+}
+
+
diff --git a/libempathy/empathy-utils.h b/libempathy/empathy-utils.h
index cafc3db10..834935ef2 100644
--- a/libempathy/empathy-utils.h
+++ b/libempathy/empathy-utils.h
@@ -97,7 +97,8 @@ void empathy_chat_with_contact_id (McAccount *account,
const gchar * empathy_presence_get_default_message (McPresence presence);
const gchar * empathy_presence_to_str (McPresence presence);
McPresence empathy_presence_from_str (const gchar *str);
-
+gchar * empathy_file_lookup (const gchar *filename,
+ const gchar *subdir);
G_END_DECLS
#endif /* __EMPATHY_UTILS_H__ */