[tracker/tracker-0.12] tracker-miner-applications: Add miner_applications_locale_get_filename



commit 00e0177b493b5d61872338383bcde03d2c2e6546
Author: JÃrg Billeter <j bitron ch>
Date:   Fri Oct 28 14:05:05 2011 +0200

    tracker-miner-applications: Add miner_applications_locale_get_filename
    
    No functional change.

 src/miners/fs/tracker-miner-applications-locale.c |   24 +++++++++++++++-----
 1 files changed, 18 insertions(+), 6 deletions(-)
---
diff --git a/src/miners/fs/tracker-miner-applications-locale.c b/src/miners/fs/tracker-miner-applications-locale.c
index 960523f..4c6676d 100644
--- a/src/miners/fs/tracker-miner-applications-locale.c
+++ b/src/miners/fs/tracker-miner-applications-locale.c
@@ -30,6 +30,23 @@
 #define TRACKER_MINER_APPLICATIONS_LOCALE_FILE "miner-applications-locale.txt"
 
 static gchar *
+miner_applications_locale_get_filename (void)
+{
+	gchar *data_dir;
+	gchar *filename;
+
+	/* Locate locale file */
+	data_dir = g_build_filename (g_get_user_cache_dir (),
+	                             "tracker",
+	                             NULL);
+	filename = g_build_filename (data_dir, TRACKER_MINER_APPLICATIONS_LOCALE_FILE, NULL);
+
+	g_free (data_dir);
+
+	return filename;
+}
+
+static gchar *
 miner_applications_locale_get_previous (const gchar *locale_file)
 {
 	gchar *locale = NULL;
@@ -100,14 +117,10 @@ tracker_miner_applications_locale_changed (void)
 	gchar *previous_locale;
 	gchar *current_locale;
 	gboolean changed;
-	gchar *data_dir;
 	gchar *filename;
 
 	/* Locate previous locale file */
-	data_dir = g_build_filename (g_get_user_cache_dir (),
-	                             "tracker",
-	                             NULL);
-	filename = g_build_filename (data_dir, TRACKER_MINER_APPLICATIONS_LOCALE_FILE, NULL);
+	filename = miner_applications_locale_get_filename ();
 
 	current_locale = miner_applications_locale_get_current ();
 
@@ -130,6 +143,5 @@ tracker_miner_applications_locale_changed (void)
 	g_free (previous_locale);
 	g_free (current_locale);
 	g_free (filename);
-	g_free (data_dir);
 	return changed;
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]