[gnome-builder] notifications: allow proxy failure



commit 8f55068452ae062401d488c4ffeed6f76e65495d
Author: Christian Hergert <chergert redhat com>
Date:   Thu Jun 29 21:24:50 2017 -0700

    notifications: allow proxy failure
    
    This allows us to run on desktops that do not have a notifications
    system, such as mutter/metacity without gnome-shell.

 plugins/notification/ide-notification-addin.c |   12 +++++++++++-
 1 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/plugins/notification/ide-notification-addin.c b/plugins/notification/ide-notification-addin.c
index 491203a..c23e742 100644
--- a/plugins/notification/ide-notification-addin.c
+++ b/plugins/notification/ide-notification-addin.c
@@ -56,6 +56,11 @@ ide_notification_addin_notify (IdeNotificationAddin *self,
   const gchar *project_name;
   const gchar *msg_title;
 
+  g_assert (IDE_IS_NOTIFICATION_ADDIN (self));
+
+  if (self->proxy == NULL)
+    return;
+
   app = GTK_APPLICATION (g_application_get_default ());
   window = gtk_application_get_active_window (app);
   if(gtk_window_has_toplevel_focus (window))
@@ -152,7 +157,12 @@ ide_notification_addin_load (IdeBuildPipelineAddin *addin,
                                                "org.freedesktop.Notifications",
                                                NULL,
                                                NULL);
-  g_assert (G_IS_DBUS_PROXY (self->proxy));
+
+  if (self->proxy == NULL)
+    {
+      g_message ("Failed to locate org.freedesktop.Notifications");
+      return;
+    }
 
   g_signal_connect_object (build_manager,
                            "build-finished",


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