aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy/empathy-utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'libempathy/empathy-utils.c')
-rw-r--r--libempathy/empathy-utils.c19
1 files changed, 19 insertions, 0 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;
+}
+
+