GKeyFileSettingsBackend: ignore file deletions
authorMatthew Barnes <mbarnes@redhat.com>
Mon, 28 Oct 2013 00:26:33 +0000 (17:26 -0700)
committerRyan Lortie <desrt@desrt.ca>
Mon, 28 Oct 2013 00:27:44 +0000 (17:27 -0700)
Ignore the keyfile being deleted (ie: by the user) instead of reporting
it to the application as all values being reverted back to their
originals.

https://bugzilla.gnome.org/show_bug.cgi?id=637956

gio/gkeyfilesettingsbackend.c

index 6601eba..6f97da4 100644 (file)
@@ -550,7 +550,9 @@ file_changed (GFileMonitor      *monitor,
 {
   GKeyfileSettingsBackend *kfsb = user_data;
 
-  g_keyfile_settings_backend_keyfile_reload (kfsb);
+  /* Ignore file deletions, let the GKeyFile content remain in tact. */
+  if (event_type != G_FILE_MONITOR_EVENT_DELETED)
+    g_keyfile_settings_backend_keyfile_reload (kfsb);
 }
 
 static void