Merge lp:~mitya57/libappindicator/test-simple-app into lp:libappindicator/15.10

Proposed by Dmitry Shachnev
Status: Superseded
Proposed branch: lp:~mitya57/libappindicator/test-simple-app
Merge into: lp:libappindicator/15.10
Diff against target: 48 lines (+12/-12)
1 file modified
tests/test-simple-app.c (+12/-12)
To merge this branch: bzr merge lp:~mitya57/libappindicator/test-simple-app
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
Alberts Muktupāvels Approve
Review via email: mp+263186@code.launchpad.net

This proposal has been superseded by a proposal from 2016-09-05.

Description of the change

The previous version of the simple test application was crashing with SIGSEGV in g_object_new call. This one seems to actually work.

To post a comment you must log in.
Revision history for this message
Alberts Muktupāvels (muktupavels) wrote :

I probably would use gtk_menu_shell_append not gtk_menu_attach, but that should not be problem.

Code looks good, but I did not test it.

review: Approve
274. By Dmitry Shachnev

Make test-simple-app really working

Revision history for this message
Dmitry Shachnev (mitya57) wrote :

gtk_menu_shell_append is of course better, updated

Revision history for this message
Ted Gould (ted) :
review: Approve

Unmerged revisions

274. By Dmitry Shachnev

Make test-simple-app really working

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'tests/test-simple-app.c'
2--- tests/test-simple-app.c 2013-01-16 19:53:52 +0000
3+++ tests/test-simple-app.c 2015-06-28 19:27:57 +0000
4@@ -20,10 +20,7 @@
5 */
6
7
8-#include <dbus/dbus-glib.h>
9-#include <dbus/dbus-glib-lowlevel.h>
10 #include <glib.h>
11-#include <libdbusmenu-glib/server.h>
12 #include <app-indicator.h>
13
14 static GMainLoop * mainloop = NULL;
15@@ -31,21 +28,24 @@
16 int
17 main (int argc, char ** argv)
18 {
19- DbusmenuServer * dms = dbusmenu_server_new("/menu");
20- DbusmenuMenuitem * dmi = dbusmenu_menuitem_new();
21- dbusmenu_menuitem_property_set(dmi, "label", "Bob");
22+ gtk_init(&argc, &argv);
23+ GtkWidget *menu_item = gtk_menu_item_new_with_label("Test");
24+ GtkMenu *menu = GTK_MENU(gtk_menu_new());
25+ gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
26+ gtk_widget_show(menu_item);
27
28- AppIndicator * ci = APP_INDICATOR(g_object_new(APP_INDICATOR_TYPE,
29- "id", "test-application",
30- "status-enum", APP_INDICATOR_STATUS_ACTIVE,
31- "icon-name", "system-shutdown",
32- "menu-object", dms,
33- NULL));
34+ AppIndicator * ci = app_indicator_new("test-application",
35+ "system-shutdown",
36+ APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
37+ app_indicator_set_status(ci, APP_INDICATOR_STATUS_ACTIVE);
38+ app_indicator_set_menu(ci, menu);
39
40 mainloop = g_main_loop_new(NULL, FALSE);
41 g_main_loop_run(mainloop);
42
43 g_object_unref(G_OBJECT(ci));
44+ g_object_unref(G_OBJECT(menu));
45+ g_object_unref(G_OBJECT(menu_item));
46 g_debug("Quiting");
47
48 return 0;

Subscribers

People subscribed via source and target branches