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
=== modified file 'tests/test-simple-app.c'
--- tests/test-simple-app.c 2013-01-16 19:53:52 +0000
+++ tests/test-simple-app.c 2015-06-28 19:27:57 +0000
@@ -20,10 +20,7 @@
20*/20*/
2121
2222
23#include <dbus/dbus-glib.h>
24#include <dbus/dbus-glib-lowlevel.h>
25#include <glib.h>23#include <glib.h>
26#include <libdbusmenu-glib/server.h>
27#include <app-indicator.h>24#include <app-indicator.h>
2825
29static GMainLoop * mainloop = NULL;26static GMainLoop * mainloop = NULL;
@@ -31,21 +28,24 @@
31int28int
32main (int argc, char ** argv)29main (int argc, char ** argv)
33{30{
34 DbusmenuServer * dms = dbusmenu_server_new("/menu");31 gtk_init(&argc, &argv);
35 DbusmenuMenuitem * dmi = dbusmenu_menuitem_new();32 GtkWidget *menu_item = gtk_menu_item_new_with_label("Test");
36 dbusmenu_menuitem_property_set(dmi, "label", "Bob");33 GtkMenu *menu = GTK_MENU(gtk_menu_new());
34 gtk_menu_shell_append(GTK_MENU_SHELL(menu), menu_item);
35 gtk_widget_show(menu_item);
3736
38 AppIndicator * ci = APP_INDICATOR(g_object_new(APP_INDICATOR_TYPE, 37 AppIndicator * ci = app_indicator_new("test-application",
39 "id", "test-application",38 "system-shutdown",
40 "status-enum", APP_INDICATOR_STATUS_ACTIVE,39 APP_INDICATOR_CATEGORY_APPLICATION_STATUS);
41 "icon-name", "system-shutdown",40 app_indicator_set_status(ci, APP_INDICATOR_STATUS_ACTIVE);
42 "menu-object", dms,41 app_indicator_set_menu(ci, menu);
43 NULL));
4442
45 mainloop = g_main_loop_new(NULL, FALSE);43 mainloop = g_main_loop_new(NULL, FALSE);
46 g_main_loop_run(mainloop);44 g_main_loop_run(mainloop);
4745
48 g_object_unref(G_OBJECT(ci));46 g_object_unref(G_OBJECT(ci));
47 g_object_unref(G_OBJECT(menu));
48 g_object_unref(G_OBJECT(menu_item));
49 g_debug("Quiting");49 g_debug("Quiting");
5050
51 return 0;51 return 0;

Subscribers

People subscribed via source and target branches