Merge lp:~dbusmenu-team/libdbusmenu/ubuntu into lp:~ubuntu-desktop/libdbusmenu/ubuntu

Proposed by Ted Gould
Status: Merged
Merged at revision: not available
Proposed branch: lp:~dbusmenu-team/libdbusmenu/ubuntu
Merge into: lp:~ubuntu-desktop/libdbusmenu/ubuntu
Diff against target: 392 lines (+54/-142)
6 files modified
configure.ac (+3/-3)
debian/changelog (+9/-0)
libdbusmenu-glib/client.c (+1/-127)
tests/test-glib-proxy-client.c (+18/-6)
tests/test-glib-proxy-server.c (+20/-5)
tests/test-glib-proxy.h (+3/-1)
To merge this branch: bzr merge lp:~dbusmenu-team/libdbusmenu/ubuntu
Reviewer Review Type Date Requested Status
Sebastien Bacher Pending
Review via email: mp+20150@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

0.2.6

BTW, forgot to put 524308 in the changelog.

lp:~dbusmenu-team/libdbusmenu/ubuntu updated
68. By Sebastien Bacher

releasing version 0.2.6-0ubuntu1

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2010-02-18 16:54:54 +0000
+++ configure.ac 2010-02-25 17:00:34 +0000
@@ -1,11 +1,11 @@
11
2AC_INIT(libdbusmenu, 0.2.5, ted@canonical.com)2AC_INIT(libdbusmenu, 0.2.6, ted@canonical.com)
3AC_COPYRIGHT([Copyright 2009,2010 Canonical])3AC_COPYRIGHT([Copyright 2009,2010 Canonical])
44
5AC_PREREQ(2.53)5AC_PREREQ(2.53)
66
7AM_CONFIG_HEADER(config.h)7AM_CONFIG_HEADER(config.h)
8AM_INIT_AUTOMAKE(libdbusmenu, 0.2.5)8AM_INIT_AUTOMAKE(libdbusmenu, 0.2.6)
99
10AM_MAINTAINER_MODE10AM_MAINTAINER_MODE
1111
@@ -66,7 +66,7 @@
66###########################66###########################
6767
68LIBDBUSMENU_CURRENT=168LIBDBUSMENU_CURRENT=1
69LIBDBUSMENU_REVISION=369LIBDBUSMENU_REVISION=4
70LIBDBUSMENU_AGE=070LIBDBUSMENU_AGE=0
7171
72AC_SUBST(LIBDBUSMENU_CURRENT)72AC_SUBST(LIBDBUSMENU_CURRENT)
7373
=== modified file 'debian/changelog'
--- debian/changelog 2010-02-18 17:18:30 +0000
+++ debian/changelog 2010-02-25 17:00:34 +0000
@@ -1,3 +1,12 @@
1libdbusmenu (0.2.6-0ubuntu1~ppa1) lucid; urgency=low
2
3 * Upstream release 0.2.6
4 * Fix testing to make it more reliable
5 * Remove delayed property queueing as it was causing
6 properties to not get updated.
7
8 -- Ted Gould <ted@ubuntu.com> Thu, 25 Feb 2010 10:23:49 -0600
9
1libdbusmenu (0.2.5-0ubuntu1) lucid; urgency=low10libdbusmenu (0.2.5-0ubuntu1) lucid; urgency=low
211
3 * Upstream release 0.2.512 * Upstream release 0.2.5
413
=== modified file 'libdbusmenu-glib/client.c'
--- libdbusmenu-glib/client.c 2010-02-18 16:50:00 +0000
+++ libdbusmenu-glib/client.c 2010-02-25 17:00:34 +0000
@@ -75,8 +75,6 @@
75 DBusGProxy * dbusproxy;75 DBusGProxy * dbusproxy;
7676
77 GHashTable * type_handlers;77 GHashTable * type_handlers;
78
79 GArray * delayed_properties;
80};78};
8179
82typedef struct _newItemPropData newItemPropData;80typedef struct _newItemPropData newItemPropData;
@@ -87,21 +85,6 @@
87 DbusmenuMenuitem * parent;85 DbusmenuMenuitem * parent;
88};86};
8987
90typedef struct _propertyDelay propertyDelay;
91struct _propertyDelay
92{
93 guint revision;
94 GArray * entries;
95};
96
97typedef struct _propertyDelayValue propertyDelayValue;
98struct _propertyDelayValue
99{
100 gint id;
101 gchar * name;
102 GValue value;
103};
104
105#define DBUSMENU_CLIENT_GET_PRIVATE(o) \88#define DBUSMENU_CLIENT_GET_PRIVATE(o) \
106(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_CLIENT, DbusmenuClientPrivate))89(G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_CLIENT, DbusmenuClientPrivate))
10790
@@ -225,8 +208,6 @@
225 priv->type_handlers = g_hash_table_new_full(g_str_hash, g_str_equal,208 priv->type_handlers = g_hash_table_new_full(g_str_hash, g_str_equal,
226 g_free, NULL);209 g_free, NULL);
227210
228 priv->delayed_properties = g_array_new(FALSE, TRUE, sizeof(propertyDelay));
229
230 return;211 return;
231}212}
232213
@@ -274,23 +255,6 @@
274 g_hash_table_destroy(priv->type_handlers);255 g_hash_table_destroy(priv->type_handlers);
275 }256 }
276257
277 if (priv->delayed_properties) {
278 gint i;
279 for (i = 0; i < priv->delayed_properties->len; i++) {
280 propertyDelay * delay = &g_array_index(priv->delayed_properties, propertyDelay, i);
281 gint j;
282 for (j = 0; j < delay->entries->len; j++) {
283 propertyDelayValue * value = &g_array_index(delay->entries, propertyDelayValue, j);
284 g_free(value->name);
285 g_value_unset(&value->value);
286 }
287 g_array_free(delay->entries, TRUE);
288 delay->entries = NULL;
289 }
290 g_array_free(priv->delayed_properties, TRUE);
291 priv->delayed_properties = NULL;
292 }
293
294 G_OBJECT_CLASS (dbusmenu_client_parent_class)->finalize (object);258 G_OBJECT_CLASS (dbusmenu_client_parent_class)->finalize (object);
295 return;259 return;
296}260}
@@ -355,49 +319,6 @@
355 return;319 return;
356}320}
357321
358/* Add an entry to the set of entries that are delayed until the
359 layout has been updated to this revision */
360static void
361delay_prop_update (guint revision, GArray * delayarray, gint id, gchar * prop, GValue * value)
362{
363 propertyDelay * delay = NULL;
364 gint i;
365
366 /* First look for something with this revision number. This
367 array should be really short, probably not more than an entry or
368 two so there is no reason to optimize this. */
369 for (i = 0; i < delayarray->len; i++) {
370 propertyDelay * localdelay = &g_array_index(delayarray, propertyDelay, i);
371 if (localdelay->revision == revision) {
372 delay = localdelay;
373 break;
374 }
375 }
376
377 /* If we don't have any entires for this revision number then we
378 need to create a new one with it's own array of entires. */
379 if (delay == NULL) {
380 propertyDelay localdelay = {0};
381 localdelay.revision = revision;
382 localdelay.entries = g_array_new(FALSE, TRUE, sizeof(propertyDelayValue));
383
384 g_array_append_val(delayarray, localdelay);
385 delay = &g_array_index(delayarray, propertyDelay, delayarray->len - 1);
386 }
387
388 /* Build the actual entry and tack it on the end of the array
389 of entries */
390 propertyDelayValue delayvalue = {0};
391 delayvalue.id = id;
392 delayvalue.name = g_strdup(prop);
393
394 g_value_init(&delayvalue.value, G_VALUE_TYPE(value));
395 g_value_copy(value, &delayvalue.value);
396
397 g_array_append_val(delay->entries, delayvalue);
398 return;
399}
400
401/* Signal from the server that a property has changed322/* Signal from the server that a property has changed
402 on one of our menuitems */323 on one of our menuitems */
403static void324static void
@@ -413,15 +334,7 @@
413334
414 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);335 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
415336
416 /* If we're not on the right revision, we need to cache the property337 g_return_if_fail(priv->root != NULL);
417 changes as it could be that the menuitems don't exist yet. */
418 if (priv->root == NULL || priv->my_revision != priv->current_revision) {
419 #ifdef MASSIVEDEBUGGING
420 g_debug("Delaying prop update until rev %d for id %d property %s", priv->current_revision, id, property);
421 #endif
422 delay_prop_update(priv->current_revision, priv->delayed_properties, id, property, value);
423 return;
424 }
425338
426 DbusmenuMenuitem * menuitem = dbusmenu_menuitem_find_id(priv->root, id);339 DbusmenuMenuitem * menuitem = dbusmenu_menuitem_find_id(priv->root, id);
427 g_return_if_fail(menuitem != NULL);340 g_return_if_fail(menuitem != NULL);
@@ -898,19 +811,16 @@
898 DbusmenuClient * client = DBUSMENU_CLIENT(data);811 DbusmenuClient * client = DBUSMENU_CLIENT(data);
899 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);812 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
900813
901 /* Check to make sure this isn't an issue */
902 if (error != NULL) {814 if (error != NULL) {
903 g_warning("Getting layout failed on client %s object %s: %s", priv->dbus_name, priv->dbus_object, error->message);815 g_warning("Getting layout failed on client %s object %s: %s", priv->dbus_name, priv->dbus_object, error->message);
904 return;816 return;
905 }817 }
906818
907 /* Try to take in the layout that we got */
908 if (!parse_layout(client, xml)) {819 if (!parse_layout(client, xml)) {
909 g_warning("Unable to parse layout!");820 g_warning("Unable to parse layout!");
910 return;821 return;
911 }822 }
912823
913 /* Success, so we need to update our local variables */
914 priv->my_revision = rev;824 priv->my_revision = rev;
915 /* g_debug("Root is now: 0x%X", (unsigned int)priv->root); */825 /* g_debug("Root is now: 0x%X", (unsigned int)priv->root); */
916 priv->layoutcall = NULL;826 priv->layoutcall = NULL;
@@ -919,42 +829,6 @@
919 #endif 829 #endif
920 g_signal_emit(G_OBJECT(client), signals[LAYOUT_UPDATED], 0, TRUE);830 g_signal_emit(G_OBJECT(client), signals[LAYOUT_UPDATED], 0, TRUE);
921831
922 /* Apply the delayed properties that were queued up while
923 we were waiting on this layout update. */
924 if (G_LIKELY(priv->delayed_properties != NULL)) {
925 gint i;
926 for (i = 0; i < priv->delayed_properties->len; i++) {
927 propertyDelay * delay = &g_array_index(priv->delayed_properties, propertyDelay, i);
928 if (delay->revision > priv->my_revision) {
929 /* Check to see if this is for future revisions, which
930 is possible if there is a ton of updates. */
931 break;
932 }
933
934 gint j;
935 for (j = 0; j < delay->entries->len; j++) {
936 propertyDelayValue * value = &g_array_index(delay->entries, propertyDelayValue, j);
937 DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, value->id);
938 if (mi != NULL) {
939 #ifdef MASSIVEDEBUGGING
940 g_debug("Applying delayed property id %d property %s", value->id, value->name);
941 #endif
942 dbusmenu_menuitem_property_set_value(mi, value->name, &value->value);
943 }
944 g_free(value->name);
945 g_value_unset(&value->value);
946 }
947 g_array_free(delay->entries, TRUE);
948
949 /* We're removing the entry and moving the index down one
950 to ensure that we adjust for the shift in the array. The
951 reality is that i is always 0. You understood this loop
952 until you got here, didn't you :) */
953 g_array_remove_index(priv->delayed_properties, i);
954 i--;
955 }
956 }
957
958 /* Check to see if we got another update in the time this832 /* Check to see if we got another update in the time this
959 one was issued. */833 one was issued. */
960 if (priv->my_revision < priv->current_revision) {834 if (priv->my_revision < priv->current_revision) {
961835
=== modified file 'tests/test-glib-proxy-client.c'
--- tests/test-glib-proxy-client.c 2010-02-13 03:43:28 +0000
+++ tests/test-glib-proxy-client.c 2010-02-25 17:00:34 +0000
@@ -26,10 +26,11 @@
2626
27#include "test-glib-proxy.h"27#include "test-glib-proxy.h"
2828
29static guint layouton = -1;29static guint layouton = -2;
30static GMainLoop * mainloop = NULL;30static GMainLoop * mainloop = NULL;
31static gboolean passed = TRUE;31static gboolean passed = TRUE;
32static guint death_timer = 0;32static guint death_timer = 0;
33static guint verify_timer = 0;
3334
34static gboolean35static gboolean
35verify_props (DbusmenuMenuitem * mi, gchar ** properties)36verify_props (DbusmenuMenuitem * mi, gchar ** properties)
@@ -118,16 +119,22 @@
118 g_debug("\tIgnored, no root");119 g_debug("\tIgnored, no root");
119 return;120 return;
120 }121 }
121 layouton++;122 if (verify_timer != 0) {
122 g_timeout_add (1500, layout_verify_timer, client);123 g_source_remove(verify_timer);
124 }
125
126 verify_timer = g_timeout_add (3000, layout_verify_timer, client);
123 return;127 return;
124}128}
125129
126static gboolean130static gboolean
127layout_verify_timer (gpointer data)131layout_verify_timer (gpointer data)
128{132{
133 DbusmenuMenuitem * menuroot = dbusmenu_client_get_root(DBUSMENU_CLIENT(data));
134 layouton = dbusmenu_menuitem_property_get_int(menuroot, LAYOUT_ON);
135
129 g_debug("Verifing Layout: %d", layouton);136 g_debug("Verifing Layout: %d", layouton);
130 DbusmenuMenuitem * menuroot = dbusmenu_client_get_root(DBUSMENU_CLIENT(data));137 verify_timer = 0;
131 proplayout_t * layout = &layouts[layouton];138 proplayout_t * layout = &layouts[layouton];
132 139
133 if (!verify_root_to_layout(menuroot, layout)) {140 if (!verify_root_to_layout(menuroot, layout)) {
@@ -136,13 +143,18 @@
136 } else {143 } else {
137 /* Extend our death */144 /* Extend our death */
138 g_source_remove(death_timer);145 g_source_remove(death_timer);
139 death_timer = g_timeout_add_seconds(10, timer_func, data);146 death_timer = g_timeout_add_seconds(4, timer_func, data);
140 }147 }
141148
142 if (layouts[layouton+1].id == -1) {149 if (layouts[layouton+1].id == -1) {
143 g_main_loop_quit(mainloop);150 g_main_loop_quit(mainloop);
144 }151 }
145152
153 GValue value = {0};
154 g_value_init(&value, G_TYPE_INT);
155 g_value_set_int(&value, 0);
156 dbusmenu_menuitem_handle_event(menuroot, "clicked", &value, layouton);
157
146 return FALSE;158 return FALSE;
147}159}
148160
@@ -154,7 +166,7 @@
154 DbusmenuClient * client = dbusmenu_client_new("test.proxy.first_proxy", "/org/test");166 DbusmenuClient * client = dbusmenu_client_new("test.proxy.first_proxy", "/org/test");
155 g_signal_connect(G_OBJECT(client), DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED, G_CALLBACK(layout_updated), NULL);167 g_signal_connect(G_OBJECT(client), DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED, G_CALLBACK(layout_updated), NULL);
156168
157 death_timer = g_timeout_add_seconds(10, timer_func, client);169 death_timer = g_timeout_add_seconds(4, timer_func, client);
158170
159 mainloop = g_main_loop_new(NULL, FALSE);171 mainloop = g_main_loop_new(NULL, FALSE);
160 g_main_loop_run(mainloop);172 g_main_loop_run(mainloop);
161173
=== modified file 'tests/test-glib-proxy-server.c'
--- tests/test-glib-proxy-server.c 2010-02-12 22:45:52 +0000
+++ tests/test-glib-proxy-server.c 2010-02-25 17:00:34 +0000
@@ -69,22 +69,39 @@
69static guint layouton = 0;69static guint layouton = 0;
70static DbusmenuServer * server = NULL;70static DbusmenuServer * server = NULL;
71static GMainLoop * mainloop = NULL;71static GMainLoop * mainloop = NULL;
72static guint death_timer = 0;
7273
73static gboolean74static gboolean
74timer_func (gpointer data)75timer_func (gpointer data)
75{76{
77 g_debug("Death timer. Oops. Got to: %d", layouton);
78 g_main_loop_quit(mainloop);
79 return FALSE;
80}
81
82static void
83layout_change (DbusmenuMenuitem * oldroot, guint timestamp, gpointer data)
84{
76 if (layouts[layouton].id == -1) {85 if (layouts[layouton].id == -1) {
77 g_main_loop_quit(mainloop);86 g_main_loop_quit(mainloop);
78 return FALSE;87 return;
79 }88 }
80 g_debug("Updating to Layout %d", layouton);89 g_debug("Updating to Layout %d", layouton);
8190
82 DbusmenuMenuitem * mi = layout2menuitem(&layouts[layouton]);91 DbusmenuMenuitem * mi = layout2menuitem(&layouts[layouton]);
92 g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(layout_change), NULL);
93 dbusmenu_menuitem_property_set_int(mi, LAYOUT_ON, layouton);
83 dbusmenu_server_set_root(server, mi);94 dbusmenu_server_set_root(server, mi);
84 g_object_unref(G_OBJECT(mi));95 g_object_unref(G_OBJECT(mi));
85 layouton++;96 layouton++;
8697
87 return TRUE;98 /* Extend our death */
99 if (death_timer != 0) {
100 g_source_remove(death_timer);
101 }
102 death_timer = g_timeout_add_seconds(4, timer_func, data);
103
104 return;
88}105}
89106
90int107int
@@ -111,9 +128,7 @@
111 }128 }
112129
113 server = dbusmenu_server_new("/org/test");130 server = dbusmenu_server_new("/org/test");
114131 layout_change(NULL, 0, NULL);
115 timer_func(NULL);
116 g_timeout_add(2500, timer_func, NULL);
117132
118 mainloop = g_main_loop_new(NULL, FALSE);133 mainloop = g_main_loop_new(NULL, FALSE);
119 g_main_loop_run(mainloop);134 g_main_loop_run(mainloop);
120135
=== modified file 'tests/test-glib-proxy.h'
--- tests/test-glib-proxy.h 2010-02-13 06:41:53 +0000
+++ tests/test-glib-proxy.h 2010-02-25 17:00:34 +0000
@@ -22,6 +22,8 @@
2222
23#include <glib.h>23#include <glib.h>
2424
25#define LAYOUT_ON "proxy-layout-on"
26
25typedef struct _proplayout_t proplayout_t;27typedef struct _proplayout_t proplayout_t;
26struct _proplayout_t {28struct _proplayout_t {
27 gint id;29 gint id;
@@ -132,7 +134,7 @@
132};134};
133135
134proplayout_t layouts[] = {136proplayout_t layouts[] = {
135 {id: 1, properties: props1, submenu: NULL},137 {id: 1, properties: props1, submenu: submenu_5_5},
136 {id: 10, properties: props2, submenu: submenu_4_1},138 {id: 10, properties: props2, submenu: submenu_4_1},
137 {id: 20, properties: props3, submenu: submenu_4_2},139 {id: 20, properties: props3, submenu: submenu_4_2},
138 {id: 100, properties: props2, submenu: submenu_4_0},140 {id: 100, properties: props2, submenu: submenu_4_0},

Subscribers

People subscribed via source and target branches

to all changes: