[gvfs] client: Suppress errors if daemon part is missing



commit 44100b4a828577786062c27d9bfb34d7a5844fff
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Jun 4 16:33:33 2015 +0200

    client: Suppress errors if daemon part is missing
    
    We want to split gvfs package on client and daemon part due to app
    sandboxing. Return FALSE from vfs_is_active if there aren't any
    supported uri schemes (i.e. deamon part is missing). It will cause
    things to work just like if the gvfs client part was never installed.
    
    Replace some warnings/errors by g_debug to suppress errors when
    registering gio modules and daemon part is missing.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=750401

 client/gdaemonvfs.c      |   10 +++-------
 common/gvfsmonitorimpl.c |    2 +-
 2 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/client/gdaemonvfs.c b/client/gdaemonvfs.c
index 3b0337d..11435e8 100644
--- a/client/gdaemonvfs.c
+++ b/client/gdaemonvfs.c
@@ -607,12 +607,8 @@ fill_mountable_info (GDaemonVfs *vfs)
                                                               NULL,
                                                               &error))
     {
-      /* Don't warn if we're running a new gvfs plugin against an old gvfs-daemon,
-       * as happens in jhbuild.
-       */
-      if (!g_error_matches (error, G_DBUS_ERROR, G_DBUS_ERROR_UNKNOWN_METHOD))
-       g_printerr ("org.gtk.vfs.MountTracker.listMountableInfo call failed: %s (%s, %d)\n",
-                   error->message, g_quark_to_string (error->domain), error->code);
+      g_debug ("org.gtk.vfs.MountTracker.listMountableInfo call failed: %s (%s, %d)\n",
+               error->message, g_quark_to_string (error->domain), error->code);
       g_error_free (error);
       g_object_unref (proxy);
       return;
@@ -1454,7 +1450,7 @@ static gboolean
 g_daemon_vfs_is_active (GVfs *vfs)
 {
   GDaemonVfs *daemon_vfs = G_DAEMON_VFS (vfs);
-  return daemon_vfs->async_bus != NULL;
+  return (daemon_vfs->async_bus != NULL) && (daemon_vfs->supported_uri_schemes != NULL);
 }
 
 static void
diff --git a/common/gvfsmonitorimpl.c b/common/gvfsmonitorimpl.c
index 1d5d0e2..882c3fb 100644
--- a/common/gvfsmonitorimpl.c
+++ b/common/gvfsmonitorimpl.c
@@ -98,7 +98,7 @@ g_vfs_list_monitor_implementations (void)
   dir = g_dir_open (monitors_dir, 0, &error);
   if (dir == NULL)
     {
-      g_warning ("cannot open directory %s: %s", monitors_dir, error->message);
+      g_debug ("cannot open directory %s: %s", monitors_dir, error->message);
       g_error_free (error);
     }
   else


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