placessidebar: show persistent drives when not showing Other Locations
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 16 Jul 2015 13:28:19 +0000 (10:28 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 16 Jul 2015 14:41:03 +0000 (11:41 -0300)
Previous commits changes the behavior of GtkPlacesSidebar, as it stops
handling persistent devices and only manages mounted networks, XDG
directories and bookmarks.

By radically breaking the previous behavior, we may have trouble
since we provide no alternatives to that besides the private widget
GtkPlacesView.

Fix that by showing the persistent devices when not showing Other
Locations item.

gtk/gtkplacessidebar.c

index 39291bca75c0067b0db6cd63d6cf028171aa91fc..ee1e5f22af34abe2a1025c0dff314e9cbdb8735a 100644 (file)
@@ -987,7 +987,7 @@ update_places (GtkPlacesSidebar *sidebar)
                 }
               g_free (identifier);
 
-              if (!is_removable_volume (volume))
+              if (sidebar->show_other_locations && !is_removable_volume (volume))
                 {
                   g_object_unref (volume);
                   continue;
@@ -1091,7 +1091,7 @@ update_places (GtkPlacesSidebar *sidebar)
         }
       g_free (identifier);
 
-      if (!is_removable_volume (volume))
+      if (sidebar->show_other_locations && !is_removable_volume (volume))
         {
           g_object_unref (volume);
           continue;
@@ -4757,7 +4757,8 @@ gtk_places_sidebar_get_show_enter_location (GtkPlacesSidebar *sidebar)
  * @show_other_locations: whether to show an item for the Other Locations view
  *
  * Sets whether the @sidebar should show an item for the application to show an Other Locations
- * view; this is off by default.
+ * view; this is off by default. When set to %TRUE, persistent devices such as hard drives are
+ * hidden, otherwise they are shown in the sidebar.
  * An application may want to turn this on if it implements a way for the user to see and interact
  * with drives and network servers directly. #GtkPlacesView is the reference implementation for
  * it.