summaryrefslogtreecommitdiff
path: root/engine
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2010-06-07 10:59:27 +0200
committerRyan Lortie <desrt@desrt.ca>2010-06-10 16:35:50 -0400
commit4e0a2bc4f98c18ff03a594d92fe65dfcfc5e2f80 (patch)
tree3ca39731d1fbf21b7120c1b5fae750c9a43398d0 /engine
parenta5c13067f8a764e46df8c711961e7762e2d3bdbc (diff)
downloaddconf-4e0a2bc4f98c18ff03a594d92fe65dfcfc5e2f80.tar.gz
Switch from sequence numbers to tag strings
Diffstat (limited to 'engine')
-rw-r--r--engine/dconf-engine.c45
-rw-r--r--engine/dconf-engine.h10
2 files changed, 50 insertions, 5 deletions
diff --git a/engine/dconf-engine.c b/engine/dconf-engine.c
index 14054c9..1e36126 100644
--- a/engine/dconf-engine.c
+++ b/engine/dconf-engine.c
@@ -221,16 +221,28 @@ dconf_engine_list (DConfEngine *engine,
return list;
}
+static gchar *
+dconf_engine_make_tag (guint bus_type,
+ const gchar *sender,
+ guint64 seqno)
+{
+ return g_strdup_printf ("%c/%s/%"G_GUINT64_FORMAT, bus_type, sender, seqno);
+}
+
gboolean
dconf_engine_decode_notify (DConfEngine *engine,
- guint64 anti_expose,
+ const gchar *anti_expose,
const gchar **path,
const gchar ***rels,
+ guint bus_type,
+ const gchar *sender,
const gchar *iface,
const gchar *method,
GVariant *body)
{
- guint64 ae;
+ gboolean matched;
+ guint64 seqno;
+ gchar *ae;
if (strcmp (iface, "ca.desrt.dconf.Writer") || strcmp (method, "Notify"))
return FALSE;
@@ -238,12 +250,37 @@ dconf_engine_decode_notify (DConfEngine *engine,
if (!g_variant_is_of_type (body, G_VARIANT_TYPE ("(tsas)")))
return FALSE;
- g_variant_get_child (body, 0, "t", &ae);
+ g_variant_get_child (body, 0, "t", &seqno);
+
+ ae = dconf_engine_make_tag (bus_type, sender, seqno);
+ matched = strcmp (ae, anti_expose) == 0;
+ g_free (ae);
- if (ae == anti_expose)
+ if (matched)
return FALSE;
g_variant_get (body, "(t&s^a&s)", NULL, path, rels);
return TRUE;
}
+
+gboolean
+dconf_engine_interpret_reply (DConfEngineMessage *dcem,
+ const gchar *sender,
+ GVariant *body,
+ gchar **tag,
+ GError **error)
+{
+ /* typecheck and so on... */
+
+ if (tag != NULL)
+ {
+ guint64 sequence;
+
+ g_variant_get_child (body, 0, "t", &sequence);
+
+ *tag = dconf_engine_make_tag (dcem->bus_type, sender, sequence);
+ }
+
+ return TRUE;
+}
diff --git a/engine/dconf-engine.h b/engine/dconf-engine.h
index 2cf72c8..af9547c 100644
--- a/engine/dconf-engine.h
+++ b/engine/dconf-engine.h
@@ -61,9 +61,11 @@ void dconf_engine_unwatch (DConfEn
DConfEngineMessage *message,
const gchar *name);
gboolean dconf_engine_decode_notify (DConfEngine *engine,
- guint64 anti_expose,
+ const gchar *anti_expose,
const gchar **prefix,
const gchar ***keys,
+ guint bus_type,
+ const gchar *sender,
const gchar *interface,
const gchar *member,
GVariant *body);
@@ -72,4 +74,10 @@ void dconf_engine_set_locked (DConfEn
const gchar *path,
gboolean locked);
+gboolean dconf_engine_interpret_reply (DConfEngineMessage *message,
+ const gchar *sender,
+ GVariant *body,
+ gchar **tag,
+ GError **error);
+
#endif /* _dconf_engine_h_ */