hal/hald hald_dbus.c,1.54,1.55

David Zeuthen david at freedesktop.org
Mon Feb 13 18:52:46 PST 2006


Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv19315/hald

Modified Files:
	hald_dbus.c 
Log Message:
2006-02-13  David Zeuthen  <davidz at redhat.com>

        * tools/hal-luks-teardown: Remove hal-luks-remove on
        info.callouts.remove on successful teardown

        * tools/hal-luks-setup: Throw SetupPasswordError instead of just
        SetupError when cryptsetup is failing - used to ask for password
        again if the one from e.g. the keyring didn't work.

        * hald/hald_dbus.c (device_string_list_remove): New function
        (hald_dbus_filter_handle_methods): Handle StringListRemove



Index: hald_dbus.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald_dbus.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- hald_dbus.c	12 Feb 2006 21:47:28 -0000	1.54
+++ hald_dbus.c	14 Feb 2006 02:52:44 -0000	1.55
@@ -1394,6 +1394,57 @@
 	return DBUS_HANDLER_RESULT_HANDLED;
 }
 
+/* TODO: docs */
+static DBusHandlerResult
+device_string_list_remove (DBusConnection * connection, DBusMessage * message)
+{
+	const char *udi;
+	const char *key;
+	const char *value;
+	HalDevice *d;
+	DBusMessage *reply;
+	DBusError error;
+	gboolean ret;
+
+	HAL_TRACE (("entering"));
+
+	udi = dbus_message_get_path (message);
+
+	d = hal_device_store_find (hald_get_gdl (), udi);
+	if (d == NULL)
+		d = hal_device_store_find (hald_get_tdl (), udi);
+
+	if (d == NULL) {
+		raise_no_such_device (connection, message, udi);
+		return DBUS_HANDLER_RESULT_HANDLED;
+	}
+
+	dbus_error_init (&error);
+	if (!dbus_message_get_args (message, &error,
+				    DBUS_TYPE_STRING, &key,
+				    DBUS_TYPE_STRING, &value,
+				    DBUS_TYPE_INVALID)) {
+		raise_syntax (connection, message, "StringListRemove");
+		return DBUS_HANDLER_RESULT_HANDLED;
+	}
+
+	ret = hal_device_property_strlist_remove (d, key, value);
+	if (!ret) {
+		raise_property_type_error (connection, message, udi, key);
+		return DBUS_HANDLER_RESULT_HANDLED;
+	}
+
+	reply = dbus_message_new_method_return (message);
+	if (reply == NULL)
+		DIE (("No memory"));
+	
+	if (!dbus_connection_send (connection, reply, NULL))
+		DIE (("No memory"));
+	
+	dbus_message_unref (reply);
+	return DBUS_HANDLER_RESULT_HANDLED;
+}
+
 
 
 /** Remove a property on a device.
@@ -2833,6 +2884,10 @@
 		return device_string_list_append_prepend (connection, message, TRUE);
 	} else if (dbus_message_is_method_call (message,
 						"org.freedesktop.Hal.Device",
+						"StringListRemove")) {
+		return device_string_list_remove (connection, message);
+	} else if (dbus_message_is_method_call (message,
+						"org.freedesktop.Hal.Device",
 						"Rescan")) {
 		return device_rescan (connection, message, local_interface);
 	} else if (dbus_message_is_method_call (message,




More information about the hal-commit mailing list