[nautilus] search-provider: Add volume mounts only if mounted



commit cfe7a09ad0d3e92ca47b7fd3ab78434a41072809
Author: Yanko Kaneti <yaneti declera com>
Date:   Wed Sep 19 17:11:55 2012 +0300

    search-provider: Add volume mounts only if mounted
    
    https://bugzilla.gnome.org/show_bug.cgi?id=684378

 src/nautilus-shell-search-provider.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/src/nautilus-shell-search-provider.c b/src/nautilus-shell-search-provider.c
index aa57975..552a30f 100644
--- a/src/nautilus-shell-search-provider.c
+++ b/src/nautilus-shell-search-provider.c
@@ -347,7 +347,10 @@ search_add_volumes_and_bookmarks (NautilusShellSearchProviderApp *self)
 
     for (m = volumes; m != NULL; m = m->next) {
       volume = m->data;
-      mounts_to_check = g_list_prepend (mounts_to_check, g_volume_get_mount (volume));
+      mount = g_volume_get_mount (volume);
+      if (mount != NULL) {
+        mounts_to_check = g_list_prepend (mounts_to_check, mount);
+      }
     }
 
     g_list_free_full (volumes, g_object_unref);
@@ -360,8 +363,12 @@ search_add_volumes_and_bookmarks (NautilusShellSearchProviderApp *self)
     volume = l->data;
     drive = g_volume_get_drive (volume);
 
-    if (drive == NULL)
-      mounts_to_check = g_list_prepend (mounts_to_check, g_volume_get_mount (volume));
+    if (drive == NULL) {
+      mount = g_volume_get_mount (volume);
+      if (mount != NULL) {
+        mounts_to_check = g_list_prepend (mounts_to_check, mount);
+      }
+    }
     g_clear_object (&drive);
   }
   g_list_free_full (volumes, g_object_unref);



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