gvfs r2378 - in trunk: . daemon



Author: alexl
Date: Thu Apr 16 10:46:18 2009
New Revision: 2378
URL: http://svn.gnome.org/viewvc/gvfs?rev=2378&view=rev

Log:
2009-04-16  Alexander Larsson  <alexl redhat com>

	* daemon/gvfsbackend.[ch]:
	Add g_vfs_backend_is_mounted()

	* daemon/gvfsdaemon.c:
	(g_vfs_daemon_re_register_job_sources):
	Don't re-register backends that have not finished mounted
	yet. (#578861)




Modified:
   trunk/ChangeLog
   trunk/daemon/gvfsbackend.c
   trunk/daemon/gvfsbackend.h
   trunk/daemon/gvfsdaemon.c

Modified: trunk/daemon/gvfsbackend.c
==============================================================================
--- trunk/daemon/gvfsbackend.c	(original)
+++ trunk/daemon/gvfsbackend.c	Thu Apr 16 10:46:18 2009
@@ -67,7 +67,8 @@
 {
   GVfsDaemon *daemon;
   char *object_path;
-  
+
+  gboolean is_mounted;
   char *display_name;
   char *stable_name;
   char **x_content_types;
@@ -273,6 +274,11 @@
   return backend->priv->daemon;
 }
 
+gboolean
+g_vfs_backend_is_mounted (GVfsBackend *backend)
+{
+  return backend->priv->is_mounted;
+}
 
 void
 g_vfs_backend_set_display_name (GVfsBackend *backend,
@@ -604,6 +610,8 @@
   char *x_content_types_string;
   char *icon_str;
 
+  backend->priv->is_mounted = TRUE;
+
   if (backend->priv->x_content_types != NULL && g_strv_length (backend->priv->x_content_types) > 0)
     x_content_types_string = g_strjoinv (" ", backend->priv->x_content_types);
   else
@@ -632,7 +640,7 @@
 				 DBUS_TYPE_OBJECT_PATH, &backend->priv->object_path,
 				 DBUS_TYPE_STRING, &backend->priv->display_name,
 				 DBUS_TYPE_STRING, &stable_name,
-                                 DBUS_TYPE_STRING, &x_content_types_string,
+				 DBUS_TYPE_STRING, &x_content_types_string,
 				 DBUS_TYPE_STRING, &icon_str,
 				 DBUS_TYPE_STRING, &backend->priv->prefered_filename_encoding,
 				 DBUS_TYPE_BOOLEAN, &user_visible,

Modified: trunk/daemon/gvfsbackend.h
==============================================================================
--- trunk/daemon/gvfsbackend.h	(original)
+++ trunk/daemon/gvfsbackend.h	Thu Apr 16 10:46:18 2009
@@ -452,6 +452,7 @@
 GIcon      *g_vfs_backend_get_icon                       (GVfsBackend        *backend);
 GMountSpec *g_vfs_backend_get_mount_spec                 (GVfsBackend        *backend);
 GVfsDaemon *g_vfs_backend_get_daemon                     (GVfsBackend        *backend);
+gboolean    g_vfs_backend_is_mounted                     (GVfsBackend        *backend);
 
 void        g_vfs_backend_add_auto_info                  (GVfsBackend           *backend,
 							  GFileAttributeMatcher *matcher,

Modified: trunk/daemon/gvfsdaemon.c
==============================================================================
--- trunk/daemon/gvfsdaemon.c	(original)
+++ trunk/daemon/gvfsdaemon.c	Thu Apr 16 10:46:18 2009
@@ -354,7 +354,14 @@
   for (l = daemon->job_sources; l != NULL; l = l->next)
     {
       if (G_VFS_IS_BACKEND (l->data))
-	g_vfs_backend_register_mount (l->data, NULL, NULL);
+	{
+	  GVfsBackend *backend = l->data;
+
+	  /* Only re-register if we registered before, not e.g
+	     if we're currently mounting. */
+	  if (g_vfs_backend_is_mounted (backend))
+	    g_vfs_backend_register_mount (backend, NULL, NULL);
+	}
     }
   
   g_mutex_unlock (daemon->lock);



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