libgnomeui r5594 - in trunk: . file-chooser



Author: carlosg
Date: Fri Apr  4 19:38:22 2008
New Revision: 5594
URL: http://svn.gnome.org/viewvc/libgnomeui?rev=5594&view=rev

Log:
2008-04-04  Carlos Garnacho  <carlos imendio com>

        * file-chooser/gtkfilesystemgio.c
        (gtk_file_system_gio_get_volume_for_path): Do not spew a critical
        warning if there are no mounts. Fixes #515783.
        Also, do not leak root when the enclosing mount is found.



Modified:
   trunk/ChangeLog
   trunk/file-chooser/gtkfilesystemgio.c

Modified: trunk/file-chooser/gtkfilesystemgio.c
==============================================================================
--- trunk/file-chooser/gtkfilesystemgio.c	(original)
+++ trunk/file-chooser/gtkfilesystemgio.c	Fri Apr  4 19:38:22 2008
@@ -592,7 +592,7 @@
 {
   GtkFileSystemGio *file_system_gio;
   GFile *file;
-  GMount *mount;
+  GMount *mount = NULL;
   GSList *list;
   const char *uri;
 
@@ -610,22 +610,21 @@
   /* Skip the first item on the list! */
   for (list = file_system_gio->volumes->next; list; list = list->next)
     {
-      if (g_type_is_a (G_OBJECT_TYPE (list->data), G_TYPE_MOUNT))
-        {
-          GFile *root;
+      GFile *root;
+      gboolean in_mount;
 
-          mount = list->data;
-          root = g_mount_get_root (mount);
-          if (g_file_has_prefix (file, root))
-            {
-              mount = list->data;
-              break;
-            }
-          g_object_unref (root);
+      if (!G_IS_MOUNT (list->data))
+	continue;
 
-          mount = NULL;
-        }
+      root = g_mount_get_root (list->data);
+      in_mount = g_file_has_prefix (file, root);
+      g_object_unref (root);
 
+      if (in_mount)
+	{
+	  mount = list->data;
+	  break;
+	}
     }
 
   g_object_unref (file);



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