[gvfs] recent: Prevent spurious monitor notifications



commit 9c11445c38132f6c3ee9d1753f8e8093f7ccca5d
Author: Ross Lagerwall <rosslagerwall gmail com>
Date:   Sun Oct 27 17:19:31 2013 +0200

    recent: Prevent spurious monitor notifications
    
    Ignore nonexistent files completely to prevent them being repeatedly
    deleted and then re-added to the list of files.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=686135

 daemon/gvfsbackendrecent.c |   20 ++++++++++----------
 1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/daemon/gvfsbackendrecent.c b/daemon/gvfsbackendrecent.c
index e01bc51..a3b87ff 100644
--- a/daemon/gvfsbackendrecent.c
+++ b/daemon/gvfsbackendrecent.c
@@ -408,9 +408,9 @@ reload_recent_items (GVfsBackendRecent *backend)
 
       uri = gtk_recent_info_get_uri (recent_info);
       guid = g_hash_table_lookup (backend->uri_map, uri);
-      if (guid)
+      if (gtk_recent_info_exists (recent_info))
         {
-          if (gtk_recent_info_exists (recent_info))
+          if (guid)
             {
               RecentItem *item;
               item = g_hash_table_lookup (backend->items, guid);
@@ -418,14 +418,14 @@ reload_recent_items (GVfsBackendRecent *backend)
                 changed = g_list_prepend (changed, item->guid);
               not_seen_items = g_list_remove (not_seen_items, item);
             }
-        }
-      else
-        {
-          RecentItem *item;
-          item = recent_item_new (recent_info);
-          added = g_list_prepend (added, item->guid);
-          g_hash_table_insert (backend->items, item->guid, item);
-          g_hash_table_insert (backend->uri_map, item->uri, item->guid);
+          else
+            {
+              RecentItem *item;
+              item = recent_item_new (recent_info);
+              added = g_list_prepend (added, item->guid);
+              g_hash_table_insert (backend->items, item->guid, item);
+              g_hash_table_insert (backend->uri_map, item->uri, item->guid);
+            }
         }
       gtk_recent_info_unref (recent_info);
     }


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