[pan2] [Pan-devel] 07b95bee notification problem bisected to ebeed4ce



commit 0bc2fe83bf16066bc719eb03fcb267ad0f1c1e35
Author: Heinrich MÃller <henmull src gnome org>
Date:   Sun Jan 8 14:28:52 2012 +0100

    [Pan-devel] 07b95bee notification problem bisected to ebeed4ce

 pan/gui/pan.cc |   19 ++++++++++++++++---
 1 files changed, 16 insertions(+), 3 deletions(-)
---
diff --git a/pan/gui/pan.cc b/pan/gui/pan.cc
index 9b13b41..0f8e30c 100644
--- a/pan/gui/pan.cc
+++ b/pan/gui/pan.cc
@@ -225,6 +225,7 @@ namespace
       static_cast<StatusIconListener*>(p)->update_status_tooltip();
     }
 
+#ifdef HAVE_LIBNOTIFY
     static void notif_maximize_cb(NotifyNotification *notification,
                                char *action,
                                gpointer user_data)
@@ -245,6 +246,7 @@ namespace
       s->_notifs.erase(G_OBJECT(notification));
       g_object_unref (notification);
     }
+#endif
 
     bool n() { return notif_shown; }
 
@@ -269,11 +271,13 @@ namespace
       queue.remove_listener(this);
       data.remove_listener(this);
       g_source_remove (status_icon_timeout_tag);
+#ifdef HAVE_LIBNOTIFY
       foreach(std::set<GObject*>, _notifs, it)
       {
         notify_notification_close(NOTIFY_NOTIFICATION(*it), NULL);
         g_object_unref (*it);
       }
+#endif
     }
 
     /* prefs::listener */
@@ -788,9 +792,6 @@ _("General Options\n"
     Pan* pan(static_cast<Pan*>(user_data));
     g_return_if_fail (pan);
 
-    if (connection) g_dbus_connection_close(connection,NULL,0,NULL);
-    g_bus_unown_name(pan->dbus_id);
-
     pan->name_valid = false;
     pan->lost_name = true;
     pan->dbus_id= -1;
@@ -812,6 +813,13 @@ _("General Options\n"
     dbus_connection = g_bus_get_sync  (G_BUS_TYPE_SESSION , NULL, NULL);
   }
 
+  static void
+  pan_dbus_deinit (Pan* pan)
+  {
+    if (dbus_connection) g_dbus_connection_close(dbus_connection,NULL,0,NULL);
+    g_bus_unown_name(pan->dbus_id);
+  }
+
   /***
    ***
    ***/
@@ -1041,6 +1049,11 @@ main (int argc, char *argv[])
     }
 
     delete queue_and_gui;
+#ifdef HAVE_DBUS
+  #ifndef DEBUG_PARALLEL
+    pan_dbus_deinit(&pan);
+  #endif
+#endif
   }
 
   g_mime_shutdown ();



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