[gtk+] placessidebar: show persistent drives when not showing Other Locations



commit 3b41daca780e9e83d04dcad43e2fbd5a2ab8c120
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Thu Jul 16 10:28:19 2015 -0300

    placessidebar: show persistent drives when not showing Other Locations
    
    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 |    7 ++++---
 1 files changed, 4 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 39291bc..ee1e5f2 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -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.


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