aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2011-01-14 13:13:43 -0600
committerTed Gould <ted@gould.cx>2011-01-14 13:13:43 -0600
commit26ceab5a8b4e80711f5cd7ed0bda4a28f3113429 (patch)
treea8f3eddaebe2d9da051f48bb8a319c0fe6d2de79 /src
parentc53751d07949b38ad75e794a43a6272634507ee1 (diff)
downloadayatana-indicator-messages-26ceab5a8b4e80711f5cd7ed0bda4a28f3113429.tar.gz
ayatana-indicator-messages-26ceab5a8b4e80711f5cd7ed0bda4a28f3113429.tar.bz2
ayatana-indicator-messages-26ceab5a8b4e80711f5cd7ed0bda4a28f3113429.zip
Switching how we get our interface info
Diffstat (limited to 'src')
-rw-r--r--src/messages-service-dbus.c24
-rw-r--r--src/messages-service.c1
2 files changed, 21 insertions, 4 deletions
diff --git a/src/messages-service-dbus.c b/src/messages-service-dbus.c
index d9c0e8d..6ed6678 100644
--- a/src/messages-service-dbus.c
+++ b/src/messages-service-dbus.c
@@ -24,9 +24,10 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include "config.h"
#endif
-#include <dbus/dbus-glib.h>
+#include <gio/gio.h>
#include "messages-service-dbus.h"
#include "dbus-data.h"
+#include "gen-messages-service.xml.h"
enum {
ATTENTION_CHANGED,
@@ -56,10 +57,12 @@ static void _messages_service_server_watch (void);
static gboolean _messages_service_server_attention_requested (MessageServiceDbus * self, gboolean * dot, GError ** error);
static gboolean _messages_service_server_icon_shown (MessageServiceDbus * self, gboolean * hidden, GError ** error);
-#include "messages-service-server.h"
+static GDBusNodeInfo * bus_node_info = NULL;
+static GDBusInterfaceInfo * bus_interface_info = NULL;
G_DEFINE_TYPE (MessageServiceDbus, message_service_dbus, G_TYPE_OBJECT);
+
static void
message_service_dbus_class_init (MessageServiceDbusClass *klass)
{
@@ -86,8 +89,23 @@ message_service_dbus_class_init (MessageServiceDbusClass *klass)
g_cclosure_marshal_VOID__BOOLEAN,
G_TYPE_NONE, 1, G_TYPE_BOOLEAN);
+ if (bus_node_info == NULL) {
+ GError * error = NULL;
+
+ bus_node_info = g_dbus_node_info_new_for_xml(_messages_service, &error);
+ if (error != NULL) {
+ g_error("Unable to parse Messaging Menu Interface description: %s", error->message);
+ g_error_free(error);
+ }
+ }
- dbus_g_object_type_install_info(MESSAGE_SERVICE_DBUS_TYPE, &dbus_glib__messages_service_server_object_info);
+ if (bus_interface_info == NULL) {
+ bus_interface_info = g_dbus_node_info_lookup_interface(bus_node_info, INDICATOR_MESSAGES_DBUS_SERVICE_INTERFACE);
+
+ if (bus_interface_info == NULL) {
+ g_error("Unable to find interface '" INDICATOR_MESSAGES_DBUS_SERVICE_INTERFACE "'");
+ }
+ }
return;
}
diff --git a/src/messages-service.c b/src/messages-service.c
index b87c2ff..e3352e8 100644
--- a/src/messages-service.c
+++ b/src/messages-service.c
@@ -25,7 +25,6 @@ with this program. If not, see <http://www.gnu.org/licenses/>.
#include <libintl.h>
#include <config.h>
#include <pango/pango-utils.h>
-#include <dbus/dbus-glib-bindings.h>
#include <libindicate/listener.h>
#include <libindicator/indicator-service.h>
#include <gio/gio.h>