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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2013-06-04 20:47:57 +0000
+++ CMakeLists.txt 2013-09-03 20:24:10 +0000
@@ -85,6 +85,15 @@
85pkg_search_module(GTK3 REQUIRED gtk+-3.0)85pkg_search_module(GTK3 REQUIRED gtk+-3.0)
86include_directories(${GTK3_INCLUDE_DIRS})86include_directories(${GTK3_INCLUDE_DIRS})
8787
88pkg_check_modules(NIH REQUIRED libnih)
89include_directories(${NIH_INCLUDE_DIRS})
90
91pkg_check_modules(NIH_DBUS REQUIRED libnih-dbus)
92include_directories(${NIH_DBUS_INCLUDE_DIRS})
93
94pkg_check_modules(DBUS REQUIRED dbus-1)
95include_directories(${DBUS_INCLUDE_DIRS})
96
88find_package(Vala 0.12)97find_package(Vala 0.12)
8998
90find_package(GObjectIntrospection 0.9.12)99find_package(GObjectIntrospection 0.9.12)
91100
=== modified file 'debian/control'
--- debian/control 2013-07-22 04:57:50 +0000
+++ debian/control 2013-09-03 20:24:10 +0000
@@ -29,9 +29,10 @@
29 libpocketsphinx-dev (>= 0.8),29 libpocketsphinx-dev (>= 0.8),
30 libsphinxbase-dev (>= 0.8),30 libsphinxbase-dev (>= 0.8),
31 sphinx-voxforge-hmm-en,31 sphinx-voxforge-hmm-en,
32 sphinx-voxforge-lm-en, 32 sphinx-voxforge-lm-en,
33 pulseaudio,33 pulseaudio,
34 python-setuptools,34 python-setuptools,
35 libnih-dbus-dev,
35Standards-Version: 3.9.436Standards-Version: 3.9.4
36Homepage: http://launchpad.net/hud37Homepage: http://launchpad.net/hud
37# If you aren't a member of ~indicator-applet-developers but need to upload38# If you aren't a member of ~indicator-applet-developers but need to upload
3839
=== modified file 'src/CMakeLists.txt'
--- src/CMakeLists.txt 2013-06-14 00:48:33 +0000
+++ src/CMakeLists.txt 2013-09-03 20:24:10 +0000
@@ -156,6 +156,8 @@
156${SQLITE3_LIBRARIES}156${SQLITE3_LIBRARIES}
157${POCKETSPHINX_LIBRARIES}157${POCKETSPHINX_LIBRARIES}
158${PHABLET_LIBRARIES}158${PHABLET_LIBRARIES}
159${NIH_LIBRARIES}
160${NIH_DBUS_LIBRARIES}
159)161)
160162
161###########################163###########################
162164
=== modified file 'src/application-source.c'
--- src/application-source.c 2013-08-21 18:10:29 +0000
+++ src/application-source.c 2013-09-03 20:24:10 +0000
@@ -30,6 +30,9 @@
30#include "dbusmenu-collector.h"30#include "dbusmenu-collector.h"
31#include "source-list.h"31#include "source-list.h"
3232
33#include <nih/alloc.h>
34#include <libnih-dbus.h>
35
33struct _HudApplicationSourcePrivate {36struct _HudApplicationSourcePrivate {
34 GDBusConnection * session;37 GDBusConnection * session;
3538
@@ -442,14 +445,11 @@
442445
443 source->priv->skel = app_iface_com_canonical_hud_application_skeleton_new();446 source->priv->skel = app_iface_com_canonical_hud_application_skeleton_new();
444447
445 gchar * app_id_clean = g_strdup(id);448 char * app_id_path;
446 gchar * app_id_cleanp;449 app_id_path = nih_dbus_path(NULL, "/com/canonical/hud/applications", id, NULL);
447 for (app_id_cleanp = app_id_clean; app_id_cleanp[0] != '\0'; app_id_cleanp++) {450 if (app_id_path == NULL) /* emulate glib memory handling and terminate */
448 if (!g_ascii_isalnum(app_id_cleanp[0])) {451 g_error("Unable to allocate memory for nih_dbus_path()");
449 app_id_cleanp[0] = '_';452 source->priv->path = g_strdup(app_id_path);
450 }
451 }
452 source->priv->path = g_strdup_printf("/com/canonical/hud/applications/%s", app_id_clean);
453453
454 int i = 0;454 int i = 0;
455 GError * error = NULL;455 GError * error = NULL;
@@ -472,7 +472,7 @@
472 g_free(source->priv->path);472 g_free(source->priv->path);
473 g_clear_object(&source->priv->skel);473 g_clear_object(&source->priv->skel);
474474
475 source->priv->path = g_strdup_printf("/com/canonical/hud/applications/%s_%d", app_id_clean, ++i);475 source->priv->path = g_strdup_printf("%s_%d", app_id_path, ++i);
476 source->priv->skel = app_iface_com_canonical_hud_application_skeleton_new();476 source->priv->skel = app_iface_com_canonical_hud_application_skeleton_new();
477 }477 }
478478
@@ -480,7 +480,7 @@
480 g_signal_connect(G_OBJECT(source->priv->skel), "handle-set-window-context", G_CALLBACK(dbus_set_context), source);480 g_signal_connect(G_OBJECT(source->priv->skel), "handle-set-window-context", G_CALLBACK(dbus_set_context), source);
481481
482 g_debug("Application ('%s') path: %s", id, source->priv->path);482 g_debug("Application ('%s') path: %s", id, source->priv->path);
483 g_free(app_id_clean);483 nih_free(app_id_path);
484484
485 return source;485 return source;
486}486}

Subscribers

People subscribed via source and target branches