Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
GTK+3 file open/save dialog patch
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks
View previous topic :: View next topic  
Author Message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Sun Apr 01, 2018 1:36 am    Post subject: GTK+3 file open/save dialog patch Reply with quote

My setup is rather spartan, for instance I do not use gvfs. Unfortunately, GTK+3 is not designed for such simple setups and misbehaves. My file open and save dialog window had many unwanted entries in the left pane and there was no way to remove them without altering the code. If you are experiencing the same then the patch below will make this window look sane and neat.

Code:
diff --git a/gtk/gtkplacessidebar.c b/gtk/gtkplacessidebar.c
index 32314eb..43be6ff 100644
--- a/gtk/gtkplacessidebar.c
+++ b/gtk/gtkplacessidebar.c
@@ -1050,6 +1050,7 @@ update_places (GtkPlacesSidebar *sidebar)
   g_free (home_uri);
 
   /* desktop */
+  if (FALSE) {
   if (sidebar->show_desktop)
     {
       mount_uri = get_desktop_directory_uri ();
@@ -1065,9 +1066,10 @@ update_places (GtkPlacesSidebar *sidebar)
           g_free (mount_uri);
         }
     }
+  }
 
   /* XDG directories */
-  add_special_dirs (sidebar);
+  /*add_special_dirs (sidebar);*/
 
   if (sidebar->show_enter_location)
     {
@@ -1081,6 +1083,7 @@ update_places (GtkPlacesSidebar *sidebar)
     }
 
   /* Trash */
+  if (FALSE) {
   if (!sidebar->local_only && sidebar->show_trash)
     {
       start_icon = _gtk_trash_monitor_get_icon (sidebar->trash_monitor);
@@ -1093,6 +1096,7 @@ update_places (GtkPlacesSidebar *sidebar)
                                  (gpointer *) &sidebar->trash_row);
       g_object_unref (start_icon);
     }
+  }
 
   /* Application-side shortcuts */
   add_application_shortcuts (sidebar);
@@ -1149,6 +1153,7 @@ update_places (GtkPlacesSidebar *sidebar)
 #endif
 
   /* go through all connected drives */
+  if (FALSE) {
   drives = g_volume_monitor_get_connected_drives (sidebar->volume_monitor);
 
   for (l = drives; l != NULL; l = l->next)
@@ -1251,8 +1256,10 @@ update_places (GtkPlacesSidebar *sidebar)
         }
     }
   g_list_free_full (drives, g_object_unref);
+  }
 
   /* add all network volumes that is not associated with a drive */
+  if (FALSE) {
   volumes = g_volume_monitor_get_volumes (sidebar->volume_monitor);
   for (l = volumes; l != NULL; l = l->next)
     {
@@ -1316,6 +1323,7 @@ update_places (GtkPlacesSidebar *sidebar)
       g_object_unref (volume);
     }
   g_list_free (volumes);
+  }
 
   /* file system root */
   if (!sidebar->show_other_locations)
@@ -1418,6 +1426,7 @@ update_places (GtkPlacesSidebar *sidebar)
   g_object_unref (new_bookmark_icon);
 
   /* network */
+  if (FALSE) {
   if (!sidebar->local_only)
     {
       if (sidebar->show_connect_to_server)
@@ -1478,6 +1487,7 @@ update_places (GtkPlacesSidebar *sidebar)
           g_free (tooltip);
         }
     }
+  }
 
   g_list_free_full (network_volumes, g_object_unref);
   g_list_free_full (network_mounts, g_object_unref);

_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Documentation, Tips & Tricks All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum