Merge lp:~khurshid-alam/indicator-appmenu/fix-build-disco into lp:indicator-appmenu

Proposed by Khurshid Alam
Status: Merged
Approved by: Marco Trevisan (Treviño)
Approved revision: 282
Merged at revision: 285
Proposed branch: lp:~khurshid-alam/indicator-appmenu/fix-build-disco
Merge into: lp:indicator-appmenu
Diff against target: 42 lines (+4/-4)
2 files modified
src/window-menu-dbusmenu.c (+2/-2)
src/window-menu-model.c (+2/-2)
To merge this branch: bzr merge lp:~khurshid-alam/indicator-appmenu/fix-build-disco
Reviewer Review Type Date Requested Status
Marco Trevisan (Treviño) Approve
Review via email: mp+361403@code.launchpad.net

Commit message

src/window-menu-*.c: Type cast assignments from g_object_ref().

Description of the change

Note it fixes type cast errors, and doesn't fix ‘g_type_class_add_private’ is deprecated warnings. But it compiles on disco.

To post a comment you must log in.
Revision history for this message
Marco Trevisan (Treviño) (3v1n0) wrote :

I would prefer to use G_DBUS_MENU_MODEL(), while it might imply an uneeded check, is a bit more readable.

Anyway this is fine per se.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/window-menu-dbusmenu.c'
2--- src/window-menu-dbusmenu.c 2015-06-01 17:44:45 +0000
3+++ src/window-menu-dbusmenu.c 2019-01-06 12:34:25 +0000
4@@ -617,14 +617,14 @@
5 if (children != NULL) {
6 gpointer * data = g_new(gpointer, 2);
7 data[0] = user_data;
8- data[1] = g_object_ref(newentry);
9+ data[1] = (DbusmenuMenuitem*)g_object_ref(newentry);
10
11 g_signal_connect_data(G_OBJECT(children->data), DBUSMENU_MENUITEM_SIGNAL_REALIZED, G_CALLBACK(menu_child_realized), data, child_realized_data_cleanup, 0);
12 } else {
13 /* Menu entry has no children */
14 gpointer * data = g_new(gpointer, 2);
15 data[0] = user_data;
16- data[1] = g_object_ref(newentry);
17+ data[1] = (DbusmenuMenuitem*)g_object_ref(newentry);;
18
19 /* Make sure the menu item gets displayed on the menu bar */
20 menu_child_realized(NULL, data);
21
22=== modified file 'src/window-menu-model.c'
23--- src/window-menu-model.c 2015-06-01 17:44:45 +0000
24+++ src/window-menu-model.c 2019-01-06 12:34:25 +0000
25@@ -146,7 +146,7 @@
26 {
27 g_return_if_fail(G_IS_MENU_MODEL(model));
28
29- menu->priv->app_menu_model = g_object_ref(model);
30+ menu->priv->app_menu_model = (GDBusMenuModel*)g_object_ref(model);
31 menu->priv->application_menu.parent_window = menu->priv->xid;
32
33 if (appname != NULL) {
34@@ -398,7 +398,7 @@
35 static void
36 add_window_menu (WindowMenuModel * menu, GMenuModel * model)
37 {
38- menu->priv->win_menu_model = g_object_ref(model);
39+ menu->priv->win_menu_model = (GDBusMenuModel*)g_object_ref(model);
40
41 menu->priv->win_menu = GTK_MENU_BAR(gtk_menu_bar_new_from_model(model));
42 g_assert(menu->priv->win_menu != NULL);

Subscribers

People subscribed via source and target branches