placessidebar: fix Connect to Server position
authorGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 16 Jul 2015 12:37:56 +0000 (09:37 -0300)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Thu, 16 Jul 2015 12:37:56 +0000 (09:37 -0300)
Commit 7db399d975b8f9626c21761dde5f2d5feeb6e305 introduces
the Other Locations item, as well as some behavioral changes
to GtkPlacesSidebar. It, howevers, wrongly changes the section
of code that handles the Connect to Server item, with various
side effects depending on the environment setup.

Fix that by adding the Connect to Server at the right section
of code.

gtk/gtkplacessidebar.c

index 1781f3973f3e2691a5d5bb2f2bb6b4b8352be53c..39291bca75c0067b0db6cd63d6cf028171aa91fc 100644 (file)
@@ -1223,6 +1223,17 @@ update_places (GtkPlacesSidebar *sidebar)
   /* network */
   if (!sidebar->local_only)
     {
+      if (sidebar->show_connect_to_server)
+        {
+          icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_NETWORK_SERVER);
+          add_place (sidebar, PLACES_CONNECT_TO_SERVER,
+                     SECTION_MOUNTS,
+                     _("Connect to Server"), icon, NULL,
+                     NULL, NULL, NULL, 0,
+                     _("Connect to a network server address"));
+          g_object_unref (icon);
+        }
+
       network_volumes = g_list_reverse (network_volumes);
       for (l = network_volumes; l != NULL; l = l->next)
         {
@@ -1248,17 +1259,6 @@ update_places (GtkPlacesSidebar *sidebar)
               g_free (name);
               g_free (tooltip);
             }
-
-          if (sidebar->show_connect_to_server)
-            {
-              icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_NETWORK_SERVER);
-              add_place (sidebar, PLACES_CONNECT_TO_SERVER,
-                         SECTION_MOUNTS,
-                         _("Connect to Server"), icon, NULL,
-                         NULL, NULL, NULL, 0,
-                         _("Connect to a network server address"));
-              g_object_unref (icon);
-            }
         }
 
       network_mounts = g_list_reverse (network_mounts);