[at-spi2-core] Don't display warnings when connecting to an app that no longer exists



commit c22456cf57984cced09bab73119d4df56a870b13
Author: Mike Gorse <mgorse suse com>
Date:   Mon Feb 29 11:51:45 2016 -0600

    Don't display warnings when connecting to an app that no longer exists
    
    If an application starts and subsequently exits before we've had time to
    connect to it, then this at the very least should not trigger a warning.

 atspi/atspi-misc.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
---
diff --git a/atspi/atspi-misc.c b/atspi/atspi-misc.c
index 3a1d174..83d3f96 100644
--- a/atspi/atspi-misc.c
+++ b/atspi/atspi-misc.c
@@ -201,7 +201,8 @@ handle_get_bus_address (DBusPendingCall *pending, void *user_data)
       }
       else
       {
-        g_warning ("Unable to open bus connection: %s", error.message);
+        if (!strcmp (error.name, DBUS_ERROR_FILE_NOT_FOUND))
+          g_warning ("Unable to open bus connection: %s", error.message);
         dbus_error_free (&error);
       }
     }
@@ -529,9 +530,16 @@ handle_get_items (DBusPendingCall *pending, void *user_data)
   {
     const char *sender = dbus_message_get_sender (reply);
     const char *error = NULL;
-    dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &error,
-                           DBUS_TYPE_INVALID);
-    g_warning ("AT-SPI: Error in GetItems, sender=%s, error=%s", sender, error);
+    if (!strcmp (dbus_message_get_error_name (reply),
+                 DBUS_ERROR_SERVICE_UNKNOWN))
+    {
+    }
+    else
+    {
+      dbus_message_get_args (reply, NULL, DBUS_TYPE_STRING, &error,
+                             DBUS_TYPE_INVALID);
+      g_warning ("AT-SPI: Error in GetItems, sender=%s, error=%s", sender, error);
+    }
     dbus_message_unref (reply);
     dbus_pending_call_unref (pending);
     return;


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