| Index: src/ibusconfigservice.c
|
| diff --git a/src/ibusconfigservice.c b/src/ibusconfigservice.c
|
| index 30d515bd5d6b7ba04c745dfe3a7517aa23a37f32..943e73e9e8c2574c0ffeb80151a1512bca47b37f 100644
|
| --- a/src/ibusconfigservice.c
|
| +++ b/src/ibusconfigservice.c
|
| @@ -62,6 +62,10 @@ static gboolean ibus_config_service_unset (IBusConfigService *con
|
| const gchar *section,
|
| const gchar *name,
|
| IBusError **error);
|
| +static gboolean ibus_config_service_get_unused (IBusConfigService *config,
|
| + GValue *unread,
|
| + GValue *unwritten,
|
| + IBusError **error);
|
|
|
| static IBusServiceClass *parent_class = NULL;
|
|
|
| @@ -123,6 +127,7 @@ ibus_config_service_class_init (IBusConfigServiceClass *klass)
|
| klass->set_value = ibus_config_service_set_value;
|
| klass->get_value = ibus_config_service_get_value;
|
| klass->unset = ibus_config_service_unset;
|
| + klass->get_unused = ibus_config_service_get_unused;
|
|
|
| /* install properties */
|
| /**
|
| @@ -291,6 +296,28 @@ ibus_config_service_ibus_message (IBusConfigService *config,
|
| reply = ibus_message_new_method_return (message);
|
| }
|
| }
|
| + else if (ibus_message_is_method_call (message, IBUS_INTERFACE_CONFIG, "GetUnused")) {
|
| + GValue unread = { 0 };
|
| + GValue unwritten = { 0 };
|
| + IBusError *error = NULL;
|
| + gboolean retval;
|
| +
|
| + if (!IBUS_CONFIG_SERVICE_GET_CLASS (config)->get_unused (config, &unread, &unwritten, &error)) {
|
| + reply = ibus_message_new_error (message,
|
| + error->name,
|
| + error->message);
|
| + ibus_error_free (error);
|
| + }
|
| + else {
|
| + reply = ibus_message_new_method_return (message);
|
| + ibus_message_append_args (reply,
|
| + G_TYPE_VALUE, &unread,
|
| + G_TYPE_VALUE, &unwritten,
|
| + G_TYPE_INVALID);
|
| + g_value_unset (&unread);
|
| + g_value_unset (&unwritten);
|
| + }
|
| + }
|
|
|
| if (reply) {
|
| ibus_connection_send (connection, reply);
|
| @@ -345,6 +372,19 @@ ibus_config_service_unset (IBusConfigService *config,
|
| return FALSE;
|
| }
|
|
|
| +static gboolean
|
| +ibus_config_service_get_unused (IBusConfigService *config,
|
| + GValue *unread,
|
| + GValue *unwritten,
|
| + IBusError **error)
|
| +{
|
| + if (error) {
|
| + *error = ibus_error_new_from_printf (DBUS_ERROR_FAILED,
|
| + "Can not get unused values");
|
| + }
|
| + return FALSE;
|
| +}
|
| +
|
| void
|
| ibus_config_service_value_changed (IBusConfigService *config,
|
| const gchar *section,
|
|
|