[Xfce4-commits] <terminal:master> Do not query the mtime of the rc file on startup.

Nick Schermer noreply at xfce.org
Mon Dec 24 13:38:03 CET 2012


Updating branch refs/heads/master
         to cde3f164f564224654ba985c80f23f892baf42f2 (commit)
       from d6d2c853a2c7be0057dcc42799a0605f64e59592 (commit)

commit cde3f164f564224654ba985c80f23f892baf42f2
Author: Nick Schermer <nick at xfce.org>
Date:   Mon Dec 24 13:21:11 2012 +0100

    Do not query the mtime of the rc file on startup.

 terminal/terminal-preferences.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/terminal/terminal-preferences.c b/terminal/terminal-preferences.c
index dcf2db7..04701e1 100644
--- a/terminal/terminal-preferences.c
+++ b/terminal/terminal-preferences.c
@@ -131,7 +131,8 @@ static void     terminal_preferences_monitor_changed    (GFileMonitor        *mo
                                                          TerminalPreferences *preferences);
 static void     terminal_preferences_monitor_disconnect (TerminalPreferences *preferences);
 static void     terminal_preferences_monitor_connect    (TerminalPreferences *preferences,
-                                                         const gchar         *filename);
+                                                         const gchar         *filename,
+                                                         gboolean             update_mtime);
 
 
 
@@ -1027,7 +1028,7 @@ terminal_preferences_load (TerminalPreferences *preferences)
 
 connect_monitor:
   /* startup file monitoring */
-  terminal_preferences_monitor_connect (preferences, filename);
+  terminal_preferences_monitor_connect (preferences, filename, FALSE);
 
   preferences->loading_in_progress = FALSE;
 
@@ -1149,7 +1150,7 @@ terminal_preferences_store_idle (gpointer user_data)
     goto error;
 
   /* check if we need to update the monitor */
-  terminal_preferences_monitor_connect (preferences, filename);
+  terminal_preferences_monitor_connect (preferences, filename, TRUE);
 
   if (G_LIKELY (FALSE))
     {
@@ -1237,7 +1238,8 @@ terminal_preferences_monitor_disconnect (TerminalPreferences *preferences)
 
 static void
 terminal_preferences_monitor_connect (TerminalPreferences *preferences,
-                                      const gchar         *filename)
+                                      const gchar         *filename,
+                                      gboolean             update_mtime)
 {
   gchar     *path = NULL;
   GError    *error = NULL;
@@ -1278,9 +1280,11 @@ terminal_preferences_monitor_connect (TerminalPreferences *preferences,
         }
     }
 
-  /* store the last known mtime */
   preferences->last_mtime = 0;
-  if (G_LIKELY (preferences->file != NULL))
+
+  /* store the last known mtime */
+  if (preferences->file != NULL
+      && update_mtime)
     {
       info = g_file_query_info (preferences->file, G_FILE_ATTRIBUTE_TIME_MODIFIED,
                                 G_FILE_QUERY_INFO_NONE, NULL, NULL);


More information about the Xfce4-commits mailing list