[gconf] GSettings migration: use time() as the timestamp



commit 0bdf55869a78c838edacfb4b2055de5597c9875d
Author: Ryan Lortie <desrt desrt ca>
Date:   Wed Aug 10 11:12:32 2011 +0200

    GSettings migration: use time() as the timestamp
    
    Store the current system time as the timestamp in the database instead
    of the timestamp that we read from the directory containing the
    migration scripts.

 gsettings/gsettings-data-convert.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)
---
diff --git a/gsettings/gsettings-data-convert.c b/gsettings/gsettings-data-convert.c
index 0d3c8c2..b0c8b9c 100644
--- a/gsettings/gsettings-data-convert.c
+++ b/gsettings/gsettings-data-convert.c
@@ -364,8 +364,7 @@ load_state (time_t  *mtime,
 }
 
 static gboolean
-save_state (time_t   mtime,
-            gchar  **converted)
+save_state (gchar  **converted)
 {
   gchar *filename;
   GKeyFile *keyfile;
@@ -384,7 +383,7 @@ save_state (time_t   mtime,
   filename = g_build_filename (g_get_user_data_dir (), "gsettings-data-convert", NULL);
   keyfile = g_key_file_new ();
 
-  str = g_strdup_printf ("%ld", mtime);
+  str = g_strdup_printf ("%ld", time (NULL));
   g_key_file_set_string (keyfile,
                          "State", "timestamp", str);
   g_free (str);
@@ -507,7 +506,7 @@ main (int argc, char *argv[])
 
   if (!dry_run)
     {
-      if (!save_state (dir_mtime, converted))
+      if (!save_state (converted))
         return 1;
     }
 



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