[gnome-flashback] desktop: don't remove icon from NULL view



commit 960c695fdd303838ec52ffc6ea841e59d530cb45
Author: Alberts Muktupāvels <alberts muktupavels gmail com>
Date:   Thu Nov 14 14:31:42 2019 +0200

    desktop: don't remove icon from NULL view

 gnome-flashback/libdesktop/gf-icon-view.c | 17 ++++++++++-------
 1 file changed, 10 insertions(+), 7 deletions(-)
---
diff --git a/gnome-flashback/libdesktop/gf-icon-view.c b/gnome-flashback/libdesktop/gf-icon-view.c
index c56a05d..248cc13 100644
--- a/gnome-flashback/libdesktop/gf-icon-view.c
+++ b/gnome-flashback/libdesktop/gf-icon-view.c
@@ -249,19 +249,22 @@ file_deleted (GfIconView *self,
 
       file = gf_icon_get_file (GF_ICON (info->icon));
 
-      if (g_file_equal (file, deleted_file))
+      if (!g_file_equal (file, deleted_file))
+        continue;
+
+      if (info->view != NULL)
         {
-          gf_monitor_view_remove_icon (GF_MONITOR_VIEW (info->view),
-                                       info->icon);
+          gf_monitor_view_remove_icon (GF_MONITOR_VIEW (info->view), info->icon);
+          info->view = NULL;
 
           self->selected_icons = g_list_remove (self->selected_icons, l->data);
           self->rubberband_icons = g_list_remove (self->rubberband_icons, l->data);
+        }
 
-          self->icons = g_list_remove_link (self->icons, l);
-          g_list_free_full (l, gf_icon_info_free);
+      self->icons = g_list_remove_link (self->icons, l);
+      g_list_free_full (l, gf_icon_info_free);
 
-          break;
-        }
+      break;
     }
 }
 


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