[gnome-keyring/dbus-api] [dbus] Use constants that come with dbus library.



commit 2cc28f94a1b172fe4556a93052feeb74ced99b28
Author: Stef Walter <stef memberwebs com>
Date:   Mon Dec 14 02:45:09 2009 +0000

    [dbus] Use constants that come with dbus library.

 daemon/dbus/gkd-secret-objects.c |   12 ++++++------
 daemon/dbus/gkd-secret-service.c |   10 +++++-----
 daemon/dbus/gkd-secret-types.h   |    3 ---
 3 files changed, 11 insertions(+), 14 deletions(-)
---
diff --git a/daemon/dbus/gkd-secret-objects.c b/daemon/dbus/gkd-secret-objects.c
index 85ef17d..dac1152 100644
--- a/daemon/dbus/gkd-secret-objects.c
+++ b/daemon/dbus/gkd-secret-objects.c
@@ -425,15 +425,15 @@ item_message_handler (GkdSecretObjects *self, GP11Object *object, DBusMessage *m
 		return item_method_set_secret (self, object, message);
 
 	/* org.freedesktop.DBus.Properties.Get */
-	if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "Get"))
+	if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Get"))
 		return item_property_get (object, message);
 
 	/* org.freedesktop.DBus.Properties.Set */
-	else if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "Set"))
+	else if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Set"))
 		return item_property_set (object, message);
 
 	/* org.freedesktop.DBus.Properties.GetAll */
-	else if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "GetAll"))
+	else if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "GetAll"))
 		return item_property_getall (object, message);
 
 	else if (dbus_message_has_interface (message, DBUS_INTERFACE_INTROSPECTABLE))
@@ -783,15 +783,15 @@ collection_message_handler (GkdSecretObjects *self, GP11Object *object, DBusMess
 		return collection_method_create_item (self, object, message);
 
 	/* org.freedesktop.DBus.Properties.Get() */
-	if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "Get"))
+	if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Get"))
 		return collection_property_get (self, object, message);
 
 	/* org.freedesktop.DBus.Properties.Set() */
-	else if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "Set"))
+	else if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Set"))
 		return collection_property_set (self, object, message);
 
 	/* org.freedesktop.DBus.Properties.GetAll() */
-	else if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "GetAll"))
+	else if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "GetAll"))
 		return collection_property_getall (self, object, message);
 
 	else if (dbus_message_has_interface (message, DBUS_INTERFACE_INTROSPECTABLE))
diff --git a/daemon/dbus/gkd-secret-service.c b/daemon/dbus/gkd-secret-service.c
index 09fa9f8..4432222 100644
--- a/daemon/dbus/gkd-secret-service.c
+++ b/daemon/dbus/gkd-secret-service.c
@@ -858,15 +858,15 @@ service_message_handler (GkdSecretService *self, DBusMessage *message)
 		return service_method_unlock_with_master_password (self, message);
 
 	/* org.freedesktop.DBus.Properties.Get() */
-	if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "Get"))
+	if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Get"))
 		return service_property_get (self, message);
 
 	/* org.freedesktop.DBus.Properties.Set() */
-	else if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "Set"))
+	else if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "Set"))
 		return service_property_set (self, message);
 
 	/* org.freedesktop.DBus.Properties.GetAll() */
-	else if (dbus_message_is_method_call (message, PROPERTIES_INTERFACE, "GetAll"))
+	else if (dbus_message_is_method_call (message, DBUS_INTERFACE_PROPERTIES, "GetAll"))
 		return service_property_getall (self, message);
 
 	else if (dbus_message_has_interface (message, DBUS_INTERFACE_INTROSPECTABLE))
@@ -963,7 +963,7 @@ gkd_secret_service_filter_handler (DBusConnection *conn, DBusMessage *message, g
 	g_return_val_if_fail (GKD_SECRET_IS_SERVICE (self), DBUS_HANDLER_RESULT_NOT_YET_HANDLED);
 
 	/* org.freedesktop.DBus.NameOwnerChanged(STRING name, STRING old_owner, STRING new_owner) */
-	if (dbus_message_is_signal (message, BUS_INTERFACE, "NameOwnerChanged") &&
+	if (dbus_message_is_signal (message, DBUS_INTERFACE_DBUS, "NameOwnerChanged") &&
 	    dbus_message_get_args (message, NULL, DBUS_TYPE_STRING, &object_name,
 	                           DBUS_TYPE_STRING, &old_owner, DBUS_TYPE_STRING, &new_owner,
 	                           DBUS_TYPE_INVALID)) {
@@ -1044,7 +1044,7 @@ gkd_secret_service_constructor (GType type, guint n_props, GObjectConstructParam
 
 	/* Register for signals that let us know when clients leave the bus */
 	self->match_rule = g_strdup_printf ("type='signal',member=NameOwnerChanged,"
-	                                    "interface='" BUS_INTERFACE "'");
+	                                    "interface='" DBUS_INTERFACE_DBUS "'");
 	dbus_bus_add_match (self->connection, self->match_rule, &error);
 	if (dbus_error_is_set (&error)) {
 		g_warning ("couldn't listen for NameOwnerChanged signal on session bus: %s", error.message);
diff --git a/daemon/dbus/gkd-secret-types.h b/daemon/dbus/gkd-secret-types.h
index 36903be..8c48aed 100644
--- a/daemon/dbus/gkd-secret-types.h
+++ b/daemon/dbus/gkd-secret-types.h
@@ -22,9 +22,6 @@
 #ifndef __GKD_SECRET_TYPES_H__
 #define __GKD_SECRET_TYPES_H__
 
-#define BUS_INTERFACE                  "org.freedesktop.DBus"
-#define PROPERTIES_INTERFACE           "org.freedesktop.DBus.Properties"
-
 #define INTERNAL_SERVICE_INTERFACE     "org.gnome.keyring.InternalUnsupportedGuiltRiddenInterface"
 #define INTERNAL_ERROR_DENIED          "org.gnome.keyring.Error.Denied"
 



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