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
1=== modified file 'configure.ac'
2--- configure.ac 2010-02-18 16:54:54 +0000
3+++ configure.ac 2010-02-25 17:00:34 +0000
4@@ -1,11 +1,11 @@
5
6-AC_INIT(libdbusmenu, 0.2.5, ted@canonical.com)
7+AC_INIT(libdbusmenu, 0.2.6, ted@canonical.com)
8 AC_COPYRIGHT([Copyright 2009,2010 Canonical])
9
10 AC_PREREQ(2.53)
11
12 AM_CONFIG_HEADER(config.h)
13-AM_INIT_AUTOMAKE(libdbusmenu, 0.2.5)
14+AM_INIT_AUTOMAKE(libdbusmenu, 0.2.6)
15
16 AM_MAINTAINER_MODE
17
18@@ -66,7 +66,7 @@
19 ###########################
20
21 LIBDBUSMENU_CURRENT=1
22-LIBDBUSMENU_REVISION=3
23+LIBDBUSMENU_REVISION=4
24 LIBDBUSMENU_AGE=0
25
26 AC_SUBST(LIBDBUSMENU_CURRENT)
27
28=== modified file 'debian/changelog'
29--- debian/changelog 2010-02-18 17:18:30 +0000
30+++ debian/changelog 2010-02-25 17:00:34 +0000
31@@ -1,3 +1,12 @@
32+libdbusmenu (0.2.6-0ubuntu1~ppa1) lucid; urgency=low
33+
34+ * Upstream release 0.2.6
35+ * Fix testing to make it more reliable
36+ * Remove delayed property queueing as it was causing
37+ properties to not get updated.
38+
39+ -- Ted Gould <ted@ubuntu.com> Thu, 25 Feb 2010 10:23:49 -0600
40+
41 libdbusmenu (0.2.5-0ubuntu1) lucid; urgency=low
42
43 * Upstream release 0.2.5
44
45=== modified file 'libdbusmenu-glib/client.c'
46--- libdbusmenu-glib/client.c 2010-02-18 16:50:00 +0000
47+++ libdbusmenu-glib/client.c 2010-02-25 17:00:34 +0000
48@@ -75,8 +75,6 @@
49 DBusGProxy * dbusproxy;
50
51 GHashTable * type_handlers;
52-
53- GArray * delayed_properties;
54 };
55
56 typedef struct _newItemPropData newItemPropData;
57@@ -87,21 +85,6 @@
58 DbusmenuMenuitem * parent;
59 };
60
61-typedef struct _propertyDelay propertyDelay;
62-struct _propertyDelay
63-{
64- guint revision;
65- GArray * entries;
66-};
67-
68-typedef struct _propertyDelayValue propertyDelayValue;
69-struct _propertyDelayValue
70-{
71- gint id;
72- gchar * name;
73- GValue value;
74-};
75-
76 #define DBUSMENU_CLIENT_GET_PRIVATE(o) \
77 (G_TYPE_INSTANCE_GET_PRIVATE ((o), DBUSMENU_TYPE_CLIENT, DbusmenuClientPrivate))
78
79@@ -225,8 +208,6 @@
80 priv->type_handlers = g_hash_table_new_full(g_str_hash, g_str_equal,
81 g_free, NULL);
82
83- priv->delayed_properties = g_array_new(FALSE, TRUE, sizeof(propertyDelay));
84-
85 return;
86 }
87
88@@ -274,23 +255,6 @@
89 g_hash_table_destroy(priv->type_handlers);
90 }
91
92- if (priv->delayed_properties) {
93- gint i;
94- for (i = 0; i < priv->delayed_properties->len; i++) {
95- propertyDelay * delay = &g_array_index(priv->delayed_properties, propertyDelay, i);
96- gint j;
97- for (j = 0; j < delay->entries->len; j++) {
98- propertyDelayValue * value = &g_array_index(delay->entries, propertyDelayValue, j);
99- g_free(value->name);
100- g_value_unset(&value->value);
101- }
102- g_array_free(delay->entries, TRUE);
103- delay->entries = NULL;
104- }
105- g_array_free(priv->delayed_properties, TRUE);
106- priv->delayed_properties = NULL;
107- }
108-
109 G_OBJECT_CLASS (dbusmenu_client_parent_class)->finalize (object);
110 return;
111 }
112@@ -355,49 +319,6 @@
113 return;
114 }
115
116-/* Add an entry to the set of entries that are delayed until the
117- layout has been updated to this revision */
118-static void
119-delay_prop_update (guint revision, GArray * delayarray, gint id, gchar * prop, GValue * value)
120-{
121- propertyDelay * delay = NULL;
122- gint i;
123-
124- /* First look for something with this revision number. This
125- array should be really short, probably not more than an entry or
126- two so there is no reason to optimize this. */
127- for (i = 0; i < delayarray->len; i++) {
128- propertyDelay * localdelay = &g_array_index(delayarray, propertyDelay, i);
129- if (localdelay->revision == revision) {
130- delay = localdelay;
131- break;
132- }
133- }
134-
135- /* If we don't have any entires for this revision number then we
136- need to create a new one with it's own array of entires. */
137- if (delay == NULL) {
138- propertyDelay localdelay = {0};
139- localdelay.revision = revision;
140- localdelay.entries = g_array_new(FALSE, TRUE, sizeof(propertyDelayValue));
141-
142- g_array_append_val(delayarray, localdelay);
143- delay = &g_array_index(delayarray, propertyDelay, delayarray->len - 1);
144- }
145-
146- /* Build the actual entry and tack it on the end of the array
147- of entries */
148- propertyDelayValue delayvalue = {0};
149- delayvalue.id = id;
150- delayvalue.name = g_strdup(prop);
151-
152- g_value_init(&delayvalue.value, G_VALUE_TYPE(value));
153- g_value_copy(value, &delayvalue.value);
154-
155- g_array_append_val(delay->entries, delayvalue);
156- return;
157-}
158-
159 /* Signal from the server that a property has changed
160 on one of our menuitems */
161 static void
162@@ -413,15 +334,7 @@
163
164 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
165
166- /* If we're not on the right revision, we need to cache the property
167- changes as it could be that the menuitems don't exist yet. */
168- if (priv->root == NULL || priv->my_revision != priv->current_revision) {
169- #ifdef MASSIVEDEBUGGING
170- g_debug("Delaying prop update until rev %d for id %d property %s", priv->current_revision, id, property);
171- #endif
172- delay_prop_update(priv->current_revision, priv->delayed_properties, id, property, value);
173- return;
174- }
175+ g_return_if_fail(priv->root != NULL);
176
177 DbusmenuMenuitem * menuitem = dbusmenu_menuitem_find_id(priv->root, id);
178 g_return_if_fail(menuitem != NULL);
179@@ -898,19 +811,16 @@
180 DbusmenuClient * client = DBUSMENU_CLIENT(data);
181 DbusmenuClientPrivate * priv = DBUSMENU_CLIENT_GET_PRIVATE(client);
182
183- /* Check to make sure this isn't an issue */
184 if (error != NULL) {
185 g_warning("Getting layout failed on client %s object %s: %s", priv->dbus_name, priv->dbus_object, error->message);
186 return;
187 }
188
189- /* Try to take in the layout that we got */
190 if (!parse_layout(client, xml)) {
191 g_warning("Unable to parse layout!");
192 return;
193 }
194
195- /* Success, so we need to update our local variables */
196 priv->my_revision = rev;
197 /* g_debug("Root is now: 0x%X", (unsigned int)priv->root); */
198 priv->layoutcall = NULL;
199@@ -919,42 +829,6 @@
200 #endif
201 g_signal_emit(G_OBJECT(client), signals[LAYOUT_UPDATED], 0, TRUE);
202
203- /* Apply the delayed properties that were queued up while
204- we were waiting on this layout update. */
205- if (G_LIKELY(priv->delayed_properties != NULL)) {
206- gint i;
207- for (i = 0; i < priv->delayed_properties->len; i++) {
208- propertyDelay * delay = &g_array_index(priv->delayed_properties, propertyDelay, i);
209- if (delay->revision > priv->my_revision) {
210- /* Check to see if this is for future revisions, which
211- is possible if there is a ton of updates. */
212- break;
213- }
214-
215- gint j;
216- for (j = 0; j < delay->entries->len; j++) {
217- propertyDelayValue * value = &g_array_index(delay->entries, propertyDelayValue, j);
218- DbusmenuMenuitem * mi = dbusmenu_menuitem_find_id(priv->root, value->id);
219- if (mi != NULL) {
220- #ifdef MASSIVEDEBUGGING
221- g_debug("Applying delayed property id %d property %s", value->id, value->name);
222- #endif
223- dbusmenu_menuitem_property_set_value(mi, value->name, &value->value);
224- }
225- g_free(value->name);
226- g_value_unset(&value->value);
227- }
228- g_array_free(delay->entries, TRUE);
229-
230- /* We're removing the entry and moving the index down one
231- to ensure that we adjust for the shift in the array. The
232- reality is that i is always 0. You understood this loop
233- until you got here, didn't you :) */
234- g_array_remove_index(priv->delayed_properties, i);
235- i--;
236- }
237- }
238-
239 /* Check to see if we got another update in the time this
240 one was issued. */
241 if (priv->my_revision < priv->current_revision) {
242
243=== modified file 'tests/test-glib-proxy-client.c'
244--- tests/test-glib-proxy-client.c 2010-02-13 03:43:28 +0000
245+++ tests/test-glib-proxy-client.c 2010-02-25 17:00:34 +0000
246@@ -26,10 +26,11 @@
247
248 #include "test-glib-proxy.h"
249
250-static guint layouton = -1;
251+static guint layouton = -2;
252 static GMainLoop * mainloop = NULL;
253 static gboolean passed = TRUE;
254 static guint death_timer = 0;
255+static guint verify_timer = 0;
256
257 static gboolean
258 verify_props (DbusmenuMenuitem * mi, gchar ** properties)
259@@ -118,16 +119,22 @@
260 g_debug("\tIgnored, no root");
261 return;
262 }
263- layouton++;
264- g_timeout_add (1500, layout_verify_timer, client);
265+ if (verify_timer != 0) {
266+ g_source_remove(verify_timer);
267+ }
268+
269+ verify_timer = g_timeout_add (3000, layout_verify_timer, client);
270 return;
271 }
272
273 static gboolean
274 layout_verify_timer (gpointer data)
275 {
276+ DbusmenuMenuitem * menuroot = dbusmenu_client_get_root(DBUSMENU_CLIENT(data));
277+ layouton = dbusmenu_menuitem_property_get_int(menuroot, LAYOUT_ON);
278+
279 g_debug("Verifing Layout: %d", layouton);
280- DbusmenuMenuitem * menuroot = dbusmenu_client_get_root(DBUSMENU_CLIENT(data));
281+ verify_timer = 0;
282 proplayout_t * layout = &layouts[layouton];
283
284 if (!verify_root_to_layout(menuroot, layout)) {
285@@ -136,13 +143,18 @@
286 } else {
287 /* Extend our death */
288 g_source_remove(death_timer);
289- death_timer = g_timeout_add_seconds(10, timer_func, data);
290+ death_timer = g_timeout_add_seconds(4, timer_func, data);
291 }
292
293 if (layouts[layouton+1].id == -1) {
294 g_main_loop_quit(mainloop);
295 }
296
297+ GValue value = {0};
298+ g_value_init(&value, G_TYPE_INT);
299+ g_value_set_int(&value, 0);
300+ dbusmenu_menuitem_handle_event(menuroot, "clicked", &value, layouton);
301+
302 return FALSE;
303 }
304
305@@ -154,7 +166,7 @@
306 DbusmenuClient * client = dbusmenu_client_new("test.proxy.first_proxy", "/org/test");
307 g_signal_connect(G_OBJECT(client), DBUSMENU_CLIENT_SIGNAL_LAYOUT_UPDATED, G_CALLBACK(layout_updated), NULL);
308
309- death_timer = g_timeout_add_seconds(10, timer_func, client);
310+ death_timer = g_timeout_add_seconds(4, timer_func, client);
311
312 mainloop = g_main_loop_new(NULL, FALSE);
313 g_main_loop_run(mainloop);
314
315=== modified file 'tests/test-glib-proxy-server.c'
316--- tests/test-glib-proxy-server.c 2010-02-12 22:45:52 +0000
317+++ tests/test-glib-proxy-server.c 2010-02-25 17:00:34 +0000
318@@ -69,22 +69,39 @@
319 static guint layouton = 0;
320 static DbusmenuServer * server = NULL;
321 static GMainLoop * mainloop = NULL;
322+static guint death_timer = 0;
323
324 static gboolean
325 timer_func (gpointer data)
326 {
327+ g_debug("Death timer. Oops. Got to: %d", layouton);
328+ g_main_loop_quit(mainloop);
329+ return FALSE;
330+}
331+
332+static void
333+layout_change (DbusmenuMenuitem * oldroot, guint timestamp, gpointer data)
334+{
335 if (layouts[layouton].id == -1) {
336 g_main_loop_quit(mainloop);
337- return FALSE;
338+ return;
339 }
340 g_debug("Updating to Layout %d", layouton);
341
342 DbusmenuMenuitem * mi = layout2menuitem(&layouts[layouton]);
343+ g_signal_connect(G_OBJECT(mi), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(layout_change), NULL);
344+ dbusmenu_menuitem_property_set_int(mi, LAYOUT_ON, layouton);
345 dbusmenu_server_set_root(server, mi);
346 g_object_unref(G_OBJECT(mi));
347 layouton++;
348
349- return TRUE;
350+ /* Extend our death */
351+ if (death_timer != 0) {
352+ g_source_remove(death_timer);
353+ }
354+ death_timer = g_timeout_add_seconds(4, timer_func, data);
355+
356+ return;
357 }
358
359 int
360@@ -111,9 +128,7 @@
361 }
362
363 server = dbusmenu_server_new("/org/test");
364-
365- timer_func(NULL);
366- g_timeout_add(2500, timer_func, NULL);
367+ layout_change(NULL, 0, NULL);
368
369 mainloop = g_main_loop_new(NULL, FALSE);
370 g_main_loop_run(mainloop);
371
372=== modified file 'tests/test-glib-proxy.h'
373--- tests/test-glib-proxy.h 2010-02-13 06:41:53 +0000
374+++ tests/test-glib-proxy.h 2010-02-25 17:00:34 +0000
375@@ -22,6 +22,8 @@
376
377 #include <glib.h>
378
379+#define LAYOUT_ON "proxy-layout-on"
380+
381 typedef struct _proplayout_t proplayout_t;
382 struct _proplayout_t {
383 gint id;
384@@ -132,7 +134,7 @@
385 };
386
387 proplayout_t layouts[] = {
388- {id: 1, properties: props1, submenu: NULL},
389+ {id: 1, properties: props1, submenu: submenu_5_5},
390 {id: 10, properties: props2, submenu: submenu_4_1},
391 {id: 20, properties: props3, submenu: submenu_4_2},
392 {id: 100, properties: props2, submenu: submenu_4_0},

Subscribers

People subscribed via source and target branches

to all changes: