[gnome-builder/gnome-builder-3-28] recent: be more careful about directory reaping



commit 6c1249e207a20a40ed12eea4c624928c6b351dc1
Author: Christian Hergert <chergert redhat com>
Date:   Thu Apr 19 17:06:41 2018 -0700

    recent: be more careful about directory reaping

 src/plugins/recent/gbp-recent-section.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/src/plugins/recent/gbp-recent-section.c b/src/plugins/recent/gbp-recent-section.c
index 1a15b6abf..42272ae58 100644
--- a/src/plugins/recent/gbp-recent-section.c
+++ b/src/plugins/recent/gbp-recent-section.c
@@ -322,7 +322,14 @@ gbp_recent_section_purge_selected (IdeGreeterSection *section)
       g_assert (G_IS_FILE (directory) || G_IS_FILE (file));
 
       if (directory == NULL)
-        directory = parent = g_file_get_parent (file);
+        {
+          if (g_file_query_file_type (file, 0, NULL) == G_FILE_TYPE_DIRECTORY)
+            directory = g_object_ref (file);
+          else
+            directory = parent = g_file_get_parent (file);
+        }
+
+      g_assert (G_IS_FILE (directory));
 
       dzl_directory_reaper_add_directory (reaper, directory, 0);
       g_ptr_array_add (directories, g_object_ref (directory));


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