[gtk/matthiasc/for-master] bookmarksmanager: Ignore delete events



commit 7dbcaaf9c18c06294ba8244eb38fb1d3d8f8e16e
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Aug 8 10:41:57 2020 -0400

    bookmarksmanager: Ignore delete events
    
    Surpisingly, when a monitored file gets atomically replaced
    with g_file_set_contents(), the file monitor reports a
    DELETED event for the temp file, which is not the file
    I'm monitoring.
    
    Just ignore DELETED events.
    
    Fixes: #3036

 gtk/gtkbookmarksmanager.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
---
diff --git a/gtk/gtkbookmarksmanager.c b/gtk/gtkbookmarksmanager.c
index 4fce669113..ed1ea063b3 100644
--- a/gtk/gtkbookmarksmanager.c
+++ b/gtk/gtkbookmarksmanager.c
@@ -238,10 +238,10 @@ bookmarks_file_changed (GFileMonitor      *monitor,
     case G_FILE_MONITOR_EVENT_CHANGED:
     case G_FILE_MONITOR_EVENT_CHANGES_DONE_HINT:
     case G_FILE_MONITOR_EVENT_CREATED:
-    case G_FILE_MONITOR_EVENT_DELETED:
       g_file_load_contents_async (file, NULL, read_bookmarks_finish, manager);
       break;
 
+    case G_FILE_MONITOR_EVENT_DELETED:
     case G_FILE_MONITOR_EVENT_ATTRIBUTE_CHANGED:
     case G_FILE_MONITOR_EVENT_PRE_UNMOUNT:
     case G_FILE_MONITOR_EVENT_UNMOUNTED:


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