Merge lp:~unity-team/unity-scope-mediascanner/click-support into lp:unity-scope-mediascanner/rtm-14.09
- click-support
- Merge into rtm-14.09
Proposed by
Paweł Stołowski
Status: | Merged |
---|---|
Approved by: | James Henstridge |
Approved revision: | 194 |
Merged at revision: | 199 |
Proposed branch: | lp:~unity-team/unity-scope-mediascanner/click-support |
Merge into: | lp:unity-scope-mediascanner/rtm-14.09 |
Diff against target: |
1064 lines (+450/-162) 38 files modified
CMakeLists.txt (+16/-10) cmake/ClickBuild.cmake (+43/-0) cmake/ClickScope.cmake (+33/-0) cmake/Intltool.cmake (+17/-0) config.h.in (+3/-0) data/CMakeLists.txt (+0/-49) po/CMakeLists.txt (+20/-10) src/CMakeLists.txt (+0/-50) src/musicaggregator/CMakeLists.txt (+39/-0) src/musicaggregator/apparmor.json (+5/-0) src/musicaggregator/manifest.json.in (+16/-0) src/musicaggregator/musicaggregator.ini.in (+2/-3) src/musicaggregator/musicaggregatorquery.cpp (+3/-3) src/musicaggregator/musicaggregatorscope.cpp (+7/-1) src/musicaggregator/onlinemusicresultforwarder.h (+1/-1) src/mymusic/CMakeLists.txt (+29/-0) src/mymusic/apparmor.json (+5/-0) src/mymusic/manifest.json.in (+16/-0) src/mymusic/mediascanner-music.ini.in (+2/-6) src/mymusic/music-scope.cpp (+2/-2) src/myvideos/CMakeLists.txt (+29/-0) src/myvideos/apparmor.json (+5/-0) src/myvideos/manifest.json.in (+16/-0) src/myvideos/mediascanner-video.ini.in (+2/-5) src/myvideos/video-scope.cpp (+2/-2) src/utils/CMakeLists.txt (+11/-0) src/utils/i18n.cpp (+32/-0) src/utils/i18n.h (+8/-0) src/videoaggregator/CMakeLists.txt (+37/-0) src/videoaggregator/apparmor.json (+5/-0) src/videoaggregator/manifest.json.in (+16/-0) src/videoaggregator/videoaggregator.ini.in (+2/-2) src/videoaggregator/videoaggregatorquery.cpp (+3/-3) src/videoaggregator/videoaggregatorscope.cpp (+7/-1) tests/CMakeLists.txt (+9/-9) tests/test-music-scope.cpp (+2/-1) tests/test-result-forwarder.cpp (+3/-3) tests/test-video-scope.cpp (+2/-1) |
To merge this branch: | bzr merge lp:~unity-team/unity-scope-mediascanner/click-support |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Henstridge | Approve | ||
Review via email: mp+241587@code.launchpad.net |
This proposal supersedes a proposal from 2014-10-30.
Commit message
Add support for building as click packages.
Description of the change
Add support for building as click packages. Original merge proposal can be found here:
https:/
To post a comment you must log in.
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 2014-09-16 15:45:31 +0000 |
3 | +++ CMakeLists.txt 2014-11-12 17:34:14 +0000 |
4 | @@ -1,5 +1,8 @@ |
5 | project(unity-scope-mediascanner C CXX) |
6 | cmake_minimum_required(VERSION 2.8.9) |
7 | +set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}") |
8 | + |
9 | +set(VERSION 0.3) |
10 | |
11 | find_package(PkgConfig REQUIRED) |
12 | find_package(Threads REQUIRED) |
13 | @@ -15,15 +18,10 @@ |
14 | |
15 | find_program(XGETTEXT_BIN xgettext) |
16 | find_program(MSGFMT_BIN msgfmt) |
17 | -find_program(INTLTOOL_EXTRACT_BIN intltool-extract) |
18 | -find_program(INTLTOOL_MERGE_BIN intltool-merge) |
19 | |
20 | if(NOT MSGFMT_BIN) |
21 | message(FATAL_ERROR "Gettext binaries not found.") |
22 | endif() |
23 | -if(NOT INTLTOOL_MERGE_BIN) |
24 | - message(FATAL_ERROR "Intltool binaries not found.") |
25 | -endif() |
26 | |
27 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wmissing-prototypes -pedantic -std=c99") |
28 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -Wmissing-declarations -pedantic -std=c++11") |
29 | @@ -34,6 +32,9 @@ |
30 | set(SOURCE_BINARY_DIR "${CMAKE_CURRENT_BINARY_DIR}/src") |
31 | |
32 | include(GNUInstallDirs) |
33 | +include(ClickBuild) |
34 | +include(ClickScope) |
35 | +include(Intltool) |
36 | |
37 | set(GETTEXT_PACKAGE unity-scope-mediascanner) |
38 | |
39 | @@ -44,9 +45,14 @@ |
40 | include_directories(${CMAKE_CURRENT_BINARY_DIR}) |
41 | |
42 | add_subdirectory("po") |
43 | -add_subdirectory("src") |
44 | -add_subdirectory("data") |
45 | +add_subdirectory("src/utils") |
46 | +add_subdirectory("src/musicaggregator") |
47 | +add_subdirectory("src/videoaggregator") |
48 | +add_subdirectory("src/mymusic") |
49 | +add_subdirectory("src/myvideos") |
50 | |
51 | -enable_testing() |
52 | -add_subdirectory("tests") |
53 | -add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -V --output-on-failure) |
54 | +if(NOT CMAKE_CROSSCOMPILING) |
55 | + enable_testing() |
56 | + add_subdirectory("tests") |
57 | + add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -V --output-on-failure) |
58 | +endif() |
59 | |
60 | === added directory 'cmake' |
61 | === added file 'cmake/ClickBuild.cmake' |
62 | --- cmake/ClickBuild.cmake 1970-01-01 00:00:00 +0000 |
63 | +++ cmake/ClickBuild.cmake 2014-11-12 17:34:14 +0000 |
64 | @@ -0,0 +1,43 @@ |
65 | +set(CLICK_MODE OFF CACHE BOOL "Whether to install in click mode") |
66 | + |
67 | +# Add top level target to build all click packages |
68 | +add_custom_target(click COMMENT Build click packages) |
69 | +find_program(click_bin click) |
70 | + |
71 | +# Determine the architecture for the Click package based on the compiler target. |
72 | +execute_process( |
73 | + COMMAND ${CMAKE_C_COMPILER} -dumpmachine |
74 | + OUTPUT_VARIABLE _cc_arch) |
75 | +set(_click_arch "unknown") |
76 | +if(${_cc_arch} MATCHES "^x86_64-.*") |
77 | + set(_click_arch "amd64") |
78 | +elseif(${_cc_arch} MATCHES "^i.86-.*") |
79 | + set(_click_arch "amd64") |
80 | +elseif(${_cc_arch} MATCHES "^arm-.*") |
81 | + set(_click_arch "armhf") |
82 | +endif() |
83 | +set(CLICK_ARCH "${_click_arch}" CACHE STRING "Click package architecture") |
84 | + |
85 | +macro(click_build _pkg _version _manifest _apparmor) |
86 | + set(_builddir ${CMAKE_INSTALL_PREFIX}/${_pkg}) |
87 | + |
88 | + add_custom_target( |
89 | + ${_pkg}.click |
90 | + COMMAND ${click_bin} build ${_builddir} |
91 | + WORKING_DIRECTORY ${CMAKE_INSTALL_PREFIX}) |
92 | + set_target_properties(${_pkg}.click PROPERTIES |
93 | + OUTPUT_NAME ${_pkg}_${_version}_${CLICK_ARCH}.click |
94 | + CLICK_DIR ${_builddir}) |
95 | + add_dependencies(click ${_pkg}.click) |
96 | + |
97 | + install( |
98 | + FILES ${_manifest} |
99 | + DESTINATION "${_builddir}" |
100 | + RENAME manifest.json |
101 | + COMPONENT "${_pkg}") |
102 | + install( |
103 | + FILES ${_apparmor} |
104 | + DESTINATION "${_builddir}" |
105 | + RENAME apparmor.json |
106 | + COMPONENT "${_pkg}") |
107 | +endmacro(click_build) |
108 | |
109 | === added file 'cmake/ClickScope.cmake' |
110 | --- cmake/ClickScope.cmake 1970-01-01 00:00:00 +0000 |
111 | +++ cmake/ClickScope.cmake 2014-11-12 17:34:14 +0000 |
112 | @@ -0,0 +1,33 @@ |
113 | +macro(click_scope _pkg _scopename _library _config) |
114 | + set(_fullname ${_pkg}_${_scopename}) |
115 | + get_target_property(_builddir ${_pkg}.click CLICK_DIR) |
116 | + |
117 | + set_target_properties(${_library} PROPERTIES |
118 | + OUTPUT_NAME "${_fullname}") |
119 | + install( |
120 | + TARGETS ${_library} |
121 | + DESTINATION "${_builddir}/${_scopename}" |
122 | + COMPONENT "${_pkg}") |
123 | + install( |
124 | + FILES ${_config} |
125 | + DESTINATION "${_builddir}/${_scopename}" |
126 | + RENAME "${_fullname}.ini" |
127 | + COMPONENT "${_pkg}") |
128 | + |
129 | + if(${ARGC} EQUAL 5) |
130 | + set(_settings ${ARGV4}) |
131 | + install( |
132 | + FILES ${_settings} |
133 | + DESTINATION "${_builddir}/${_scopename}" |
134 | + RENAME "${_fullname}-settings.ini" |
135 | + COMPONENT "${_pkg}") |
136 | + endif() |
137 | +endmacro(click_scope) |
138 | + |
139 | +macro(click_scope_data _pkg _scopename) |
140 | + get_target_property(_builddir ${_pkg}.click CLICK_DIR) |
141 | + install( |
142 | + FILES ${ARGN} |
143 | + DESTINATION "${_builddir}/${_scopename}" |
144 | + COMPONENT "${_pkg}") |
145 | +endmacro(click_scope_data) |
146 | |
147 | === added file 'cmake/Intltool.cmake' |
148 | --- cmake/Intltool.cmake 1970-01-01 00:00:00 +0000 |
149 | +++ cmake/Intltool.cmake 2014-11-12 17:34:14 +0000 |
150 | @@ -0,0 +1,17 @@ |
151 | + |
152 | +find_program(INTLTOOL_EXTRACT_BIN intltool-extract) |
153 | +find_program(INTLTOOL_MERGE_BIN intltool-merge) |
154 | + |
155 | +if(NOT INTLTOOL_MERGE_BIN) |
156 | + message(FATAL_ERROR "Intltool binaries not found.") |
157 | +endif() |
158 | + |
159 | +add_custom_target(intltool-merge ALL) |
160 | + |
161 | +macro(intltool_merge _source _dest) |
162 | + add_custom_target( |
163 | + ${_dest} |
164 | + COMMAND ${INTLTOOL_MERGE_BIN} -d ${CMAKE_SOURCE_DIR}/po ${_source} ${_dest} |
165 | + DEPENDS ${_source}) |
166 | + add_dependencies(intltool-merge ${_dest}) |
167 | +endmacro(intltool_merge) |
168 | |
169 | === modified file 'config.h.in' |
170 | --- config.h.in 2013-08-01 04:36:38 +0000 |
171 | +++ config.h.in 2014-11-12 17:34:14 +0000 |
172 | @@ -2,5 +2,8 @@ |
173 | #define _CONFIG_H |
174 | |
175 | #define GETTEXT_PACKAGE "@GETTEXT_PACKAGE@" |
176 | +#cmakedefine CLICK_MODE |
177 | + |
178 | +#define LOCALE_DIR "@CMAKE_INSTALL_FULL_DATADIR@/locale" |
179 | |
180 | #endif |
181 | |
182 | === removed directory 'data' |
183 | === removed file 'data/CMakeLists.txt' |
184 | --- data/CMakeLists.txt 2014-10-03 13:25:48 +0000 |
185 | +++ data/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
186 | @@ -1,49 +0,0 @@ |
187 | - |
188 | -# Unity Scope files |
189 | -set(SCOPES_DATADIR "${CMAKE_INSTALL_FULL_DATADIR}/unity/scopes") |
190 | -set(SCOPES_LIBDIR "${CMAKE_INSTALL_FULL_LIBDIR}/unity-scopes") |
191 | - |
192 | -set(SCOPE_CONFIG_FILES |
193 | - mediascanner-music.ini |
194 | - mediascanner-video.ini |
195 | - musicaggregator.ini |
196 | - musicaggregator-settings.ini |
197 | - videoaggregator.ini |
198 | - videoaggregator-settings.ini |
199 | -) |
200 | - |
201 | -foreach(configfile ${SCOPE_CONFIG_FILES}) |
202 | - configure_file(${configfile}.in.in ${configfile}.in) |
203 | - get_filename_component(basename ${configfile} NAME_WE) |
204 | - string(REPLACE "-settings" "" basename ${basename}) |
205 | - install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${configfile}" |
206 | - DESTINATION "${SCOPES_LIBDIR}/${basename}") |
207 | - add_custom_command(OUTPUT ${configfile} COMMAND ${INTLTOOL_MERGE_BIN} -d ${CMAKE_CURRENT_SOURCE_DIR}/../po ${configfile}.in ${configfile}) |
208 | -endforeach() |
209 | - |
210 | -add_custom_target(ini-i18n ALL DEPENDS ${SCOPE_CONFIG_FILES}) |
211 | - |
212 | -install( |
213 | - FILES music.png music-scope.png mediascanner-music-screenshot.jpg |
214 | - DESTINATION "${SCOPES_DATADIR}/mediascanner-music" |
215 | -) |
216 | - |
217 | -install( |
218 | - FILES video.png video-scope.png mediascanner-video-screenshot.jpg |
219 | - DESTINATION "${SCOPES_DATADIR}/mediascanner-video" |
220 | -) |
221 | - |
222 | -install( |
223 | - FILES musicaggregator-screenshot.jpg |
224 | - DESTINATION "${SCOPES_DATADIR}/musicaggregator" |
225 | -) |
226 | - |
227 | -install( |
228 | - FILES videoaggregator-screenshot.jpg |
229 | - DESTINATION "${SCOPES_DATADIR}/videoaggregator" |
230 | -) |
231 | - |
232 | -install( |
233 | - FILES paper-white-bg-v2.png |
234 | - DESTINATION "${SCOPES_DATADIR}" |
235 | -) |
236 | |
237 | === removed file 'data/music.png' |
238 | Binary files data/music.png 2014-02-20 11:24:59 +0000 and data/music.png 1970-01-01 00:00:00 +0000 differ |
239 | === removed file 'data/video.png' |
240 | Binary files data/video.png 2014-02-20 11:24:59 +0000 and data/video.png 1970-01-01 00:00:00 +0000 differ |
241 | === modified file 'po/CMakeLists.txt' |
242 | --- po/CMakeLists.txt 2014-04-30 09:50:27 +0000 |
243 | +++ po/CMakeLists.txt 2014-11-12 17:34:14 +0000 |
244 | @@ -1,7 +1,7 @@ |
245 | -file(GLOB CPPFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" |
246 | - "${CMAKE_SOURCE_DIR}/src/*.cpp") |
247 | -file(GLOB INIFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" |
248 | - "${CMAKE_SOURCE_DIR}/data/*.ini.in.in") |
249 | +file(GLOB_RECURSE CPPFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" |
250 | + "${CMAKE_SOURCE_DIR}/src/*.cpp") |
251 | +file(GLOB_RECURSE INIFILES RELATIVE "${CMAKE_CURRENT_SOURCE_DIR}" |
252 | + "${CMAKE_SOURCE_DIR}/src/*.ini.in") |
253 | |
254 | foreach(inifile ${INIFILES}) |
255 | get_filename_component(fname ${inifile} NAME) |
256 | @@ -29,9 +29,6 @@ |
257 | DEPENDS pot-ini |
258 | ) |
259 | |
260 | -file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale) |
261 | -install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/locale DESTINATION share) |
262 | - |
263 | file(GLOB pofiles *.po) |
264 | foreach(f ${pofiles}) |
265 | get_filename_component(pofile ${f} NAME_WE) |
266 | @@ -44,8 +41,21 @@ |
267 | DEPENDS ${i}.po |
268 | ) |
269 | add_custom_target(${i}gen ALL DEPENDS ${i}.mo) |
270 | - install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${i}.mo |
271 | - DESTINATION share/locale/${i}/LC_MESSAGES |
272 | - RENAME ${GETTEXT_PACKAGE}.mo) |
273 | + |
274 | + if(CLICK_MODE) |
275 | + foreach(clickpkg |
276 | + com.ubuntu.scopes.mymusic |
277 | + com.ubuntu.scopes.myvideos |
278 | + com.ubuntu.scopes.music |
279 | + com.ubuntu.scopes.video) |
280 | + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${i}.mo |
281 | + DESTINATION ${clickpkg}/locale/${i}/LC_MESSAGES |
282 | + RENAME ${GETTEXT_PACKAGE}.mo) |
283 | + endforeach() |
284 | + else() |
285 | + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/${i}.mo |
286 | + DESTINATION share/locale/${i}/LC_MESSAGES |
287 | + RENAME ${GETTEXT_PACKAGE}.mo) |
288 | + endif(CLICK_MODE) |
289 | endforeach() |
290 | |
291 | |
292 | === removed file 'src/CMakeLists.txt' |
293 | --- src/CMakeLists.txt 2014-09-16 15:45:31 +0000 |
294 | +++ src/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
295 | @@ -1,50 +0,0 @@ |
296 | -set(SCOPE_SOURCES |
297 | - main.cpp |
298 | - base-scope.cpp |
299 | - music-scope.cpp |
300 | - video-scope.cpp |
301 | -) |
302 | - |
303 | -include_directories(${UNITY_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) |
304 | - |
305 | -add_library(mediascanner-music MODULE music-scope.cpp) |
306 | -#set_target_properties(mediascanner-music PROPERTIES PREFIX "") |
307 | -target_link_libraries(mediascanner-music ${UNITY_LDFLAGS} |
308 | - ${GIO_DEPS_LDFLAGS} |
309 | -) |
310 | - |
311 | -add_library(mediascanner-video MODULE video-scope.cpp) |
312 | -#set_target_properties(mediascanner-video PROPERTIES PREFIX "") |
313 | -target_link_libraries(mediascanner-video ${UNITY_LDFLAGS} ${Boost_LIBRARIES}) |
314 | - |
315 | -add_library(musicaggregator SHARED |
316 | -musicaggregatorscope.cpp |
317 | -musicaggregatorquery.cpp |
318 | -resultforwarder.cpp |
319 | -onlinemusicresultforwarder.cpp |
320 | -bufferedresultforwarder.cpp |
321 | -notify-strategy.cpp) |
322 | -target_link_libraries(musicaggregator ${UNITY_SCOPES_LDFLAGS}) |
323 | - |
324 | -add_library(videoaggregator SHARED |
325 | -videoaggregatorscope.cpp |
326 | -videoaggregatorquery.cpp |
327 | -resultforwarder.cpp |
328 | -bufferedresultforwarder.cpp |
329 | -notify-strategy.cpp) |
330 | -target_link_libraries(videoaggregator ${UNITY_SCOPES_LDFLAGS}) |
331 | - |
332 | -install( |
333 | - TARGETS mediascanner-music |
334 | - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/unity-scopes/mediascanner-music") |
335 | - |
336 | -install( |
337 | - TARGETS mediascanner-video |
338 | - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/unity-scopes/mediascanner-video") |
339 | - |
340 | -install(TARGETS musicaggregator |
341 | - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/unity-scopes/musicaggregator") |
342 | - |
343 | - install(TARGETS videoaggregator |
344 | - LIBRARY DESTINATION "${CMAKE_INSTALL_LIBDIR}/unity-scopes/videoaggregator") |
345 | - |
346 | |
347 | === added directory 'src/musicaggregator' |
348 | === added file 'src/musicaggregator/CMakeLists.txt' |
349 | --- src/musicaggregator/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
350 | +++ src/musicaggregator/CMakeLists.txt 2014-11-12 17:34:14 +0000 |
351 | @@ -0,0 +1,39 @@ |
352 | +include_directories(${UNITY_INCLUDE_DIRS}) |
353 | + |
354 | +add_library(musicaggregator MODULE |
355 | + musicaggregatorscope.cpp |
356 | + musicaggregatorquery.cpp |
357 | + onlinemusicresultforwarder.cpp) |
358 | +target_link_libraries(musicaggregator scope-utils ${UNITY_SCOPES_LDFLAGS}) |
359 | + |
360 | +configure_file(manifest.json.in manifest.json) |
361 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/musicaggregator.ini.in musicaggregator.ini) |
362 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/musicaggregator-settings.ini.in musicaggregator-settings.ini) |
363 | + |
364 | +if(CLICK_MODE) |
365 | + click_build(com.ubuntu.scopes.music ${VERSION} |
366 | + ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json) |
367 | + click_scope(com.ubuntu.scopes.music musicaggregator |
368 | + musicaggregator |
369 | + ${CMAKE_CURRENT_BINARY_DIR}/musicaggregator.ini |
370 | + ${CMAKE_CURRENT_BINARY_DIR}/musicaggregator-settings.ini) |
371 | + click_scope_data(com.ubuntu.scopes.music musicaggregator |
372 | + screenshot.jpg |
373 | + icon.png |
374 | + paper-white-bg-v2.png |
375 | + ) |
376 | +else() |
377 | + set(scopedir "${CMAKE_INSTALL_LIBDIR}/unity-scopes/musicaggregator") |
378 | + install( |
379 | + TARGETS musicaggregator |
380 | + LIBRARY DESTINATION "${scopedir}") |
381 | + install( |
382 | + FILES |
383 | + ${CMAKE_CURRENT_BINARY_DIR}/musicaggregator.ini |
384 | + ${CMAKE_CURRENT_BINARY_DIR}/musicaggregator-settings.ini |
385 | + screenshot.jpg |
386 | + icon.png |
387 | + paper-white-bg-v2.png |
388 | + DESTINATION "${scopedir}") |
389 | +endif(CLICK_MODE) |
390 | + |
391 | |
392 | === added file 'src/musicaggregator/apparmor.json' |
393 | --- src/musicaggregator/apparmor.json 1970-01-01 00:00:00 +0000 |
394 | +++ src/musicaggregator/apparmor.json 2014-11-12 17:34:14 +0000 |
395 | @@ -0,0 +1,5 @@ |
396 | +{ |
397 | + "template": "unconfined", |
398 | + "policy_groups": [], |
399 | + "policy_version": 1.2 |
400 | +} |
401 | |
402 | === added file 'src/musicaggregator/icon.png' |
403 | Binary files src/musicaggregator/icon.png 1970-01-01 00:00:00 +0000 and src/musicaggregator/icon.png 2014-11-12 17:34:14 +0000 differ |
404 | === added file 'src/musicaggregator/manifest.json.in' |
405 | --- src/musicaggregator/manifest.json.in 1970-01-01 00:00:00 +0000 |
406 | +++ src/musicaggregator/manifest.json.in 2014-11-12 17:34:14 +0000 |
407 | @@ -0,0 +1,16 @@ |
408 | +{ |
409 | + "description": "Music scope", |
410 | + "framework": "ubuntu-sdk-14.10-dev2", |
411 | + "architecture": "@CLICK_ARCH@", |
412 | + "hooks": { |
413 | + "musicaggregator": { |
414 | + "scope": "musicaggregator", |
415 | + "apparmor": "apparmor.json" |
416 | + } |
417 | + }, |
418 | + "icon": "musicaggregator/icon.png", |
419 | + "maintainer": "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>", |
420 | + "name": "com.ubuntu.scopes.music", |
421 | + "title": "Music scope", |
422 | + "version": "@VERSION@" |
423 | +} |
424 | |
425 | === renamed file 'data/musicaggregator-settings.ini.in.in' => 'src/musicaggregator/musicaggregator-settings.ini.in' |
426 | === renamed file 'data/musicaggregator.ini.in.in' => 'src/musicaggregator/musicaggregator.ini.in' |
427 | --- data/musicaggregator.ini.in.in 2014-11-10 16:15:39 +0000 |
428 | +++ src/musicaggregator/musicaggregator.ini.in 2014-11-12 17:34:14 +0000 |
429 | @@ -2,8 +2,8 @@ |
430 | _DisplayName=Music |
431 | _Description=This is an Ubuntu search plugin that merges all music sources into one. |
432 | Author=Canonical Ltd. |
433 | -Art=@SCOPES_DATADIR@/musicaggregator/musicaggregator-screenshot.jpg |
434 | -Icon=@SCOPES_DATADIR@/mediascanner-music/music-scope.png |
435 | +Art=./screenshot.jpg |
436 | +Icon=./icon.png |
437 | _SearchHint=Search music |
438 | HotKey= |
439 | LocationDataNeeded=true |
440 | @@ -13,4 +13,3 @@ |
441 | |
442 | [Desktop Entry] |
443 | X-Ubuntu-Gettext-Domain=unity-scope-musicaggregator |
444 | - |
445 | |
446 | === renamed file 'src/musicaggregatorquery.cpp' => 'src/musicaggregator/musicaggregatorquery.cpp' |
447 | --- src/musicaggregatorquery.cpp 2014-10-07 10:42:31 +0000 |
448 | +++ src/musicaggregator/musicaggregatorquery.cpp 2014-11-12 17:34:14 +0000 |
449 | @@ -21,10 +21,10 @@ |
450 | #include <config.h> |
451 | #include "musicaggregatorquery.h" |
452 | #include "musicaggregatorscope.h" |
453 | -#include "resultforwarder.h" |
454 | +#include "../utils/resultforwarder.h" |
455 | #include "onlinemusicresultforwarder.h" |
456 | -#include "notify-strategy.h" |
457 | -#include "i18n.h" |
458 | +#include "../utils/notify-strategy.h" |
459 | +#include "../utils/i18n.h" |
460 | #include <memory> |
461 | |
462 | #include <unity/scopes/Annotation.h> |
463 | |
464 | === renamed file 'src/musicaggregatorquery.h' => 'src/musicaggregator/musicaggregatorquery.h' |
465 | === renamed file 'src/musicaggregatorscope.cpp' => 'src/musicaggregator/musicaggregatorscope.cpp' |
466 | --- src/musicaggregatorscope.cpp 2014-09-15 07:26:58 +0000 |
467 | +++ src/musicaggregator/musicaggregatorscope.cpp 2014-11-12 17:34:14 +0000 |
468 | @@ -17,6 +17,7 @@ |
469 | * |
470 | */ |
471 | |
472 | +#include <config.h> |
473 | #include "musicaggregatorscope.h" |
474 | #include "musicaggregatorquery.h" |
475 | #include <unity/scopes/Registry.h> |
476 | @@ -24,17 +25,22 @@ |
477 | #include <unity/scopes/CategoryRenderer.h> |
478 | #include <vector> |
479 | #include <iostream> |
480 | +#include "../utils/i18n.h" |
481 | |
482 | using namespace unity::scopes; |
483 | |
484 | +#ifdef CLICK_MODE |
485 | +const std::string MusicAggregatorScope::LOCALSCOPE = "com.ubuntu.scopes.mymusic_mymusic"; |
486 | +#else |
487 | const std::string MusicAggregatorScope::LOCALSCOPE = "mediascanner-music"; |
488 | +#endif |
489 | const std::string MusicAggregatorScope::GROOVESHARKSCOPE = "com.canonical.scopes.grooveshark"; |
490 | const std::string MusicAggregatorScope::SEVENDIGITAL = "com.canonical.scopes.sevendigital"; |
491 | const std::string MusicAggregatorScope::SOUNDCLOUD = "com.canonical.scopes.soundcloud"; |
492 | const std::string MusicAggregatorScope::SONGKICK = "com.canonical.scopes.songkick_songkick"; |
493 | |
494 | void MusicAggregatorScope::start(std::string const&) { |
495 | - setlocale(LC_ALL, ""); |
496 | + init_gettext(*this); |
497 | CategoryRenderer basic; |
498 | local_scope = registry()->get_metadata(LOCALSCOPE).proxy(); |
499 | } |
500 | |
501 | === renamed file 'src/musicaggregatorscope.h' => 'src/musicaggregator/musicaggregatorscope.h' |
502 | === renamed file 'src/onlinemusicresultforwarder.cpp' => 'src/musicaggregator/onlinemusicresultforwarder.cpp' |
503 | === renamed file 'src/onlinemusicresultforwarder.h' => 'src/musicaggregator/onlinemusicresultforwarder.h' |
504 | --- src/onlinemusicresultforwarder.h 2014-07-30 13:50:55 +0000 |
505 | +++ src/musicaggregator/onlinemusicresultforwarder.h 2014-11-12 17:34:14 +0000 |
506 | @@ -20,7 +20,7 @@ |
507 | #ifndef ONLINEMUSICRESULTFORWARDER_H |
508 | #define ONLINEMUSICRESULTFORWARDER_H |
509 | |
510 | -#include "bufferedresultforwarder.h" |
511 | +#include "../utils/bufferedresultforwarder.h" |
512 | |
513 | /* |
514 | ResultForwarder that buffers results up until it gets |
515 | |
516 | === renamed file 'data/paper-white-bg-v2.png' => 'src/musicaggregator/paper-white-bg-v2.png' |
517 | === renamed file 'data/musicaggregator-screenshot.jpg' => 'src/musicaggregator/screenshot.jpg' |
518 | Binary files data/musicaggregator-screenshot.jpg 2014-02-20 11:59:22 +0000 and src/musicaggregator/screenshot.jpg 2014-11-12 17:34:14 +0000 differ |
519 | === added directory 'src/mymusic' |
520 | === added file 'src/mymusic/CMakeLists.txt' |
521 | --- src/mymusic/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
522 | +++ src/mymusic/CMakeLists.txt 2014-11-12 17:34:14 +0000 |
523 | @@ -0,0 +1,29 @@ |
524 | +include_directories(${UNITY_INCLUDE_DIRS}) |
525 | + |
526 | +add_library(mediascanner-music MODULE music-scope.cpp) |
527 | +#set_target_properties(mediascanner-music PROPERTIES PREFIX "") |
528 | +target_link_libraries(mediascanner-music scope-utils ${UNITY_LDFLAGS} ${GIO_DEPS_LDFLAGS}) |
529 | + |
530 | +configure_file(manifest.json.in manifest.json) |
531 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/mediascanner-music.ini.in mediascanner-music.ini) |
532 | + |
533 | +if(CLICK_MODE) |
534 | + click_build(com.ubuntu.scopes.mymusic ${VERSION} |
535 | + ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json) |
536 | + click_scope(com.ubuntu.scopes.mymusic mymusic |
537 | + mediascanner-music ${CMAKE_CURRENT_BINARY_DIR}/mediascanner-music.ini) |
538 | + click_scope_data(com.ubuntu.scopes.mymusic mymusic |
539 | + screenshot.jpg |
540 | + icon.png) |
541 | +else() |
542 | + set(scopedir "${CMAKE_INSTALL_LIBDIR}/unity-scopes/mediascanner-music") |
543 | + install( |
544 | + TARGETS mediascanner-music |
545 | + LIBRARY DESTINATION "${scopedir}") |
546 | + install( |
547 | + FILES |
548 | + ${CMAKE_CURRENT_BINARY_DIR}/mediascanner-music.ini |
549 | + screenshot.jpg |
550 | + icon.png |
551 | + DESTINATION "${scopedir}") |
552 | +endif(CLICK_MODE) |
553 | |
554 | === added file 'src/mymusic/apparmor.json' |
555 | --- src/mymusic/apparmor.json 1970-01-01 00:00:00 +0000 |
556 | +++ src/mymusic/apparmor.json 2014-11-12 17:34:14 +0000 |
557 | @@ -0,0 +1,5 @@ |
558 | +{ |
559 | + "template": "unconfined", |
560 | + "policy_groups": [], |
561 | + "policy_version": 1.2 |
562 | +} |
563 | |
564 | === renamed file 'data/music-scope.png' => 'src/mymusic/icon.png' |
565 | === added file 'src/mymusic/manifest.json.in' |
566 | --- src/mymusic/manifest.json.in 1970-01-01 00:00:00 +0000 |
567 | +++ src/mymusic/manifest.json.in 2014-11-12 17:34:14 +0000 |
568 | @@ -0,0 +1,16 @@ |
569 | +{ |
570 | + "description": "My Music scope", |
571 | + "framework": "ubuntu-sdk-14.10-dev2", |
572 | + "architecture": "@CLICK_ARCH@", |
573 | + "hooks": { |
574 | + "mymusic": { |
575 | + "scope": "mymusic", |
576 | + "apparmor": "apparmor.json" |
577 | + } |
578 | + }, |
579 | + "icon": "mymusic/icon.png", |
580 | + "maintainer": "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>", |
581 | + "name": "com.ubuntu.scopes.mymusic", |
582 | + "title": "My Music scope", |
583 | + "version": "@VERSION@" |
584 | +} |
585 | |
586 | === renamed file 'data/mediascanner-music.ini.in.in' => 'src/mymusic/mediascanner-music.ini.in' |
587 | --- data/mediascanner-music.ini.in.in 2014-08-07 13:32:30 +0000 |
588 | +++ src/mymusic/mediascanner-music.ini.in 2014-11-12 17:34:14 +0000 |
589 | @@ -2,14 +2,10 @@ |
590 | _DisplayName=My Music |
591 | _Description=This is an Ubuntu search plugin that scans the device for music and allows it to be searched and displayed in the Dash. |
592 | Author=Canonical Ltd. |
593 | -Art=@SCOPES_DATADIR@/mediascanner-music/mediascanner-music-screenshot.jpg |
594 | -Icon=@SCOPES_DATADIR@/mediascanner-music/music-scope.png |
595 | +Art=./screenshot.jpg |
596 | +Icon=./icon.png |
597 | _SearchHint=Search local music collection |
598 | -HotKey= |
599 | |
600 | [Appearance] |
601 | LogoOverlayColor=#26000000 |
602 | |
603 | -[Desktop Entry] |
604 | -X-Ubuntu-Gettext-Domain=unity-scope-mediascanner |
605 | - |
606 | |
607 | === renamed file 'src/music-scope.cpp' => 'src/mymusic/music-scope.cpp' |
608 | --- src/music-scope.cpp 2014-09-16 15:40:24 +0000 |
609 | +++ src/mymusic/music-scope.cpp 2014-11-12 17:34:14 +0000 |
610 | @@ -36,7 +36,7 @@ |
611 | #include <unity/scopes/VariantBuilder.h> |
612 | |
613 | #include "music-scope.h" |
614 | -#include "i18n.h" |
615 | +#include "../utils/i18n.h" |
616 | |
617 | #define MAX_RESULTS 100 |
618 | #define MAX_GENRES 100 |
619 | @@ -133,7 +133,7 @@ |
620 | namespace json = Json; |
621 | |
622 | void MusicScope::start(std::string const&) { |
623 | - setlocale(LC_ALL, ""); |
624 | + init_gettext(*this); |
625 | store.reset(new MediaStore(MS_READ_ONLY)); |
626 | client = http::make_client(); |
627 | set_api_key(); |
628 | |
629 | === renamed file 'src/music-scope.h' => 'src/mymusic/music-scope.h' |
630 | === renamed file 'data/mediascanner-music-screenshot.jpg' => 'src/mymusic/screenshot.jpg' |
631 | Binary files data/mediascanner-music-screenshot.jpg 2014-02-20 11:59:22 +0000 and src/mymusic/screenshot.jpg 2014-11-12 17:34:14 +0000 differ |
632 | === added directory 'src/myvideos' |
633 | === added file 'src/myvideos/CMakeLists.txt' |
634 | --- src/myvideos/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
635 | +++ src/myvideos/CMakeLists.txt 2014-11-12 17:34:14 +0000 |
636 | @@ -0,0 +1,29 @@ |
637 | +include_directories(${UNITY_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) |
638 | + |
639 | +add_library(mediascanner-video MODULE video-scope.cpp) |
640 | +#set_target_properties(mediascanner-video PROPERTIES PREFIX "") |
641 | +target_link_libraries(mediascanner-video scope-utils ${UNITY_LDFLAGS} ${Boost_LIBRARIES}) |
642 | + |
643 | +configure_file(manifest.json.in manifest.json) |
644 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/mediascanner-video.ini.in mediascanner-video.ini) |
645 | + |
646 | +if(CLICK_MODE) |
647 | + click_build(com.ubuntu.scopes.myvideos ${VERSION} |
648 | + ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json) |
649 | + click_scope(com.ubuntu.scopes.myvideos myvideos |
650 | + mediascanner-video ${CMAKE_CURRENT_BINARY_DIR}/mediascanner-video.ini) |
651 | + click_scope_data(com.ubuntu.scopes.myvideos myvideos |
652 | + screenshot.jpg |
653 | + icon.png) |
654 | +else() |
655 | + set(scopedir "${CMAKE_INSTALL_LIBDIR}/unity-scopes/mediascanner-video") |
656 | + install( |
657 | + TARGETS mediascanner-video |
658 | + LIBRARY DESTINATION "${scopedir}") |
659 | + install( |
660 | + FILES |
661 | + ${CMAKE_CURRENT_BINARY_DIR}/mediascanner-video.ini |
662 | + screenshot.jpg |
663 | + icon.png |
664 | + DESTINATION "${scopedir}") |
665 | +endif(CLICK_MODE) |
666 | |
667 | === added file 'src/myvideos/apparmor.json' |
668 | --- src/myvideos/apparmor.json 1970-01-01 00:00:00 +0000 |
669 | +++ src/myvideos/apparmor.json 2014-11-12 17:34:14 +0000 |
670 | @@ -0,0 +1,5 @@ |
671 | +{ |
672 | + "template": "unconfined", |
673 | + "policy_groups": [], |
674 | + "policy_version": 1.2 |
675 | +} |
676 | |
677 | === added file 'src/myvideos/icon.png' |
678 | Binary files src/myvideos/icon.png 1970-01-01 00:00:00 +0000 and src/myvideos/icon.png 2014-11-12 17:34:14 +0000 differ |
679 | === added file 'src/myvideos/manifest.json.in' |
680 | --- src/myvideos/manifest.json.in 1970-01-01 00:00:00 +0000 |
681 | +++ src/myvideos/manifest.json.in 2014-11-12 17:34:14 +0000 |
682 | @@ -0,0 +1,16 @@ |
683 | +{ |
684 | + "description": "My Videos scope", |
685 | + "framework": "ubuntu-sdk-14.10-dev2", |
686 | + "architecture": "@CLICK_ARCH@", |
687 | + "hooks": { |
688 | + "mymusic": { |
689 | + "scope": "myvideos", |
690 | + "apparmor": "apparmor.json" |
691 | + } |
692 | + }, |
693 | + "icon": "myvideos/icon.png", |
694 | + "maintainer": "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>", |
695 | + "name": "com.ubuntu.scopes.myvideos", |
696 | + "title": "My Videos scope", |
697 | + "version": "@VERSION@" |
698 | +} |
699 | |
700 | === renamed file 'data/mediascanner-video.ini.in.in' => 'src/myvideos/mediascanner-video.ini.in' |
701 | --- data/mediascanner-video.ini.in.in 2014-08-07 13:32:30 +0000 |
702 | +++ src/myvideos/mediascanner-video.ini.in 2014-11-12 17:34:14 +0000 |
703 | @@ -2,13 +2,10 @@ |
704 | _DisplayName=My Videos |
705 | _Description=This is an Ubuntu search plugin that scans the device for videos and allows them to be searched and displayed in the Dash. |
706 | Author=Canonical Ltd. |
707 | -Art=@SCOPES_DATADIR@/mediascanner-video/mediascanner-video-screenshot.jpg |
708 | -Icon=@SCOPES_DATADIR@/mediascanner-video/video-scope.png |
709 | +Art=./screenshot.jpg |
710 | +Icon=./icon.png |
711 | _SearchHint= |
712 | HotKey= |
713 | |
714 | [Appearance] |
715 | LogoOverlayColor=#26000000 |
716 | - |
717 | -[Desktop Entry] |
718 | -X-Ubuntu-Gettext-Domain=unity-scope-hollywood |
719 | |
720 | === renamed file 'data/mediascanner-video-screenshot.jpg' => 'src/myvideos/screenshot.jpg' |
721 | Binary files data/mediascanner-video-screenshot.jpg 2014-02-20 11:59:22 +0000 and src/myvideos/screenshot.jpg 2014-11-12 17:34:14 +0000 differ |
722 | === renamed file 'src/video-scope.cpp' => 'src/myvideos/video-scope.cpp' |
723 | --- src/video-scope.cpp 2014-10-09 14:19:51 +0000 |
724 | +++ src/myvideos/video-scope.cpp 2014-11-12 17:34:14 +0000 |
725 | @@ -32,7 +32,7 @@ |
726 | #include <unity/scopes/VariantBuilder.h> |
727 | |
728 | #include "video-scope.h" |
729 | -#include "i18n.h" |
730 | +#include "../utils/i18n.h" |
731 | |
732 | #define MAX_RESULTS 100 |
733 | |
734 | @@ -101,7 +101,7 @@ |
735 | }; |
736 | |
737 | void VideoScope::start(std::string const&) { |
738 | - setlocale(LC_ALL, ""); |
739 | + init_gettext(*this); |
740 | store.reset(new MediaStore(MS_READ_ONLY)); |
741 | } |
742 | |
743 | |
744 | === renamed file 'src/video-scope.h' => 'src/myvideos/video-scope.h' |
745 | === added directory 'src/utils' |
746 | === added file 'src/utils/CMakeLists.txt' |
747 | --- src/utils/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
748 | +++ src/utils/CMakeLists.txt 2014-11-12 17:34:14 +0000 |
749 | @@ -0,0 +1,11 @@ |
750 | +include_directories(${UNITY_INCLUDE_DIRS}) |
751 | + |
752 | +add_definitions(-fPIC) |
753 | + |
754 | +add_library(scope-utils STATIC |
755 | + resultforwarder.cpp |
756 | + bufferedresultforwarder.cpp |
757 | + notify-strategy.cpp |
758 | + i18n.cpp) |
759 | + |
760 | +target_link_libraries(scope-utils ${UNITY_SCOPES_LDFLAGS}) |
761 | |
762 | === renamed file 'src/bufferedresultforwarder.cpp' => 'src/utils/bufferedresultforwarder.cpp' |
763 | === renamed file 'src/bufferedresultforwarder.h' => 'src/utils/bufferedresultforwarder.h' |
764 | === added file 'src/utils/i18n.cpp' |
765 | --- src/utils/i18n.cpp 1970-01-01 00:00:00 +0000 |
766 | +++ src/utils/i18n.cpp 2014-11-12 17:34:14 +0000 |
767 | @@ -0,0 +1,32 @@ |
768 | +/* |
769 | + * Copyright (C) 2014 Canonical Ltd. |
770 | + * |
771 | + * This program is free software: you can redistribute it and/or modify it |
772 | + * under the terms of the GNU General Public License version 3, as published |
773 | + * by the Free Software Foundation. |
774 | + * |
775 | + * This program is distributed in the hope that it will be useful, but |
776 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
777 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
778 | + * PURPOSE. See the GNU General Public License for more details. |
779 | + * |
780 | + * You should have received a copy of the GNU General Public License along |
781 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
782 | + */ |
783 | + |
784 | +#include <config.h> |
785 | +#include "i18n.h" |
786 | +#include <unity/scopes/ScopeBase.h> |
787 | + |
788 | +using unity::scopes::ScopeBase; |
789 | + |
790 | +void init_gettext(const ScopeBase &scope) { |
791 | + setlocale(LC_ALL, ""); |
792 | + |
793 | +#ifdef CLICK_MODE |
794 | + std::string locale_dir = scope.scope_directory() + "/../locale"; |
795 | + bindtextdomain(GETTEXT_PACKAGE, locale_dir.c_str()); |
796 | +#else |
797 | + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); |
798 | +#endif |
799 | +} |
800 | |
801 | === renamed file 'src/i18n.h' => 'src/utils/i18n.h' |
802 | --- src/i18n.h 2014-04-25 17:35:42 +0000 |
803 | +++ src/utils/i18n.h 2014-11-12 17:34:14 +0000 |
804 | @@ -21,4 +21,12 @@ |
805 | |
806 | #define _(value) dgettext(GETTEXT_PACKAGE, value) |
807 | |
808 | +namespace unity { |
809 | +namespace scopes { |
810 | +class ScopeBase; |
811 | +} |
812 | +} |
813 | + |
814 | +void init_gettext(const unity::scopes::ScopeBase &scope); |
815 | + |
816 | #endif |
817 | |
818 | === renamed file 'src/notify-strategy.cpp' => 'src/utils/notify-strategy.cpp' |
819 | === renamed file 'src/notify-strategy.h' => 'src/utils/notify-strategy.h' |
820 | === renamed file 'src/resultforwarder.cpp' => 'src/utils/resultforwarder.cpp' |
821 | === renamed file 'src/resultforwarder.h' => 'src/utils/resultforwarder.h' |
822 | === added directory 'src/videoaggregator' |
823 | === added file 'src/videoaggregator/CMakeLists.txt' |
824 | --- src/videoaggregator/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
825 | +++ src/videoaggregator/CMakeLists.txt 2014-11-12 17:34:14 +0000 |
826 | @@ -0,0 +1,37 @@ |
827 | +include_directories(${UNITY_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) |
828 | + |
829 | +add_library(videoaggregator MODULE |
830 | + videoaggregatorscope.cpp |
831 | + videoaggregatorquery.cpp) |
832 | +target_link_libraries(videoaggregator scope-utils ${UNITY_SCOPES_LDFLAGS}) |
833 | + |
834 | +configure_file(manifest.json.in manifest.json) |
835 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/videoaggregator.ini.in videoaggregator.ini) |
836 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/videoaggregator-settings.ini.in videoaggregator-settings.ini) |
837 | + |
838 | +if(CLICK_MODE) |
839 | + click_build(com.ubuntu.scopes.video ${VERSION} |
840 | + ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json) |
841 | + click_scope(com.ubuntu.scopes.video videoaggregator |
842 | + videoaggregator |
843 | + ${CMAKE_CURRENT_BINARY_DIR}/videoaggregator.ini |
844 | + ${CMAKE_CURRENT_BINARY_DIR}/videoaggregator-settings.ini) |
845 | + click_scope_data(com.ubuntu.scopes.video videoaggregator |
846 | + screenshot.jpg |
847 | + icon.png |
848 | + paper-white-bg-v2.png |
849 | + ) |
850 | +else() |
851 | + set(scopedir "${CMAKE_INSTALL_LIBDIR}/unity-scopes/videoaggregator") |
852 | + install( |
853 | + TARGETS videoaggregator |
854 | + LIBRARY DESTINATION "${scopedir}") |
855 | + install( |
856 | + FILES |
857 | + ${CMAKE_CURRENT_BINARY_DIR}/videoaggregator.ini |
858 | + ${CMAKE_CURRENT_BINARY_DIR}/videoaggregator-settings.ini |
859 | + screenshot.jpg |
860 | + icon.png |
861 | + paper-white-bg-v2.png |
862 | + DESTINATION "${scopedir}") |
863 | +endif(CLICK_MODE) |
864 | |
865 | === added file 'src/videoaggregator/apparmor.json' |
866 | --- src/videoaggregator/apparmor.json 1970-01-01 00:00:00 +0000 |
867 | +++ src/videoaggregator/apparmor.json 2014-11-12 17:34:14 +0000 |
868 | @@ -0,0 +1,5 @@ |
869 | +{ |
870 | + "template": "unconfined", |
871 | + "policy_groups": [], |
872 | + "policy_version": 1.2 |
873 | +} |
874 | |
875 | === renamed file 'data/video-scope.png' => 'src/videoaggregator/icon.png' |
876 | Binary files data/video-scope.png 2014-08-07 09:54:06 +0000 and src/videoaggregator/icon.png 2014-11-12 17:34:14 +0000 differ |
877 | === added file 'src/videoaggregator/manifest.json.in' |
878 | --- src/videoaggregator/manifest.json.in 1970-01-01 00:00:00 +0000 |
879 | +++ src/videoaggregator/manifest.json.in 2014-11-12 17:34:14 +0000 |
880 | @@ -0,0 +1,16 @@ |
881 | +{ |
882 | + "description": "Music scope", |
883 | + "framework": "ubuntu-sdk-14.10-dev2", |
884 | + "architecture": "@CLICK_ARCH@", |
885 | + "hooks": { |
886 | + "videoaggregator": { |
887 | + "scope": "videoaggregator", |
888 | + "apparmor": "apparmor.json" |
889 | + } |
890 | + }, |
891 | + "icon": "videoaggregator/icon.png", |
892 | + "maintainer": "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>", |
893 | + "name": "com.ubuntu.scopes.video", |
894 | + "title": "Video scope", |
895 | + "version": "@VERSION@" |
896 | +} |
897 | |
898 | === added file 'src/videoaggregator/paper-white-bg-v2.png' |
899 | Binary files src/videoaggregator/paper-white-bg-v2.png 1970-01-01 00:00:00 +0000 and src/videoaggregator/paper-white-bg-v2.png 2014-11-12 17:34:14 +0000 differ |
900 | === renamed file 'data/videoaggregator-screenshot.jpg' => 'src/videoaggregator/screenshot.jpg' |
901 | Binary files data/videoaggregator-screenshot.jpg 2014-02-20 11:59:22 +0000 and src/videoaggregator/screenshot.jpg 2014-11-12 17:34:14 +0000 differ |
902 | === renamed file 'data/videoaggregator-settings.ini.in.in' => 'src/videoaggregator/videoaggregator-settings.ini.in' |
903 | === renamed file 'data/videoaggregator.ini.in.in' => 'src/videoaggregator/videoaggregator.ini.in' |
904 | --- data/videoaggregator.ini.in.in 2014-11-10 16:15:39 +0000 |
905 | +++ src/videoaggregator/videoaggregator.ini.in 2014-11-12 17:34:14 +0000 |
906 | @@ -2,8 +2,8 @@ |
907 | _DisplayName=Video |
908 | _Description=This is an Ubuntu search plugin that merges all video sources into one. |
909 | Author=Canonical Ltd. |
910 | -Art=@SCOPES_DATADIR@/videoaggregator/videoaggregator-screenshot.jpg |
911 | -Icon=@SCOPES_DATADIR@/mediascanner-video/video-scope.png |
912 | +Art=./screenshot.jpg |
913 | +Icon=./icon.png |
914 | _SearchHint=Search video |
915 | HotKey= |
916 | |
917 | |
918 | === renamed file 'src/videoaggregatorquery.cpp' => 'src/videoaggregator/videoaggregatorquery.cpp' |
919 | --- src/videoaggregatorquery.cpp 2014-07-31 13:16:12 +0000 |
920 | +++ src/videoaggregator/videoaggregatorquery.cpp 2014-11-12 17:34:14 +0000 |
921 | @@ -28,10 +28,10 @@ |
922 | #include <unity/scopes/CannedQuery.h> |
923 | #include <unity/scopes/SearchReply.h> |
924 | |
925 | -#include "i18n.h" |
926 | +#include "../utils/i18n.h" |
927 | #include "videoaggregatorquery.h" |
928 | -#include "resultforwarder.h" |
929 | -#include "bufferedresultforwarder.h" |
930 | +#include "../utils/resultforwarder.h" |
931 | +#include "../utils/bufferedresultforwarder.h" |
932 | |
933 | using namespace unity::scopes; |
934 | |
935 | |
936 | === renamed file 'src/videoaggregatorquery.h' => 'src/videoaggregator/videoaggregatorquery.h' |
937 | === renamed file 'src/videoaggregatorscope.cpp' => 'src/videoaggregator/videoaggregatorscope.cpp' |
938 | --- src/videoaggregatorscope.cpp 2014-08-01 14:46:26 +0000 |
939 | +++ src/videoaggregator/videoaggregatorscope.cpp 2014-11-12 17:34:14 +0000 |
940 | @@ -17,22 +17,28 @@ |
941 | * |
942 | */ |
943 | |
944 | +#include <config.h> |
945 | #include "videoaggregatorscope.h" |
946 | #include "videoaggregatorquery.h" |
947 | #include <unity/scopes/Registry.h> |
948 | #include <unity/scopes/Category.h> |
949 | #include <unity/scopes/CategoryRenderer.h> |
950 | #include <iostream> |
951 | +#include "../utils/i18n.h" |
952 | |
953 | using namespace unity::scopes; |
954 | |
955 | const std::vector<const char*> SUBSCOPE_NAMES{ |
956 | +#ifdef CLICK_MODE |
957 | + "com.ubuntu.scopes.myvideos_myvideos", |
958 | +#else |
959 | "mediascanner-video", |
960 | +#endif |
961 | "com.ubuntu.scopes.youtube_youtube", |
962 | }; |
963 | |
964 | void VideoAggregatorScope::start(std::string const&) { |
965 | - setlocale(LC_ALL, ""); |
966 | + init_gettext(*this); |
967 | find_subscopes(true); |
968 | } |
969 | |
970 | |
971 | === renamed file 'src/videoaggregatorscope.h' => 'src/videoaggregator/videoaggregatorscope.h' |
972 | === modified file 'tests/CMakeLists.txt' |
973 | --- tests/CMakeLists.txt 2014-09-16 15:45:31 +0000 |
974 | +++ tests/CMakeLists.txt 2014-11-12 17:34:14 +0000 |
975 | @@ -13,22 +13,22 @@ |
976 | |
977 | add_executable(test-music-scope |
978 | test-music-scope.cpp |
979 | - ../src/music-scope.cpp |
980 | + ../src/mymusic/music-scope.cpp |
981 | ) |
982 | -target_link_libraries(test-music-scope ${UNITY_LDFLAGS} ${gtest_libs} ${GIO_DEPS_LDFLAGS}) |
983 | +target_link_libraries(test-music-scope |
984 | + scope-utils ${UNITY_LDFLAGS} ${gtest_libs} ${GIO_DEPS_LDFLAGS}) |
985 | add_test(test-music-scope test-music-scope) |
986 | |
987 | add_executable(test-video-scope |
988 | test-video-scope.cpp |
989 | - ../src/video-scope.cpp |
990 | + ../src/myvideos/video-scope.cpp |
991 | ) |
992 | -target_link_libraries(test-video-scope ${UNITY_LDFLAGS} ${gtest_libs} ${Boost_LIBRARIES}) |
993 | +target_link_libraries(test-video-scope |
994 | + scope-utils ${UNITY_LDFLAGS} ${gtest_libs} ${Boost_LIBRARIES}) |
995 | add_test(test-video-scope test-video-scope) |
996 | |
997 | add_executable(test-result-forwarder |
998 | - test-result-forwarder.cpp |
999 | - ../src/notify-strategy.cpp |
1000 | - ../src/resultforwarder.cpp |
1001 | - ../src/bufferedresultforwarder.cpp) |
1002 | -target_link_libraries(test-result-forwarder ${UNITY_LDFLAGS} ${gtest_libs}) |
1003 | + test-result-forwarder.cpp) |
1004 | +target_link_libraries(test-result-forwarder |
1005 | + scope-utils ${UNITY_LDFLAGS} ${gtest_libs}) |
1006 | add_test(test-result-forwarder test-result-forwarder) |
1007 | |
1008 | === modified file 'tests/test-music-scope.cpp' |
1009 | --- tests/test-music-scope.cpp 2014-09-10 07:33:32 +0000 |
1010 | +++ tests/test-music-scope.cpp 2014-11-12 17:34:14 +0000 |
1011 | @@ -14,7 +14,7 @@ |
1012 | #include <unity/scopes/testing/Result.h> |
1013 | #include <unity/scopes/testing/TypedScopeFixture.h> |
1014 | |
1015 | -#include "../src/music-scope.h" |
1016 | +#include "../src/mymusic/music-scope.h" |
1017 | |
1018 | using namespace mediascanner; |
1019 | using namespace unity::scopes; |
1020 | @@ -37,6 +37,7 @@ |
1021 | ASSERT_EQ(0, setenv("MEDIASCANNER_CACHEDIR", cachedir.c_str(), 1)); |
1022 | store.reset(new MediaStore(MS_READ_WRITE)); |
1023 | |
1024 | + set_scope_directory("/no/such/directory"); |
1025 | unity::scopes::testing::TypedScopeFixture<MusicScope>::SetUp(); |
1026 | } |
1027 | |
1028 | |
1029 | === modified file 'tests/test-result-forwarder.cpp' |
1030 | --- tests/test-result-forwarder.cpp 2014-07-30 13:50:55 +0000 |
1031 | +++ tests/test-result-forwarder.cpp 2014-11-12 17:34:14 +0000 |
1032 | @@ -20,9 +20,9 @@ |
1033 | #include <gtest/gtest.h> |
1034 | #include <unity/scopes/testing/MockSearchReply.h> |
1035 | #include <unity/scopes/testing/Category.h> |
1036 | -#include "../src/bufferedresultforwarder.h" |
1037 | -#include "../src/resultforwarder.h" |
1038 | -#include "../src/notify-strategy.h" |
1039 | +#include "../src/utils/bufferedresultforwarder.h" |
1040 | +#include "../src/utils/resultforwarder.h" |
1041 | +#include "../src/utils/notify-strategy.h" |
1042 | |
1043 | using namespace unity::scopes; |
1044 | using ::testing::Truly; |
1045 | |
1046 | === modified file 'tests/test-video-scope.cpp' |
1047 | --- tests/test-video-scope.cpp 2014-09-17 10:31:46 +0000 |
1048 | +++ tests/test-video-scope.cpp 2014-11-12 17:34:14 +0000 |
1049 | @@ -14,7 +14,7 @@ |
1050 | #include <unity/scopes/testing/Result.h> |
1051 | #include <unity/scopes/testing/TypedScopeFixture.h> |
1052 | |
1053 | -#include "../src/video-scope.h" |
1054 | +#include "../src/myvideos/video-scope.h" |
1055 | |
1056 | using namespace mediascanner; |
1057 | using namespace unity::scopes; |
1058 | @@ -37,6 +37,7 @@ |
1059 | ASSERT_EQ(0, setenv("MEDIASCANNER_CACHEDIR", cachedir.c_str(), 1)); |
1060 | store.reset(new MediaStore(MS_READ_WRITE)); |
1061 | |
1062 | + set_scope_directory("/no/such/directory"); |
1063 | unity::scopes::testing::TypedScopeFixture<VideoScope>::SetUp(); |
1064 | } |
1065 |
Looks good