Merge lp:~ken-vandine/indicator-me/dbusmenu-0.4 into lp:indicator-me

Proposed by Ken VanDine
Status: Merged
Merged at revision: 116
Proposed branch: lp:~ken-vandine/indicator-me/dbusmenu-0.4
Merge into: lp:indicator-me
Diff against target: 125 lines (+18/-21)
3 files modified
configure.ac (+4/-4)
src/entry-menu-item.c (+3/-4)
src/indicator-me.c (+11/-13)
To merge this branch: bzr merge lp:~ken-vandine/indicator-me/dbusmenu-0.4
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Ken VanDine Needs Resubmitting
Review via email: mp+45753@code.launchpad.net

Description of the change

 * ported to dbusmenu-glib-0.4
 * removed check for dbusmenu-gtk, it isn't used

To post a comment you must log in.
Revision history for this message
Ted Gould (ted) wrote :

You need to get the callback in indicator-me.c "entry_prop_change_cb" which still is based on a GValue.

review: Needs Fixing
Revision history for this message
Ted Gould (ted) wrote :

Oh, there is a "about_me_prop_change_cb" as well.

Revision history for this message
Ken VanDine (ken-vandine) wrote :

Ok, updated those as well

review: Needs Resubmitting
116. By Ken VanDine

Ported about_me_prop_change_cb and entry_prop_change_cb to dbusmenu-glib-0.4

Revision history for this message
Ted Gould (ted) wrote :

Cool!

review: Approve

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-09-22 12:07:52 +0000
3+++ configure.ac 2011-01-10 21:19:09 +0000
4@@ -30,8 +30,7 @@
5 GTK_REQUIRED_VERSION=2.12
6 INDICATOR_REQUIRED_VERSION=0.3.0
7 GWIBBER_REQUIRED_VERSION=0.0.4
8-DBUSMENUGTK_REQUIRED_VERSION=0.2.2
9-DBUSMENUGLIB_REQUIRED_VERSION=0.2.2
10+DBUSMENUGLIB_REQUIRED_VERSION=0.3.90
11 TELEPATHYGLIB_REQUIRED_VERSION=0.9.0
12 GCONF_REQUIRED_VERSION=2.0.0
13 INDICATOR_DISPLAY_OBJECTS=0.1
14@@ -39,8 +38,9 @@
15 PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION
16 indicator >= $INDICATOR_REQUIRED_VERSION
17 libido-0.1 >= $INDICATOR_DISPLAY_OBJECTS
18- dbusmenu-gtk >= $DBUSMENUGTK_REQUIRED_VERSION)
19-PKG_CHECK_MODULES(MESERVICE, dbusmenu-glib >= $DBUSMENUGLIB_REQUIRED_VERSION
20+ dbus-glib-1
21+ dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION)
22+PKG_CHECK_MODULES(MESERVICE, dbusmenu-glib-0.4 >= $DBUSMENUGLIB_REQUIRED_VERSION
23 gconf-2.0 >= $GCONF_REQUIRED_VERSION
24 indicator >= $INDICATOR_REQUIRED_VERSION
25 gwibber >= $GWIBBER_REQUIRED_VERSION
26
27=== modified file 'src/entry-menu-item.c'
28--- src/entry-menu-item.c 2010-08-14 04:40:14 +0000
29+++ src/entry-menu-item.c 2011-01-10 21:19:09 +0000
30@@ -55,8 +55,7 @@
31 static void entry_menu_item_init (EntryMenuItem *self);
32 static void entry_menu_item_dispose (GObject *object);
33 static void entry_menu_item_finalize (GObject *object);
34-static void handle_event (DbusmenuMenuitem *mi, const gchar *name,
35- const GValue *value, guint timestamp);
36+static void handle_event (DbusmenuMenuitem * mi, const gchar * name, GVariant * value, guint timestamp);
37
38 G_DEFINE_TYPE (EntryMenuItem, entry_menu_item, DBUSMENU_TYPE_MENUITEM);
39
40@@ -122,14 +121,14 @@
41 for the corresponding bottom-half service to act upon */
42 static void
43 handle_event (DbusmenuMenuitem *mi, const gchar *name,
44- const GValue *value, guint timestamp)
45+ GVariant *value, guint timestamp)
46 {
47 /* EntryMenuItemPrivate * priv = ENTRY_MENU_ITEM_GET_PRIVATE(self); */
48
49 g_debug ("handle_event");
50 if (g_strcmp0 (name, "send") == 0) {
51 MeGwibberService *me_gwibber_service = me_gwibber_service_get ();
52- me_gwibber_service_send (me_gwibber_service, g_value_get_string (value));
53+ me_gwibber_service_send (me_gwibber_service, g_variant_get_string (value, NULL));
54 dbusmenu_menuitem_property_set (mi, ENTRY_MENUITEM_PROP_TEXT, "");
55 }
56
57
58=== modified file 'src/indicator-me.c'
59--- src/indicator-me.c 2010-10-05 16:53:21 +0000
60+++ src/indicator-me.c 2011-01-10 21:19:09 +0000
61@@ -91,7 +91,7 @@
62 DbusmenuMenuitem * parent,
63 DbusmenuClient * client);
64 static void entry_activate_cb (GtkEntry *entry, DbusmenuMenuitem *mi);
65-static void entry_prop_change_cb (DbusmenuMenuitem *mi, gchar *prop, GValue *value, GtkEntry *entry);
66+static void entry_prop_change_cb (DbusmenuMenuitem *mi, gchar *prop, GVariant *value, GtkEntry *entry);
67 static gboolean entry_hint_is_shown (GtkWidget *widget);
68
69 G_DEFINE_TYPE (IndicatorMe, indicator_me, INDICATOR_OBJECT_TYPE);
70@@ -403,17 +403,17 @@
71 }
72
73 static void
74-entry_prop_change_cb (DbusmenuMenuitem *mi, gchar *prop, GValue *value, GtkEntry *entry)
75+entry_prop_change_cb (DbusmenuMenuitem *mi, gchar *prop, GVariant *value, GtkEntry *entry)
76 {
77 g_return_if_fail (GTK_IS_ENTRY (entry));
78
79 if (g_strcmp0 (prop, DBUSMENU_ENTRY_MENUITEM_PROP_TEXT) == 0) {
80- gtk_entry_set_text (entry, g_value_get_string (value));
81+ gtk_entry_set_text (entry, g_variant_get_string (value, NULL));
82 if (gtk_entry_get_text_length (entry) == 0)
83 entry_maybe_show_hint (entry);
84 }
85 if (g_strcmp0 (prop, DBUSMENU_ENTRY_MENUITEM_PROP_HINT) == 0) {
86- entry_set_hint (entry, g_value_get_string (value));
87+ entry_set_hint (entry, g_variant_get_string (value, NULL));
88 if (entry_hint_is_shown (GTK_WIDGET (entry)))
89 entry_maybe_show_hint (entry); /* visual update */
90 }
91@@ -425,13 +425,11 @@
92 g_return_if_fail (GTK_IS_ENTRY (entry));
93 g_return_if_fail (DBUSMENU_IS_MENUITEM (mi));
94
95- GValue value = { 0 };
96- g_value_init (&value, G_TYPE_STRING);
97- g_value_set_static_string (&value, gtk_entry_get_text (entry));
98-
99- g_debug ("user typed: %s", g_value_get_string (&value));
100-
101- dbusmenu_menuitem_handle_event (mi, "send", &value, gtk_get_current_event_time());
102+ GVariant * value = g_variant_new_string (gtk_entry_get_text (entry));
103+
104+ g_debug ("user typed: %s", g_variant_get_string (value, NULL));
105+
106+ dbusmenu_menuitem_handle_event (mi, "send", value, gtk_get_current_event_time());
107 }
108
109 static gboolean
110@@ -504,13 +502,13 @@
111 /* Whenever we have a property change on a DbusmenuMenuitem
112 we need to be responsive to that. */
113 static void
114-about_me_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GValue * value, AboutMeMenuItem *item)
115+about_me_prop_change_cb (DbusmenuMenuitem * mi, gchar * prop, GVariant * value, AboutMeMenuItem *item)
116 {
117 g_return_if_fail (ABOUT_IS_ME_MENU_ITEM (item));
118
119 if (!g_strcmp0(prop, DBUSMENU_ABOUT_ME_MENUITEM_PROP_ICON)) {
120 /* reload the avatar icon */
121- about_me_menu_item_load_avatar (item, g_value_get_string(value));
122+ about_me_menu_item_load_avatar (item, g_variant_get_string(value, NULL));
123 } else if (!g_strcmp0(prop, DBUSMENU_MENUITEM_PROP_VISIBLE)) {
124 /* normal, ignore */
125 } else {

Subscribers

People subscribed via source and target branches