Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(567)

Unified Diff: src/ibusconfigservice.c

Issue 2860022: Add api to ibus for retreiving unused config values. (Closed) Base URL: ssh://gitrw.chromium.org/ibus.git
Patch Set: Code review changes Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ibusconfigservice.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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,
« no previous file with comments | « src/ibusconfigservice.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698