[tracker/tracker-0.12] libtracker-common: if testing old .cfg files, ensure one is always available



commit bac99b9156e71db54015304d6d9a5e7c6d0bd8b8
Author: Aleksander Morgado <aleksander lanedo com>
Date:   Mon Dec 12 16:47:41 2011 +0100

    libtracker-common: if testing old .cfg files, ensure one is always available
    
    Create the .cfg file when we detect that it doesn't exist.

 src/libtracker-common/tracker-config-file.c |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-common/tracker-config-file.c b/src/libtracker-common/tracker-config-file.c
index 8a22f24..d45bfe6 100644
--- a/src/libtracker-common/tracker-config-file.c
+++ b/src/libtracker-common/tracker-config-file.c
@@ -582,6 +582,14 @@ tracker_config_file_migrate (TrackerConfigFile           *file,
 	if (g_getenv ("TRACKER_USE_CONFIG_FILES")) {
 		UnappliedNotifyData *data;
 
+		/* Ensure we have the config file in place */
+		if (!file->file_exists) {
+			migrate_settings_to_keyfile (entries,
+			                             settings,
+			                             file);
+			tracker_config_file_save (file);
+		}
+
 		/* Keep the file around, and connect to notify::has-unapplied so
 		 * we write back to it when g_settings_apply() is called
 		 */



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