Merge lp:~ken-vandine/content-hub/noclick into lp:content-hub
- noclick
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Michael Sheldon |
Approved revision: | 334 |
Merged at revision: | 332 |
Proposed branch: | lp:~ken-vandine/content-hub/noclick |
Merge into: | lp:content-hub |
Diff against target: |
737 lines (+104/-256) 18 files modified
CMakeLists.txt (+0/-1) debian/content-hub.install (+1/-2) debian/control (+0/-2) debian/rules (+2/-1) include/com/ubuntu/content/type.h (+2/-2) src/com/ubuntu/content/service/CMakeLists.txt (+7/-54) src/com/ubuntu/content/service/content-hub-peer-hook-wrapper.in (+0/-13) src/com/ubuntu/content/service/content-hub.hook.in (+0/-4) src/com/ubuntu/content/service/helper.cpp (+0/-66) src/com/ubuntu/content/service/main.cpp (+4/-1) src/com/ubuntu/content/service/registry-updater.cpp (+57/-39) src/com/ubuntu/content/service/registry-updater.h (+11/-9) src/helper/CMakeLists.txt (+0/-2) src/helper/exec-tool.c (+2/-43) tests/acceptance-tests/CMakeLists.txt (+8/-8) tests/acceptance-tests/test_registry_updater.cpp (+8/-7) tools/peer-picker/content-hub-peer-picker.desktop (+1/-1) tools/send/content-hub-send.desktop (+1/-1) |
To merge this branch: | bzr merge lp:~ken-vandine/content-hub/noclick |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Michael Sheldon (community) | Approve | ||
system-apps-ci-bot | continuous-integration | Needs Fixing | |
Review via email: mp+319356@code.launchpad.net |
Commit message
* Removed the click hook and check for registered peers on service startup
* Removed click usage in the helper and dropped the depends
* Added QFileWatcher to watch for peers to be installed/removed
Description of the change
* Removed the click hook and check for registered peers on service startup
* Removed click usage in the helper and dropped the depends
* Added QFileWatcher to watch for peers to be installed/removed
- 328. By Ken VanDine
-
Removed some debugging
- 329. By Ken VanDine
-
Rename the Hook class to RegistryUpdater
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
- 330. By Ken VanDine
-
merged trunk
- 331. By Ken VanDine
-
removed unused filed
- 332. By Ken VanDine
-
Added /var/cache/
content- hub/peers/ to the list of directories watched for peers. The snap interface hook will install them there. - 333. By Ken VanDine
-
Install an empty dir for the snap interface hook to install peers.
- 334. By Ken VanDine
-
updated copyright years
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:330
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
system-apps-ci-bot (system-apps-ci-bot) wrote : | # |
FAILED: Continuous integration, rev:334
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild:
https:/
Michael Sheldon (michael-sheldon) wrote : | # |
Looks good
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2017-02-16 12:08:29 +0000 | |||
3 | +++ CMakeLists.txt 2017-03-15 13:33:04 +0000 | |||
4 | @@ -72,7 +72,6 @@ | |||
5 | 72 | pkg_check_modules(UBUNTU_DOWNLOAD_MANAGER REQUIRED ubuntu-download-manager-client) | 72 | pkg_check_modules(UBUNTU_DOWNLOAD_MANAGER REQUIRED ubuntu-download-manager-client) |
6 | 73 | pkg_check_modules(NOTIFY REQUIRED libnotify) | 73 | pkg_check_modules(NOTIFY REQUIRED libnotify) |
7 | 74 | pkg_check_modules(MIRCLIENT REQUIRED mirclient) | 74 | pkg_check_modules(MIRCLIENT REQUIRED mirclient) |
8 | 75 | pkg_check_modules(CLICK REQUIRED click-0.4) | ||
9 | 76 | pkg_check_modules(APPARMOR REQUIRED libapparmor) | 75 | pkg_check_modules(APPARMOR REQUIRED libapparmor) |
10 | 77 | 76 | ||
11 | 78 | add_definitions(-DDEBUG_ENABLED) | 77 | add_definitions(-DDEBUG_ENABLED) |
12 | 79 | 78 | ||
13 | === modified file 'debian/content-hub.install' | |||
14 | --- debian/content-hub.install 2016-12-08 12:11:27 +0000 | |||
15 | +++ debian/content-hub.install 2017-03-15 13:33:04 +0000 | |||
16 | @@ -2,10 +2,8 @@ | |||
17 | 2 | usr/bin/content-hub-peer-picker | 2 | usr/bin/content-hub-peer-picker |
18 | 3 | usr/bin/content-hub-send | 3 | usr/bin/content-hub-send |
19 | 4 | usr/bin/content-hub-service | 4 | usr/bin/content-hub-service |
20 | 5 | usr/lib/*/content-hub | ||
21 | 6 | usr/lib/*/ubuntu-app-launch | 5 | usr/lib/*/ubuntu-app-launch |
22 | 7 | usr/lib/systemd/user | 6 | usr/lib/systemd/user |
23 | 8 | usr/share/click/hooks | ||
24 | 9 | usr/share/dbus-1 | 7 | usr/share/dbus-1 |
25 | 10 | usr/share/glib-2.0/schemas | 8 | usr/share/glib-2.0/schemas |
26 | 11 | usr/share/locale/*/LC_MESSAGES/content-hub.mo | 9 | usr/share/locale/*/LC_MESSAGES/content-hub.mo |
27 | @@ -14,5 +12,6 @@ | |||
28 | 14 | usr/share/applications/content-hub-peer-picker.desktop | 12 | usr/share/applications/content-hub-peer-picker.desktop |
29 | 15 | usr/share/url-dispatcher/urls/content-hub-send.url-dispatcher | 13 | usr/share/url-dispatcher/urls/content-hub-send.url-dispatcher |
30 | 16 | usr/share/content-hub/icons | 14 | usr/share/content-hub/icons |
31 | 15 | var/cache/content-hub/peers | ||
32 | 17 | debian/apparmor/content-hub-clipboard etc/apparmor.d | 16 | debian/apparmor/content-hub-clipboard etc/apparmor.d |
33 | 18 | debian/apparmor/content-hub-peer-picker etc/apparmor.d | 17 | debian/apparmor/content-hub-peer-picker etc/apparmor.d |
34 | 19 | 18 | ||
35 | === modified file 'debian/control' | |||
36 | --- debian/control 2017-03-09 02:39:40 +0000 | |||
37 | +++ debian/control 2017-03-15 13:33:04 +0000 | |||
38 | @@ -2,7 +2,6 @@ | |||
39 | 2 | Priority: optional | 2 | Priority: optional |
40 | 3 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> | 3 | Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> |
41 | 4 | Build-Depends: cmake, | 4 | Build-Depends: cmake, |
42 | 5 | click-dev, | ||
43 | 6 | dbus-test-runner, | 5 | dbus-test-runner, |
44 | 7 | debhelper (>= 9), | 6 | debhelper (>= 9), |
45 | 8 | dh-apparmor, | 7 | dh-apparmor, |
46 | @@ -11,7 +10,6 @@ | |||
47 | 11 | google-mock, | 10 | google-mock, |
48 | 12 | lcov, | 11 | lcov, |
49 | 13 | libapparmor-dev, | 12 | libapparmor-dev, |
50 | 14 | libclick-0.4-dev, | ||
51 | 15 | libglib2.0-dev, | 13 | libglib2.0-dev, |
52 | 16 | libgsettings-qt-dev, | 14 | libgsettings-qt-dev, |
53 | 17 | libmirclient-dev [!powerpc !ppc64 !ppc64el], | 15 | libmirclient-dev [!powerpc !ppc64 !ppc64el], |
54 | 18 | 16 | ||
55 | === modified file 'debian/rules' | |||
56 | --- debian/rules 2017-01-04 16:16:00 +0000 | |||
57 | +++ debian/rules 2017-03-15 13:33:04 +0000 | |||
58 | @@ -11,7 +11,7 @@ | |||
59 | 11 | LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) | 11 | LDFLAGS:=$(shell dpkg-buildflags --get LDFLAGS) |
60 | 12 | 12 | ||
61 | 13 | %: | 13 | %: |
63 | 14 | dh $@ --with click,translations --fail-missing -- -B build | 14 | dh $@ --with translations --fail-missing -- -B build |
64 | 15 | 15 | ||
65 | 16 | override_dh_auto_test: | 16 | override_dh_auto_test: |
66 | 17 | make -C build/tests/acceptance-tests test | 17 | make -C build/tests/acceptance-tests test |
67 | @@ -21,6 +21,7 @@ | |||
68 | 21 | dh_apparmor -pcontent-hub --profile-name=content-hub-clipboard | 21 | dh_apparmor -pcontent-hub --profile-name=content-hub-clipboard |
69 | 22 | dh_apparmor -pcontent-hub --profile-name=content-hub-peer-picker | 22 | dh_apparmor -pcontent-hub --profile-name=content-hub-peer-picker |
70 | 23 | dh_apparmor -pcontent-hub-testability --profile-name=content-hub-testability | 23 | dh_apparmor -pcontent-hub-testability --profile-name=content-hub-testability |
71 | 24 | mkdir -p debian/tmp/var/cache/content-hub/peers | ||
72 | 24 | 25 | ||
73 | 25 | DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) | 26 | DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) |
74 | 26 | # Skip tests on the archs they are known to be flaky with current configuration | 27 | # Skip tests on the archs they are known to be flaky with current configuration |
75 | 27 | 28 | ||
76 | === modified file 'include/com/ubuntu/content/type.h' | |||
77 | --- include/com/ubuntu/content/type.h 2015-06-24 20:22:45 +0000 | |||
78 | +++ include/com/ubuntu/content/type.h 2017-03-15 13:33:04 +0000 | |||
79 | @@ -30,7 +30,7 @@ | |||
80 | 30 | namespace detail | 30 | namespace detail |
81 | 31 | { | 31 | { |
82 | 32 | class Service; | 32 | class Service; |
84 | 33 | class Hook; | 33 | class RegistryUpdater; |
85 | 34 | } | 34 | } |
86 | 35 | class Type : public QObject | 35 | class Type : public QObject |
87 | 36 | { | 36 | { |
88 | @@ -67,7 +67,7 @@ | |||
89 | 67 | protected: | 67 | protected: |
90 | 68 | friend struct Known; | 68 | friend struct Known; |
91 | 69 | friend class detail::Service; | 69 | friend class detail::Service; |
93 | 70 | friend class detail::Hook; | 70 | friend class detail::RegistryUpdater; |
94 | 71 | 71 | ||
95 | 72 | explicit Type(const QString&, QObject* = nullptr); | 72 | explicit Type(const QString&, QObject* = nullptr); |
96 | 73 | 73 | ||
97 | 74 | 74 | ||
98 | === modified file 'src/com/ubuntu/content/service/CMakeLists.txt' | |||
99 | --- src/com/ubuntu/content/service/CMakeLists.txt 2016-11-15 19:45:40 +0000 | |||
100 | +++ src/com/ubuntu/content/service/CMakeLists.txt 2017-03-15 13:33:04 +0000 | |||
101 | @@ -37,11 +37,18 @@ | |||
102 | 37 | 37 | ||
103 | 38 | main.cpp | 38 | main.cpp |
104 | 39 | registry.cpp | 39 | registry.cpp |
105 | 40 | registry-updater.cpp | ||
106 | 40 | ../debug.cpp | 41 | ../debug.cpp |
107 | 41 | ../utils.cpp | 42 | ../utils.cpp |
108 | 42 | ${CONTENT_SERVICE_SKELETON} | 43 | ${CONTENT_SERVICE_SKELETON} |
109 | 43 | ) | 44 | ) |
110 | 44 | 45 | ||
111 | 46 | set_target_properties( | ||
112 | 47 | content-hub-service | ||
113 | 48 | PROPERTIES | ||
114 | 49 | AUTOMOC TRUE | ||
115 | 50 | ) | ||
116 | 51 | |||
117 | 45 | qt5_use_modules(content-hub-service Core DBus Gui) | 52 | qt5_use_modules(content-hub-service Core DBus Gui) |
118 | 46 | 53 | ||
119 | 47 | target_link_libraries( | 54 | target_link_libraries( |
120 | @@ -85,60 +92,6 @@ | |||
121 | 85 | 92 | ||
122 | 86 | add_schema ("com.ubuntu.content.hub.gschema.xml") | 93 | add_schema ("com.ubuntu.content.hub.gschema.xml") |
123 | 87 | 94 | ||
124 | 88 | add_executable( | ||
125 | 89 | content-hub-peer-hook | ||
126 | 90 | |||
127 | 91 | helper.cpp | ||
128 | 92 | registry.cpp | ||
129 | 93 | hook.cpp | ||
130 | 94 | ) | ||
131 | 95 | |||
132 | 96 | qt5_use_modules(content-hub-peer-hook Core Gui DBus) | ||
133 | 97 | |||
134 | 98 | target_link_libraries( | ||
135 | 99 | content-hub-peer-hook | ||
136 | 100 | |||
137 | 101 | content-hub | ||
138 | 102 | ${GSETTINGS_LDFLAGS} | ||
139 | 103 | ${UBUNTU_LAUNCH_LDFLAGS} | ||
140 | 104 | ) | ||
141 | 105 | |||
142 | 106 | configure_file("content-hub-peer-hook-wrapper.in" | ||
143 | 107 | "content-hub-peer-hook-wrapper" | ||
144 | 108 | @ONLY | ||
145 | 109 | ) | ||
146 | 110 | |||
147 | 111 | install( | ||
148 | 112 | PROGRAMS "${CMAKE_CURRENT_BINARY_DIR}/content-hub-peer-hook-wrapper" | ||
149 | 113 | DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/content-hub" | ||
150 | 114 | ) | ||
151 | 115 | |||
152 | 116 | install( | ||
153 | 117 | TARGETS content-hub-peer-hook | ||
154 | 118 | RUNTIME DESTINATION "${CMAKE_INSTALL_FULL_LIBEXECDIR}/content-hub" | ||
155 | 119 | ) | ||
156 | 120 | |||
157 | 121 | set_target_properties( | ||
158 | 122 | content-hub-peer-hook | ||
159 | 123 | PROPERTIES | ||
160 | 124 | AUTOMOC TRUE | ||
161 | 125 | ) | ||
162 | 126 | |||
163 | 127 | set(CLICK_HOOK | ||
164 | 128 | "${CMAKE_CURRENT_BINARY_DIR}/content-hub.hook" | ||
165 | 129 | ) | ||
166 | 130 | |||
167 | 131 | configure_file("content-hub.hook.in" | ||
168 | 132 | "${CLICK_HOOK}" | ||
169 | 133 | @ONLY | ||
170 | 134 | ) | ||
171 | 135 | |||
172 | 136 | install( | ||
173 | 137 | FILES | ||
174 | 138 | "${CLICK_HOOK}" | ||
175 | 139 | DESTINATION "/usr/share/click/hooks" | ||
176 | 140 | ) | ||
177 | 141 | |||
178 | 142 | install( | 95 | install( |
179 | 143 | FILES xorg.png | 96 | FILES xorg.png |
180 | 144 | DESTINATION ${CMAKE_INSTALL_DATADIR}/content-hub/icons/ | 97 | DESTINATION ${CMAKE_INSTALL_DATADIR}/content-hub/icons/ |
181 | 145 | 98 | ||
182 | === removed file 'src/com/ubuntu/content/service/content-hub-peer-hook-wrapper.in' | |||
183 | --- src/com/ubuntu/content/service/content-hub-peer-hook-wrapper.in 2014-11-10 12:57:43 +0000 | |||
184 | +++ src/com/ubuntu/content/service/content-hub-peer-hook-wrapper.in 1970-01-01 00:00:00 +0000 | |||
185 | @@ -1,13 +0,0 @@ | |||
186 | 1 | #!/bin/sh | ||
187 | 2 | |||
188 | 3 | # PackageKit clears all environment variables, so we get the UID and then read | ||
189 | 4 | # in $DBUS_SESSION_BUS_ADDRESS from /run/user/$UID/dbus-session | ||
190 | 5 | |||
191 | 6 | USERID=`id -u` | ||
192 | 7 | |||
193 | 8 | if test -z "$DBUS_SESSION_BUS_ADDRESS" ; then | ||
194 | 9 | [ -e /run/user/$USERID/dbus-session ] && . /run/user/$USERID/dbus-session | ||
195 | 10 | [ -n "$DBUS_SESSION_BUS_ADDRESS" ] && export DBUS_SESSION_BUS_ADDRESS | ||
196 | 11 | fi | ||
197 | 12 | |||
198 | 13 | @pkglibexecdir@/content-hub/content-hub-peer-hook | ||
199 | 14 | 0 | ||
200 | === removed file 'src/com/ubuntu/content/service/content-hub.hook.in' | |||
201 | --- src/com/ubuntu/content/service/content-hub.hook.in 2014-06-02 16:33:13 +0000 | |||
202 | +++ src/com/ubuntu/content/service/content-hub.hook.in 1970-01-01 00:00:00 +0000 | |||
203 | @@ -1,4 +0,0 @@ | |||
204 | 1 | Pattern: ${home}/.local/share/content-hub/${id} | ||
205 | 2 | Exec: @pkglibexecdir@/content-hub/content-hub-peer-hook-wrapper | ||
206 | 3 | User-Level: yes | ||
207 | 4 | Hook-Name: content-hub | ||
208 | 5 | 0 | ||
209 | === removed file 'src/com/ubuntu/content/service/helper.cpp' | |||
210 | --- src/com/ubuntu/content/service/helper.cpp 2015-08-12 17:24:29 +0000 | |||
211 | +++ src/com/ubuntu/content/service/helper.cpp 1970-01-01 00:00:00 +0000 | |||
212 | @@ -1,66 +0,0 @@ | |||
213 | 1 | /* | ||
214 | 2 | * Copyright (C) 2013 Canonical, Ltd. | ||
215 | 3 | * | ||
216 | 4 | * This program is free software; you can redistribute it and/or modify | ||
217 | 5 | * it under the terms of the GNU General Public License as published by | ||
218 | 6 | * the Free Software Foundation; version 3. | ||
219 | 7 | * | ||
220 | 8 | * This program is distributed in the hope that it will be useful, | ||
221 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
222 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
223 | 11 | * GNU General Public License for more details. | ||
224 | 12 | * | ||
225 | 13 | * You should have received a copy of the GNU General Public License | ||
226 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
227 | 15 | * | ||
228 | 16 | * Authored by: Ken VanDine <ken.vandine@canonical.com> | ||
229 | 17 | */ | ||
230 | 18 | |||
231 | 19 | #include <QCoreApplication> | ||
232 | 20 | #include <QDir> | ||
233 | 21 | #include <QStandardPaths> | ||
234 | 22 | |||
235 | 23 | #include "hook.h" | ||
236 | 24 | #include "debug.h" | ||
237 | 25 | |||
238 | 26 | namespace cuc = com::ubuntu::content; | ||
239 | 27 | |||
240 | 28 | int main(int argc, char** argv) | ||
241 | 29 | { | ||
242 | 30 | QCoreApplication app(argc, argv); | ||
243 | 31 | |||
244 | 32 | TRACE() << Q_FUNC_INFO; | ||
245 | 33 | |||
246 | 34 | if (app.arguments().count() > 1) | ||
247 | 35 | { | ||
248 | 36 | qWarning() << "Shouldn't have arguments"; | ||
249 | 37 | return 1; | ||
250 | 38 | } | ||
251 | 39 | |||
252 | 40 | /* read environment variables */ | ||
253 | 41 | QProcessEnvironment environment = QProcessEnvironment::systemEnvironment(); | ||
254 | 42 | if (environment.contains(QLatin1String("CONTENT_HUB_LOGGING_LEVEL"))) { | ||
255 | 43 | bool isOk; | ||
256 | 44 | int value = environment.value( | ||
257 | 45 | QLatin1String("CONTENT_HUB_LOGGING_LEVEL")).toInt(&isOk); | ||
258 | 46 | if (isOk) | ||
259 | 47 | setLoggingLevel(value); | ||
260 | 48 | } | ||
261 | 49 | |||
262 | 50 | QDir contentDir( | ||
263 | 51 | QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) | ||
264 | 52 | + QString("/") | ||
265 | 53 | + QString("content-hub")); | ||
266 | 54 | |||
267 | 55 | if (!contentDir.exists()) { | ||
268 | 56 | if (!contentDir.mkpath(contentDir.absolutePath())) | ||
269 | 57 | return 0; | ||
270 | 58 | } | ||
271 | 59 | |||
272 | 60 | new cuc::detail::Hook(); | ||
273 | 61 | |||
274 | 62 | app.exec(); | ||
275 | 63 | |||
276 | 64 | /* We always want to return 0 */ | ||
277 | 65 | return 0; | ||
278 | 66 | } | ||
279 | 67 | 0 | ||
280 | === modified file 'src/com/ubuntu/content/service/main.cpp' | |||
281 | --- src/com/ubuntu/content/service/main.cpp 2014-07-15 14:31:08 +0000 | |||
282 | +++ src/com/ubuntu/content/service/main.cpp 2017-03-15 13:33:04 +0000 | |||
283 | @@ -1,5 +1,5 @@ | |||
284 | 1 | /* | 1 | /* |
286 | 2 | * Copyright (C) 2013 Canonical, Ltd. | 2 | * Copyright (C) 2013-2017 Canonical, Ltd. |
287 | 3 | * | 3 | * |
288 | 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
289 | 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
290 | @@ -25,6 +25,7 @@ | |||
291 | 25 | #include "debug.h" | 25 | #include "debug.h" |
292 | 26 | #include "common.h" | 26 | #include "common.h" |
293 | 27 | #include "registry.h" | 27 | #include "registry.h" |
294 | 28 | #include "registry-updater.h" | ||
295 | 28 | #include "detail/i18n.h" | 29 | #include "detail/i18n.h" |
296 | 29 | #include "detail/service.h" | 30 | #include "detail/service.h" |
297 | 30 | #include "detail/peer_registry.h" | 31 | #include "detail/peer_registry.h" |
298 | @@ -63,6 +64,8 @@ | |||
299 | 63 | 64 | ||
300 | 64 | auto registry = QSharedPointer<cucd::PeerRegistry>(new Registry()); | 65 | auto registry = QSharedPointer<cucd::PeerRegistry>(new Registry()); |
301 | 65 | 66 | ||
302 | 67 | auto updater = new cuc::detail::RegistryUpdater(registry); | ||
303 | 68 | |||
304 | 66 | auto app_manager = QSharedPointer<cuca::ApplicationManager>(new cucd::AppManager()); | 69 | auto app_manager = QSharedPointer<cuca::ApplicationManager>(new cucd::AppManager()); |
305 | 67 | 70 | ||
306 | 68 | auto server = new cucd::Service(connection, registry, app_manager, app->parent()); | 71 | auto server = new cucd::Service(connection, registry, app_manager, app->parent()); |
307 | 69 | 72 | ||
308 | === renamed file 'src/com/ubuntu/content/service/hook.cpp' => 'src/com/ubuntu/content/service/registry-updater.cpp' | |||
309 | --- src/com/ubuntu/content/service/hook.cpp 2015-06-24 20:22:45 +0000 | |||
310 | +++ src/com/ubuntu/content/service/registry-updater.cpp 2017-03-15 13:33:04 +0000 | |||
311 | @@ -1,5 +1,5 @@ | |||
312 | 1 | /* | 1 | /* |
314 | 2 | * Copyright (C) 2013 Canonical, Ltd. | 2 | * Copyright (C) 2013-2017 Canonical, Ltd. |
315 | 3 | * | 3 | * |
316 | 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
317 | 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
318 | @@ -20,6 +20,7 @@ | |||
319 | 20 | #include <QJsonDocument> | 20 | #include <QJsonDocument> |
320 | 21 | #include <QJsonObject> | 21 | #include <QJsonObject> |
321 | 22 | #include <QFile> | 22 | #include <QFile> |
322 | 23 | #include <QFileSystemWatcher> | ||
323 | 23 | #include <QDir> | 24 | #include <QDir> |
324 | 24 | #include <QStandardPaths> | 25 | #include <QStandardPaths> |
325 | 25 | #include <QTimer> | 26 | #include <QTimer> |
326 | @@ -27,34 +28,18 @@ | |||
327 | 27 | #include <com/ubuntu/content/peer.h> | 28 | #include <com/ubuntu/content/peer.h> |
328 | 28 | 29 | ||
329 | 29 | #include "debug.h" | 30 | #include "debug.h" |
331 | 30 | #include "hook.h" | 31 | #include "registry-updater.h" |
332 | 31 | 32 | ||
333 | 33 | namespace cuc = com::ubuntu::content; | ||
334 | 32 | namespace cucd = com::ubuntu::content::detail; | 34 | namespace cucd = com::ubuntu::content::detail; |
335 | 33 | 35 | ||
360 | 34 | cucd::Hook::Hook(QObject *parent) : | 36 | cucd::RegistryUpdater::RegistryUpdater(const QSharedPointer<cucd::PeerRegistry>& registry, QObject *parent) : |
361 | 35 | QObject(parent), | 37 | QObject(parent), |
362 | 36 | registry(new Registry()) | 38 | registry(registry), |
363 | 37 | { | 39 | watcher(new QFileSystemWatcher) |
364 | 38 | QTimer::singleShot(200, this, SLOT(run())); | 40 | { |
365 | 39 | } | 41 | /* Looks for files installed packages that define peer registration. |
366 | 40 | 42 | * These files are JSON, for example: | |
343 | 41 | cucd::Hook::Hook(com::ubuntu::content::detail::PeerRegistry *registry, QObject *parent) : | ||
344 | 42 | QObject(parent), | ||
345 | 43 | registry(registry) | ||
346 | 44 | { | ||
347 | 45 | } | ||
348 | 46 | |||
349 | 47 | cucd::Hook::~Hook() | ||
350 | 48 | { | ||
351 | 49 | TRACE() << Q_FUNC_INFO; | ||
352 | 50 | delete registry; | ||
353 | 51 | } | ||
354 | 52 | |||
355 | 53 | void cucd::Hook::run() | ||
356 | 54 | { | ||
357 | 55 | TRACE() << Q_FUNC_INFO; | ||
358 | 56 | /* Looks for files in ${HOME}/.local/share/content-hub/${id} installed | ||
359 | 57 | * by click packages. These files are JSON, for example: | ||
367 | 58 | * | 43 | * |
368 | 59 | * { | 44 | * { |
369 | 60 | * "source": [ | 45 | * "source": [ |
370 | @@ -63,22 +48,56 @@ | |||
371 | 63 | * ] | 48 | * ] |
372 | 64 | * } | 49 | * } |
373 | 65 | * | 50 | * |
375 | 66 | * The hook also iterates known peers and removes them if there is | 51 | * The updater also iterates known peers and removes them if there is |
376 | 67 | * no JSON file installed in this path. | 52 | * no JSON file installed in this path. |
377 | 68 | */ | 53 | */ |
378 | 69 | |||
379 | 70 | QVector<QDir> contentDirs; | ||
380 | 71 | |||
381 | 72 | contentDirs.append(QDir( | 54 | contentDirs.append(QDir( |
382 | 73 | QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) | 55 | QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation) |
383 | 74 | + QString("/") | 56 | + QString("/") |
384 | 75 | + QString("content-hub"))); | 57 | + QString("content-hub"))); |
386 | 76 | 58 | ||
387 | 77 | contentDirs.append(QDir("/usr/share/content-hub/peers/")); | 59 | contentDirs.append(QDir("/usr/share/content-hub/peers/")); |
388 | 78 | contentDirs.append(QDir("/usr/share/local/content-hub/peers/")); | 60 | contentDirs.append(QDir("/usr/share/local/content-hub/peers/")); |
389 | 61 | contentDirs.append(QDir("/var/cache/content-hub/peers/")); | ||
390 | 62 | |||
391 | 63 | QStringList dirs; | ||
392 | 64 | Q_FOREACH(QDir d, contentDirs) | ||
393 | 65 | { | ||
394 | 66 | if (d.exists()) | ||
395 | 67 | dirs << d.path(); | ||
396 | 68 | } | ||
397 | 69 | |||
398 | 70 | watcher->addPaths(dirs); | ||
399 | 71 | connect(watcher.data(), SIGNAL(directoryChanged(const QString&)), SLOT(refresh(const QString&))); | ||
400 | 72 | |||
401 | 73 | QTimer::singleShot(200, this, SLOT(run())); | ||
402 | 74 | } | ||
403 | 75 | |||
404 | 76 | cucd::RegistryUpdater::~RegistryUpdater() | ||
405 | 77 | { | ||
406 | 78 | TRACE() << Q_FUNC_INFO; | ||
407 | 79 | } | ||
408 | 80 | |||
409 | 81 | void cucd::RegistryUpdater::refresh(const QString& dir) | ||
410 | 82 | { | ||
411 | 83 | TRACE() << Q_FUNC_INFO << dir; | ||
412 | 84 | bool shouldRefresh = true; | ||
413 | 85 | /* Don't update the registry for temp files */ | ||
414 | 86 | Q_FOREACH(QFileInfo f, QDir(dir).entryInfoList(QDir::Files)) | ||
415 | 87 | { | ||
416 | 88 | if (f.completeSuffix().contains("dpkg-")) | ||
417 | 89 | shouldRefresh = false; | ||
418 | 90 | } | ||
419 | 91 | if (shouldRefresh) | ||
420 | 92 | run(); | ||
421 | 93 | } | ||
422 | 94 | |||
423 | 95 | void cucd::RegistryUpdater::run() | ||
424 | 96 | { | ||
425 | 97 | TRACE() << Q_FUNC_INFO; | ||
426 | 79 | 98 | ||
427 | 80 | QStringList all_peers; | 99 | QStringList all_peers; |
429 | 81 | registry->enumerate_known_peers([&all_peers](const com::ubuntu::content::Peer& peer) | 100 | registry->enumerate_known_peers([&all_peers](const cuc::Peer& peer) |
430 | 82 | { | 101 | { |
431 | 83 | all_peers.append(peer.id()); | 102 | all_peers.append(peer.id()); |
432 | 84 | }); | 103 | }); |
433 | @@ -95,7 +114,7 @@ | |||
434 | 95 | } | 114 | } |
435 | 96 | } | 115 | } |
436 | 97 | if(!foundPeer) { | 116 | if(!foundPeer) { |
438 | 98 | registry->remove_peer(com::ubuntu::content::Peer{p}); | 117 | registry->remove_peer(cuc::Peer{p}); |
439 | 99 | } | 118 | } |
440 | 100 | } | 119 | } |
441 | 101 | 120 | ||
442 | @@ -107,9 +126,10 @@ | |||
443 | 107 | if (contentDir.exists()) | 126 | if (contentDir.exists()) |
444 | 108 | { | 127 | { |
445 | 109 | peerDirsExist = true; | 128 | peerDirsExist = true; |
446 | 110 | |||
447 | 111 | Q_FOREACH(QFileInfo f, contentDir.entryInfoList(QDir::Files)) | 129 | Q_FOREACH(QFileInfo f, contentDir.entryInfoList(QDir::Files)) |
448 | 130 | { | ||
449 | 112 | add_peer(f); | 131 | add_peer(f); |
450 | 132 | } | ||
451 | 113 | } | 133 | } |
452 | 114 | 134 | ||
453 | 115 | } | 135 | } |
454 | @@ -117,13 +137,11 @@ | |||
455 | 117 | if(!peerDirsExist) | 137 | if(!peerDirsExist) |
456 | 118 | return_error("No peer setting directories exist."); | 138 | return_error("No peer setting directories exist."); |
457 | 119 | 139 | ||
458 | 120 | deleteLater(); | ||
459 | 121 | QCoreApplication::instance()->quit(); | ||
460 | 122 | } | 140 | } |
461 | 123 | 141 | ||
463 | 124 | bool cucd::Hook::add_peer(QFileInfo result) | 142 | bool cucd::RegistryUpdater::add_peer(QFileInfo result) |
464 | 125 | { | 143 | { |
466 | 126 | TRACE() << Q_FUNC_INFO << "Hook:" << result.filePath(); | 144 | TRACE() << Q_FUNC_INFO << "RegistryUpdater:" << result.filePath(); |
467 | 127 | 145 | ||
468 | 128 | QStringList knownTypes; | 146 | QStringList knownTypes; |
469 | 129 | knownTypes << "all" << "pictures" << "music" << "contacts" << "documents" << "videos" << "links" << "ebooks" << "text" << "events"; | 147 | knownTypes << "all" << "pictures" << "music" << "contacts" << "documents" << "videos" << "links" << "ebooks" << "text" << "events"; |
470 | @@ -182,7 +200,7 @@ | |||
471 | 182 | return true; | 200 | return true; |
472 | 183 | } | 201 | } |
473 | 184 | 202 | ||
475 | 185 | bool cucd::Hook::return_error(QString err) | 203 | bool cucd::RegistryUpdater::return_error(QString err) |
476 | 186 | { | 204 | { |
477 | 187 | qWarning() << "Failed to install peer" << err; | 205 | qWarning() << "Failed to install peer" << err; |
478 | 188 | return false; | 206 | return false; |
479 | 189 | 207 | ||
480 | === renamed file 'src/com/ubuntu/content/service/hook.h' => 'src/com/ubuntu/content/service/registry-updater.h' | |||
481 | --- src/com/ubuntu/content/service/hook.h 2015-09-23 14:45:09 +0000 | |||
482 | +++ src/com/ubuntu/content/service/registry-updater.h 2017-03-15 13:33:04 +0000 | |||
483 | @@ -1,5 +1,5 @@ | |||
484 | 1 | /* | 1 | /* |
486 | 2 | * Copyright (C) 2013 Canonical, Ltd. | 2 | * Copyright (C) 2013-2017 Canonical, Ltd. |
487 | 3 | * | 3 | * |
488 | 4 | * This program is free software; you can redistribute it and/or modify | 4 | * This program is free software; you can redistribute it and/or modify |
489 | 5 | * it under the terms of the GNU General Public License as published by | 5 | * it under the terms of the GNU General Public License as published by |
490 | @@ -16,8 +16,8 @@ | |||
491 | 16 | * Authored by: Ken VanDine <ken.vandine@canonical.com> | 16 | * Authored by: Ken VanDine <ken.vandine@canonical.com> |
492 | 17 | */ | 17 | */ |
493 | 18 | 18 | ||
496 | 19 | #ifndef HOOK_H | 19 | #ifndef REGISTRY_UPDATER_H |
497 | 20 | #define HOOK_H | 20 | #define REGISTRY_UPDATER_H |
498 | 21 | 21 | ||
499 | 22 | #include <QObject> | 22 | #include <QObject> |
500 | 23 | #include <QFileInfo> | 23 | #include <QFileInfo> |
501 | @@ -33,21 +33,23 @@ | |||
502 | 33 | { | 33 | { |
503 | 34 | namespace detail | 34 | namespace detail |
504 | 35 | { | 35 | { |
506 | 36 | class Hook : public QObject | 36 | class RegistryUpdater : public QObject |
507 | 37 | { | 37 | { |
508 | 38 | Q_OBJECT | 38 | Q_OBJECT |
509 | 39 | public: | 39 | public: |
513 | 40 | explicit Hook(QObject *parent = 0); | 40 | RegistryUpdater(const QSharedPointer<com::ubuntu::content::detail::PeerRegistry>& registry, QObject *parent = 0); |
514 | 41 | Hook(com::ubuntu::content::detail::PeerRegistry *registry, QObject *parent = 0); | 41 | ~RegistryUpdater(); |
512 | 42 | ~Hook(); | ||
515 | 43 | 42 | ||
516 | 44 | public Q_SLOTS: | 43 | public Q_SLOTS: |
517 | 45 | bool return_error(QString err = ""); | 44 | bool return_error(QString err = ""); |
518 | 45 | void refresh(const QString&); | ||
519 | 46 | void run(); | 46 | void run(); |
520 | 47 | bool add_peer(QFileInfo); | 47 | bool add_peer(QFileInfo); |
521 | 48 | 48 | ||
522 | 49 | private: | 49 | private: |
524 | 50 | com::ubuntu::content::detail::PeerRegistry* registry; | 50 | const QSharedPointer<com::ubuntu::content::detail::PeerRegistry>& registry; |
525 | 51 | QVector<QDir> contentDirs; | ||
526 | 52 | QScopedPointer<QFileSystemWatcher> watcher; | ||
527 | 51 | 53 | ||
528 | 52 | }; | 54 | }; |
529 | 53 | } | 55 | } |
530 | @@ -55,4 +57,4 @@ | |||
531 | 55 | } | 57 | } |
532 | 56 | } | 58 | } |
533 | 57 | 59 | ||
535 | 58 | #endif // HOOK_H | 60 | #endif // REGISTRY_UPDATER_H |
536 | 59 | 61 | ||
537 | === modified file 'src/helper/CMakeLists.txt' | |||
538 | --- src/helper/CMakeLists.txt 2016-11-09 17:55:06 +0000 | |||
539 | +++ src/helper/CMakeLists.txt 2017-03-15 13:33:04 +0000 | |||
540 | @@ -21,7 +21,6 @@ | |||
541 | 21 | ${UBUNTU_LAUNCH_INCLUDE_DIRS} | 21 | ${UBUNTU_LAUNCH_INCLUDE_DIRS} |
542 | 22 | ${GIO_INCLUDE_DIRS} | 22 | ${GIO_INCLUDE_DIRS} |
543 | 23 | ${GLIB_INCLUDE_DIRS} | 23 | ${GLIB_INCLUDE_DIRS} |
544 | 24 | ${CLICK_INCLUDE_DIRS} | ||
545 | 25 | ${MIRCLIENT_INCLUDE_DIRS} | 24 | ${MIRCLIENT_INCLUDE_DIRS} |
546 | 26 | ) | 25 | ) |
547 | 27 | 26 | ||
548 | @@ -37,7 +36,6 @@ | |||
549 | 37 | exec-tool | 36 | exec-tool |
550 | 38 | 37 | ||
551 | 39 | ${UBUNTU_LAUNCH_LDFLAGS} | 38 | ${UBUNTU_LAUNCH_LDFLAGS} |
552 | 40 | ${CLICK_LDFLAGS} | ||
553 | 41 | ${GLIB_LDFLAGS} | 39 | ${GLIB_LDFLAGS} |
554 | 42 | ${GIO_LDFLAGS} | 40 | ${GIO_LDFLAGS} |
555 | 43 | ${MIRCLIENT_LDFLAGS} | 41 | ${MIRCLIENT_LDFLAGS} |
556 | 44 | 42 | ||
557 | === modified file 'src/helper/exec-tool.c' | |||
558 | --- src/helper/exec-tool.c 2016-11-09 17:55:06 +0000 | |||
559 | +++ src/helper/exec-tool.c 2017-03-15 13:33:04 +0000 | |||
560 | @@ -18,7 +18,7 @@ | |||
561 | 18 | */ | 18 | */ |
562 | 19 | 19 | ||
563 | 20 | #include <glib.h> | 20 | #include <glib.h> |
565 | 21 | #include <click.h> | 21 | #include <gio/gio.h> |
566 | 22 | #include <ubuntu-app-launch.h> | 22 | #include <ubuntu-app-launch.h> |
567 | 23 | 23 | ||
568 | 24 | gchar * | 24 | gchar * |
569 | @@ -65,7 +65,6 @@ | |||
570 | 65 | gchar * | 65 | gchar * |
571 | 66 | build_dir (const gchar * appid) | 66 | build_dir (const gchar * appid) |
572 | 67 | { | 67 | { |
573 | 68 | GError * error = NULL; | ||
574 | 69 | gchar * package = NULL; | 68 | gchar * package = NULL; |
575 | 70 | 69 | ||
576 | 71 | /* 'Parse' the App ID */ | 70 | /* 'Parse' the App ID */ |
577 | @@ -73,42 +72,9 @@ | |||
578 | 73 | g_warning("Unable to parse App ID: '%s'", appid); | 72 | g_warning("Unable to parse App ID: '%s'", appid); |
579 | 74 | return NULL; | 73 | return NULL; |
580 | 75 | } | 74 | } |
581 | 76 | |||
582 | 77 | /* Check click to find out where the files are */ | ||
583 | 78 | ClickDB * db = click_db_new(); | ||
584 | 79 | |||
585 | 80 | /* If TEST_CLICK_DB is unset, this reads the system database. */ | ||
586 | 81 | click_db_read(db, g_getenv("TEST_CLICK_DB"), &error); | ||
587 | 82 | if (error != NULL) { | ||
588 | 83 | g_warning("Unable to read Click database: %s", error->message); | ||
589 | 84 | g_error_free(error); | ||
590 | 85 | g_free(package); | ||
591 | 86 | return NULL; | ||
592 | 87 | } | ||
593 | 88 | |||
594 | 89 | /* If TEST_CLICK_USER is unset, this uses the current user name. */ | ||
595 | 90 | ClickUser * user = click_user_new_for_user(db, g_getenv("TEST_CLICK_USER"), &error); | ||
596 | 91 | if (error != NULL) { | ||
597 | 92 | g_warning("Unable to read Click database: %s", error->message); | ||
598 | 93 | g_error_free(error); | ||
599 | 94 | g_free(package); | ||
600 | 95 | g_object_unref(db); | ||
601 | 96 | return NULL; | ||
602 | 97 | } | ||
603 | 98 | |||
604 | 99 | gchar * pkgdir = click_user_get_path(user, package, &error); | ||
605 | 100 | |||
606 | 101 | g_object_unref(user); | ||
607 | 102 | g_object_unref(db); | ||
608 | 103 | g_free(package); | 75 | g_free(package); |
609 | 104 | 76 | ||
617 | 105 | if (error != NULL) { | 77 | return NULL; |
611 | 106 | g_warning("Unable to get the Click package directory for %s: %s", package, error->message); | ||
612 | 107 | g_error_free(error); | ||
613 | 108 | return NULL; | ||
614 | 109 | } | ||
615 | 110 | |||
616 | 111 | return pkgdir; | ||
618 | 112 | } | 78 | } |
619 | 113 | 79 | ||
620 | 114 | int | 80 | int |
621 | @@ -136,13 +102,6 @@ | |||
622 | 136 | exec = build_exec(appid, SYSTEM_DIRECTORY); | 102 | exec = build_exec(appid, SYSTEM_DIRECTORY); |
623 | 137 | } | 103 | } |
624 | 138 | 104 | ||
625 | 139 | /* If not there look to the user directory (click) */ | ||
626 | 140 | if (exec == NULL) { | ||
627 | 141 | gchar * userdir = g_build_filename(g_get_user_cache_dir(), "ubuntu-app-launch", "desktop", NULL); | ||
628 | 142 | exec = build_exec(appid, userdir); | ||
629 | 143 | g_free(userdir); | ||
630 | 144 | } | ||
631 | 145 | |||
632 | 146 | if (exec == NULL) { | 105 | if (exec == NULL) { |
633 | 147 | const gchar * props[3] = { | 106 | const gchar * props[3] = { |
634 | 148 | "AppID", | 107 | "AppID", |
635 | 149 | 108 | ||
636 | === modified file 'tests/acceptance-tests/CMakeLists.txt' | |||
637 | --- tests/acceptance-tests/CMakeLists.txt 2017-01-04 16:16:00 +0000 | |||
638 | +++ tests/acceptance-tests/CMakeLists.txt 2017-03-15 13:33:04 +0000 | |||
639 | @@ -71,25 +71,25 @@ | |||
640 | 71 | endforeach(test) | 71 | endforeach(test) |
641 | 72 | 72 | ||
642 | 73 | add_executable( | 73 | add_executable( |
645 | 74 | test_hook | 74 | test_registry_updater |
646 | 75 | test_hook.cpp | 75 | test_registry_updater.cpp |
647 | 76 | ${MOCS} | 76 | ${MOCS} |
649 | 77 | ${CMAKE_SOURCE_DIR}/src/com/ubuntu/content/service/hook.cpp | 77 | ${CMAKE_SOURCE_DIR}/src/com/ubuntu/content/service/registry-updater.cpp |
650 | 78 | ${CMAKE_SOURCE_DIR}/src/com/ubuntu/content/service/registry.cpp | 78 | ${CMAKE_SOURCE_DIR}/src/com/ubuntu/content/service/registry.cpp |
651 | 79 | good.json | 79 | good.json |
652 | 80 | bad.json | 80 | bad.json |
653 | 81 | source_all.json | 81 | source_all.json |
654 | 82 | ) | 82 | ) |
655 | 83 | 83 | ||
659 | 84 | qt5_use_modules(test_hook Core Gui DBus Test) | 84 | qt5_use_modules(test_registry_updater Core Gui DBus Test) |
660 | 85 | target_link_libraries(test_hook content-hub ${GTEST_ALL_LIBRARIES} ${GSETTINGS_LDFLAGS}) | 85 | target_link_libraries(test_registry_updater content-hub ${GTEST_ALL_LIBRARIES} ${GSETTINGS_LDFLAGS}) |
661 | 86 | add_test(NAME test_hook COMMAND dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/test_hook) | 86 | add_test(NAME test_registry_updater COMMAND dbus-test-runner --task ${CMAKE_CURRENT_BINARY_DIR}/test_registry_updater) |
662 | 87 | 87 | ||
664 | 88 | SET_TESTS_PROPERTIES(test_hook | 88 | SET_TESTS_PROPERTIES(test_registry_updater |
665 | 89 | PROPERTIES ENVIRONMENT "CONTENT_HUB_TESTING=1") | 89 | PROPERTIES ENVIRONMENT "CONTENT_HUB_TESTING=1") |
666 | 90 | 90 | ||
667 | 91 | set_target_properties( | 91 | set_target_properties( |
669 | 92 | test_hook | 92 | test_registry_updater |
670 | 93 | PROPERTIES | 93 | PROPERTIES |
671 | 94 | AUTOMOC TRUE | 94 | AUTOMOC TRUE |
672 | 95 | ) | 95 | ) |
673 | 96 | 96 | ||
674 | === renamed file 'tests/acceptance-tests/test_hook.cpp' => 'tests/acceptance-tests/test_registry_updater.cpp' | |||
675 | --- tests/acceptance-tests/test_hook.cpp 2015-10-20 20:23:09 +0000 | |||
676 | +++ tests/acceptance-tests/test_registry_updater.cpp 2017-03-15 13:33:04 +0000 | |||
677 | @@ -19,7 +19,7 @@ | |||
678 | 19 | #include <com/ubuntu/content/peer.h> | 19 | #include <com/ubuntu/content/peer.h> |
679 | 20 | #include <com/ubuntu/content/type.h> | 20 | #include <com/ubuntu/content/type.h> |
680 | 21 | #include "com/ubuntu/content/detail/peer_registry.h" | 21 | #include "com/ubuntu/content/detail/peer_registry.h" |
682 | 22 | #include "com/ubuntu/content/service/hook.h" | 22 | #include "com/ubuntu/content/service/registry-updater.h" |
683 | 23 | 23 | ||
684 | 24 | #include <gmock/gmock.h> | 24 | #include <gmock/gmock.h> |
685 | 25 | #include <gtest/gtest.h> | 25 | #include <gtest/gtest.h> |
686 | @@ -60,7 +60,7 @@ | |||
687 | 60 | }; | 60 | }; |
688 | 61 | } | 61 | } |
689 | 62 | 62 | ||
691 | 63 | TEST(Hook, parse_json) | 63 | TEST(RegistryUpdater, parse_json) |
692 | 64 | { | 64 | { |
693 | 65 | using namespace ::testing; | 65 | using namespace ::testing; |
694 | 66 | 66 | ||
695 | @@ -70,12 +70,13 @@ | |||
696 | 70 | WillRepeatedly(Return(true)); | 70 | WillRepeatedly(Return(true)); |
697 | 71 | 71 | ||
698 | 72 | QFileInfo f("good.json"); | 72 | QFileInfo f("good.json"); |
700 | 73 | cucd::Hook *hook = new cucd::Hook(mock); | 73 | auto mock_ptr = QSharedPointer<cuc::detail::PeerRegistry>(mock); |
701 | 74 | cucd::RegistryUpdater *updater = new cucd::RegistryUpdater(mock_ptr); | ||
702 | 74 | 75 | ||
704 | 75 | EXPECT_TRUE(hook->add_peer(f)); | 76 | EXPECT_TRUE(updater->add_peer(f)); |
705 | 76 | f.setFile("bad.json"); | 77 | f.setFile("bad.json"); |
707 | 77 | EXPECT_FALSE(hook->add_peer(f)); | 78 | EXPECT_FALSE(updater->add_peer(f)); |
708 | 78 | f.setFile("source_all.json"); | 79 | f.setFile("source_all.json"); |
711 | 79 | EXPECT_TRUE(hook->add_peer(f)); | 80 | EXPECT_TRUE(updater->add_peer(f)); |
712 | 80 | delete mock; | 81 | mock_ptr.clear(); |
713 | 81 | } | 82 | } |
714 | 82 | 83 | ||
715 | === modified file 'tools/peer-picker/content-hub-peer-picker.desktop' | |||
716 | --- tools/peer-picker/content-hub-peer-picker.desktop 2016-11-16 18:25:30 +0000 | |||
717 | +++ tools/peer-picker/content-hub-peer-picker.desktop 2017-03-15 13:33:04 +0000 | |||
718 | @@ -6,7 +6,7 @@ | |||
719 | 6 | Icon= | 6 | Icon= |
720 | 7 | Terminal=false | 7 | Terminal=false |
721 | 8 | Type=Application | 8 | Type=Application |
723 | 9 | OnlyShowIn=Old | 9 | NoDisplay=true |
724 | 10 | X-Ubuntu-Touch=true | 10 | X-Ubuntu-Touch=true |
725 | 11 | X-Ubuntu-Single-Instance=false | 11 | X-Ubuntu-Single-Instance=false |
726 | 12 | X-Ubuntu-Splash-Show-Header=true | 12 | X-Ubuntu-Splash-Show-Header=true |
727 | 13 | 13 | ||
728 | === modified file 'tools/send/content-hub-send.desktop' | |||
729 | --- tools/send/content-hub-send.desktop 2015-04-20 23:17:37 +0000 | |||
730 | +++ tools/send/content-hub-send.desktop 2017-03-15 13:33:04 +0000 | |||
731 | @@ -5,5 +5,5 @@ | |||
732 | 5 | Icon= | 5 | Icon= |
733 | 6 | Terminal=false | 6 | Terminal=false |
734 | 7 | Type=Application | 7 | Type=Application |
736 | 8 | OnlyShowIn=Old | 8 | NoDisplay=true |
737 | 9 | X-Ubuntu-Touch=true | 9 | X-Ubuntu-Touch=true |
FAILED: Continuous integration, rev:329 /jenkins. canonical. com/system- apps/job/ lp-content- hub-ci/ 5/ /jenkins. canonical. com/system- apps/job/ build/2308/ console /jenkins. canonical. com/system- apps/job/ build-0- fetch/2307 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= xenial+ overlay/ 2128/console /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=amd64, release= zesty/2128/ console /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 2128 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= xenial+ overlay/ 2128/artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= zesty/2128 /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=armhf, release= zesty/2128/ artifact/ output/ *zip*/output. zip /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= xenial+ overlay/ 2128/console /jenkins. canonical. com/system- apps/job/ build-2- binpkg/ arch=i386, release= zesty/2128/ console
https:/
Executed test runs:
FAILURE: https:/
SUCCESS: https:/
FAILURE: https:/
FAILURE: https:/
SUCCESS: https:/
deb: https:/
SUCCESS: https:/
deb: https:/
FAILURE: https:/
FAILURE: https:/
Click here to trigger a rebuild: /jenkins. canonical. com/system- apps/job/ lp-content- hub-ci/ 5/rebuild
https:/