Merge lp:~ken-vandine/content-hub/lp1324969 into lp:content-hub

Proposed by Ken VanDine
Status: Merged
Approved by: Michael Sheldon
Approved revision: 104
Merged at revision: 106
Proposed branch: lp:~ken-vandine/content-hub/lp1324969
Merge into: lp:content-hub
Diff against target: 107 lines (+32/-3)
7 files modified
debian/content-hub.install (+1/-1)
src/com/ubuntu/content/service/CMakeLists.txt (+10/-0)
src/com/ubuntu/content/service/content-hub-peer-hook-wrapper.in (+8/-0)
src/com/ubuntu/content/service/content-hub.hook.in (+1/-1)
src/com/ubuntu/content/service/hook.cpp (+7/-0)
src/com/ubuntu/content/service/hook.h (+1/-0)
src/com/ubuntu/content/service/registry.cpp (+4/-1)
To merge this branch: bzr merge lp:~ken-vandine/content-hub/lp1324969
Reviewer Review Type Date Requested Status
Michael Sheldon (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+221776@code.launchpad.net

Commit message

Add a wrapper for the click hook to ensure the dbus session is properly
exported (LP: #1324969)

Description of the change

Add a wrapper for the click hook to ensure the dbus session is properly
exported (LP: #1324969)

To post a comment you must log in.
Revision history for this message
Ken VanDine (ken-vandine) wrote :

Are there any related MPs required for this MP to build/function as expected? Please list.

 * No

Is your branch in sync with latest trunk (e.g. bzr pull lp:trunk -> no changes)

 * Yes

Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?

 * Yes

Did you successfully run all tests found in your component's Test Plan (https://wiki.ubuntu.com/Process/Merges/TestPlan/content-hub) on device or emulator?

 * Yes

If you changed the UI, was the change specified/approved by design?

 * No change

If you changed the packaging (debian), did you subscribe a core-dev to this MP?

 * No change

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
104. By Ken VanDine

ensure we delete the Hook and Registry to make sure the QGSettings destructor
gets called.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

I'm testing by bumping the version of hub-importer and reinstalling multiple times. It seems to work correctly if content-hub-service isn't running when it's installed, however if content-hub-service is running the click is installed the importer old version gets removed from gsettings but the new version isn't added.

review: Needs Fixing
Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Sorry, that should read:

however if content-hub-service is running when the click is installed, the old version gets removed from gsettings but the new version isn't added.

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

> Sorry, that should read:
>
> however if content-hub-service is running when the click is installed, the old
> version gets removed from gsettings but the new version isn't added.

That's a bug in gsettings-qt, it wasn't calling g_settings_sync in the destructor. Fixed in https://code.launchpad.net/~larsu/gsettings-qt/sync-on-destroy/+merge/221895

Revision history for this message
Michael Sheldon (michael-sheldon) wrote :

Did you perform an exploratory manual test run of the code change and any related functionality on device or emulator?

 * Yes (except for occasional failure due to QGSettings bug)

Did CI run pass? If not, please explain why.

 * Yes

Have you checked that submitter has accurately filled out the submitter checklist and has taken no shortcut?

 * Yes

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/content-hub.install'
2--- debian/content-hub.install 2014-03-07 19:28:54 +0000
3+++ debian/content-hub.install 2014-06-03 14:07:13 +0000
4@@ -1,5 +1,5 @@
5 usr/bin
6-usr/lib/*/content-hub/content-hub-peer-hook
7+usr/lib/*/content-hub
8 usr/share/click/hooks
9 usr/share/dbus-1
10 usr/share/glib-2.0/schemas
11
12=== modified file 'src/com/ubuntu/content/service/CMakeLists.txt'
13--- src/com/ubuntu/content/service/CMakeLists.txt 2014-03-07 21:07:27 +0000
14+++ src/com/ubuntu/content/service/CMakeLists.txt 2014-06-03 14:07:13 +0000
15@@ -80,6 +80,16 @@
16 ${UPSTART_LAUNCH_LDFLAGS}
17 )
18
19+configure_file("content-hub-peer-hook-wrapper.in"
20+ "content-hub-peer-hook-wrapper"
21+ @ONLY
22+)
23+
24+install(
25+ PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/content-hub-peer-hook-wrapper"
26+ DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/content-hub"
27+)
28+
29 install(
30 TARGETS content-hub-peer-hook
31 RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/content-hub"
32
33=== added file 'src/com/ubuntu/content/service/content-hub-peer-hook-wrapper.in'
34--- src/com/ubuntu/content/service/content-hub-peer-hook-wrapper.in 1970-01-01 00:00:00 +0000
35+++ src/com/ubuntu/content/service/content-hub-peer-hook-wrapper.in 2014-06-03 14:07:13 +0000
36@@ -0,0 +1,8 @@
37+#!/bin/sh
38+
39+if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then
40+ [ -e $HOME/.cache/upstart/dbus-session ] && . $HOME/.cache/upstart/dbus-session || eval `dbus-launch --sh-syntax`
41+ [ -n "$DBUS_SESSION_BUS_ADDRESS" ] && export DBUS_SESSION_BUS_ADDRESS
42+fi
43+
44+@pkglibexecdir@/content-hub/content-hub-peer-hook
45
46=== modified file 'src/com/ubuntu/content/service/content-hub.hook.in'
47--- src/com/ubuntu/content/service/content-hub.hook.in 2013-09-23 20:55:01 +0000
48+++ src/com/ubuntu/content/service/content-hub.hook.in 2014-06-03 14:07:13 +0000
49@@ -1,4 +1,4 @@
50 Pattern: ${home}/.local/share/content-hub/${id}
51-Exec: @pkglibexecdir@/content-hub/content-hub-peer-hook
52+Exec: @pkglibexecdir@/content-hub/content-hub-peer-hook-wrapper
53 User-Level: yes
54 Hook-Name: content-hub
55
56=== modified file 'src/com/ubuntu/content/service/hook.cpp'
57--- src/com/ubuntu/content/service/hook.cpp 2014-03-04 21:47:48 +0000
58+++ src/com/ubuntu/content/service/hook.cpp 2014-06-03 14:07:13 +0000
59@@ -43,6 +43,12 @@
60 {
61 }
62
63+cucd::Hook::~Hook()
64+{
65+ TRACE() << Q_FUNC_INFO;
66+ delete registry;
67+}
68+
69 void cucd::Hook::run()
70 {
71 TRACE() << Q_FUNC_INFO;
72@@ -85,6 +91,7 @@
73 Q_FOREACH(QFileInfo f, contentDir.entryInfoList(QDir::Files))
74 add_peer(f);
75
76+ deleteLater();
77 QCoreApplication::instance()->quit();
78 }
79
80
81=== modified file 'src/com/ubuntu/content/service/hook.h'
82--- src/com/ubuntu/content/service/hook.h 2014-02-20 21:18:27 +0000
83+++ src/com/ubuntu/content/service/hook.h 2014-06-03 14:07:13 +0000
84@@ -39,6 +39,7 @@
85 public:
86 explicit Hook(QObject *parent = 0);
87 Hook(com::ubuntu::content::detail::PeerRegistry *registry, QObject *parent = 0);
88+ ~Hook();
89
90 public slots:
91 bool return_error(QString err = "");
92
93=== modified file 'src/com/ubuntu/content/service/registry.cpp'
94--- src/com/ubuntu/content/service/registry.cpp 2014-04-02 14:46:23 +0000
95+++ src/com/ubuntu/content/service/registry.cpp 2014-06-03 14:07:13 +0000
96@@ -71,7 +71,10 @@
97 }
98 }
99
100-Registry::~Registry() {}
101+Registry::~Registry()
102+{
103+ TRACE() << Q_FUNC_INFO;
104+}
105
106 cuc::Peer Registry::default_source_for_type(cuc::Type type)
107 {

Subscribers

People subscribed via source and target branches