Merge lp:~jdstrand/hud/hud-lp1218107 into lp:hud/13.10

Proposed by Jamie Strandboge
Status: Merged
Approved by: Ted Gould
Approved revision: 317
Merged at revision: 317
Proposed branch: lp:~jdstrand/hud/hud-lp1218107
Merge into: lp:hud/13.10
Diff against target: 100 lines (+23/-11)
4 files modified
CMakeLists.txt (+9/-0)
debian/control (+2/-1)
src/CMakeLists.txt (+2/-0)
src/application-source.c (+10/-10)
To merge this branch: bzr merge lp:~jdstrand/hud/hud-lp1218107
Reviewer Review Type Date Requested Status
Ted Gould (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+183756@code.launchpad.net

Commit message

use libnih-dbus to generate object path name (LP: #1218107)
- CMakeLists.txt: add NIH_INCLUDE_DIRS and NIH_DBUS_INCLUDE_DIRS
- src/CMakeLists.txt: add NIH_LIBRARIES and NIH_DBUS_LIBRARIES
- src/application-source.c: use nih_dbus_path()
- debian/control: Build-Depends on libnih-dbus-dev

Description of the change

use libnih-dbus to generate object path name (LP: #1218107)
- CMakeLists.txt: add NIH_INCLUDE_DIRS and NIH_DBUS_INCLUDE_DIRS
- src/CMakeLists.txt: add NIH_LIBRARIES and NIH_DBUS_LIBRARIES
- src/application-source.c: use nih_dbus_path()
- debian/control: Build-Depends on libnih-dbus-dev

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ted Gould (ted) wrote :

Great, thanks!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-06-04 20:47:57 +0000
3+++ CMakeLists.txt 2013-09-03 20:24:10 +0000
4@@ -85,6 +85,15 @@
5 pkg_search_module(GTK3 REQUIRED gtk+-3.0)
6 include_directories(${GTK3_INCLUDE_DIRS})
7
8+pkg_check_modules(NIH REQUIRED libnih)
9+include_directories(${NIH_INCLUDE_DIRS})
10+
11+pkg_check_modules(NIH_DBUS REQUIRED libnih-dbus)
12+include_directories(${NIH_DBUS_INCLUDE_DIRS})
13+
14+pkg_check_modules(DBUS REQUIRED dbus-1)
15+include_directories(${DBUS_INCLUDE_DIRS})
16+
17 find_package(Vala 0.12)
18
19 find_package(GObjectIntrospection 0.9.12)
20
21=== modified file 'debian/control'
22--- debian/control 2013-07-22 04:57:50 +0000
23+++ debian/control 2013-09-03 20:24:10 +0000
24@@ -29,9 +29,10 @@
25 libpocketsphinx-dev (>= 0.8),
26 libsphinxbase-dev (>= 0.8),
27 sphinx-voxforge-hmm-en,
28- sphinx-voxforge-lm-en,
29+ sphinx-voxforge-lm-en,
30 pulseaudio,
31 python-setuptools,
32+ libnih-dbus-dev,
33 Standards-Version: 3.9.4
34 Homepage: http://launchpad.net/hud
35 # If you aren't a member of ~indicator-applet-developers but need to upload
36
37=== modified file 'src/CMakeLists.txt'
38--- src/CMakeLists.txt 2013-06-14 00:48:33 +0000
39+++ src/CMakeLists.txt 2013-09-03 20:24:10 +0000
40@@ -156,6 +156,8 @@
41 ${SQLITE3_LIBRARIES}
42 ${POCKETSPHINX_LIBRARIES}
43 ${PHABLET_LIBRARIES}
44+${NIH_LIBRARIES}
45+${NIH_DBUS_LIBRARIES}
46 )
47
48 ###########################
49
50=== modified file 'src/application-source.c'
51--- src/application-source.c 2013-08-21 18:10:29 +0000
52+++ src/application-source.c 2013-09-03 20:24:10 +0000
53@@ -30,6 +30,9 @@
54 #include "dbusmenu-collector.h"
55 #include "source-list.h"
56
57+#include <nih/alloc.h>
58+#include <libnih-dbus.h>
59+
60 struct _HudApplicationSourcePrivate {
61 GDBusConnection * session;
62
63@@ -442,14 +445,11 @@
64
65 source->priv->skel = app_iface_com_canonical_hud_application_skeleton_new();
66
67- gchar * app_id_clean = g_strdup(id);
68- gchar * app_id_cleanp;
69- for (app_id_cleanp = app_id_clean; app_id_cleanp[0] != '\0'; app_id_cleanp++) {
70- if (!g_ascii_isalnum(app_id_cleanp[0])) {
71- app_id_cleanp[0] = '_';
72- }
73- }
74- source->priv->path = g_strdup_printf("/com/canonical/hud/applications/%s", app_id_clean);
75+ char * app_id_path;
76+ app_id_path = nih_dbus_path(NULL, "/com/canonical/hud/applications", id, NULL);
77+ if (app_id_path == NULL) /* emulate glib memory handling and terminate */
78+ g_error("Unable to allocate memory for nih_dbus_path()");
79+ source->priv->path = g_strdup(app_id_path);
80
81 int i = 0;
82 GError * error = NULL;
83@@ -472,7 +472,7 @@
84 g_free(source->priv->path);
85 g_clear_object(&source->priv->skel);
86
87- source->priv->path = g_strdup_printf("/com/canonical/hud/applications/%s_%d", app_id_clean, ++i);
88+ source->priv->path = g_strdup_printf("%s_%d", app_id_path, ++i);
89 source->priv->skel = app_iface_com_canonical_hud_application_skeleton_new();
90 }
91
92@@ -480,7 +480,7 @@
93 g_signal_connect(G_OBJECT(source->priv->skel), "handle-set-window-context", G_CALLBACK(dbus_set_context), source);
94
95 g_debug("Application ('%s') path: %s", id, source->priv->path);
96- g_free(app_id_clean);
97+ nih_free(app_id_path);
98
99 return source;
100 }

Subscribers

People subscribed via source and target branches