Merge lp:~jamesh/unity-scope-mediascanner/click-support into lp:unity-scope-mediascanner/rtm-14.09
- click-support
- Merge into rtm-14.09
Proposed by
James Henstridge
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~jamesh/unity-scope-mediascanner/click-support | ||||
Merge into: | lp:unity-scope-mediascanner/rtm-14.09 | ||||
Diff against target: |
1076 lines (+452/-170) 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 (+3/-7) 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 (+3/-6) 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:~jamesh/unity-scope-mediascanner/click-support | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Unity Team | Pending | ||
Review via email: mp+240088@code.launchpad.net |
This proposal has been superseded by a proposal from 2014-11-12.
Commit message
Reorganise package and update build rules to support building scopes as click packages. Also update icons to the latest versions from design.
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.
Unmerged revisions
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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-30 09:54:03 +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-10-07 15:13:12 +0000 |
428 | +++ src/musicaggregator/musicaggregator.ini.in 2014-10-30 09:54:03 +0000 |
429 | @@ -2,16 +2,12 @@ |
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 | |
441 | [Appearance] |
442 | LogoOverlayColor=#26000000 |
443 | -PageHeader.Background=@SCOPES_DATADIR@/paper-white-bg-v2.png |
444 | - |
445 | -[Desktop Entry] |
446 | -X-Ubuntu-Gettext-Domain=unity-scope-musicaggregator |
447 | - |
448 | +PageHeader.Background=./paper-white-bg-v2.png |
449 | |
450 | === renamed file 'src/musicaggregatorquery.cpp' => 'src/musicaggregator/musicaggregatorquery.cpp' |
451 | --- src/musicaggregatorquery.cpp 2014-10-07 10:42:31 +0000 |
452 | +++ src/musicaggregator/musicaggregatorquery.cpp 2014-10-30 09:54:03 +0000 |
453 | @@ -21,10 +21,10 @@ |
454 | #include <config.h> |
455 | #include "musicaggregatorquery.h" |
456 | #include "musicaggregatorscope.h" |
457 | -#include "resultforwarder.h" |
458 | +#include "../utils/resultforwarder.h" |
459 | #include "onlinemusicresultforwarder.h" |
460 | -#include "notify-strategy.h" |
461 | -#include "i18n.h" |
462 | +#include "../utils/notify-strategy.h" |
463 | +#include "../utils/i18n.h" |
464 | #include <memory> |
465 | |
466 | #include <unity/scopes/Annotation.h> |
467 | |
468 | === renamed file 'src/musicaggregatorquery.h' => 'src/musicaggregator/musicaggregatorquery.h' |
469 | === renamed file 'src/musicaggregatorscope.cpp' => 'src/musicaggregator/musicaggregatorscope.cpp' |
470 | --- src/musicaggregatorscope.cpp 2014-09-15 07:26:58 +0000 |
471 | +++ src/musicaggregator/musicaggregatorscope.cpp 2014-10-30 09:54:03 +0000 |
472 | @@ -17,6 +17,7 @@ |
473 | * |
474 | */ |
475 | |
476 | +#include <config.h> |
477 | #include "musicaggregatorscope.h" |
478 | #include "musicaggregatorquery.h" |
479 | #include <unity/scopes/Registry.h> |
480 | @@ -24,17 +25,22 @@ |
481 | #include <unity/scopes/CategoryRenderer.h> |
482 | #include <vector> |
483 | #include <iostream> |
484 | +#include "../utils/i18n.h" |
485 | |
486 | using namespace unity::scopes; |
487 | |
488 | +#ifdef CLICK_MODE |
489 | +const std::string MusicAggregatorScope::LOCALSCOPE = "com.ubuntu.scopes.mymusic_mymusic"; |
490 | +#else |
491 | const std::string MusicAggregatorScope::LOCALSCOPE = "mediascanner-music"; |
492 | +#endif |
493 | const std::string MusicAggregatorScope::GROOVESHARKSCOPE = "com.canonical.scopes.grooveshark"; |
494 | const std::string MusicAggregatorScope::SEVENDIGITAL = "com.canonical.scopes.sevendigital"; |
495 | const std::string MusicAggregatorScope::SOUNDCLOUD = "com.canonical.scopes.soundcloud"; |
496 | const std::string MusicAggregatorScope::SONGKICK = "com.canonical.scopes.songkick_songkick"; |
497 | |
498 | void MusicAggregatorScope::start(std::string const&) { |
499 | - setlocale(LC_ALL, ""); |
500 | + init_gettext(*this); |
501 | CategoryRenderer basic; |
502 | local_scope = registry()->get_metadata(LOCALSCOPE).proxy(); |
503 | } |
504 | |
505 | === renamed file 'src/musicaggregatorscope.h' => 'src/musicaggregator/musicaggregatorscope.h' |
506 | === renamed file 'src/onlinemusicresultforwarder.cpp' => 'src/musicaggregator/onlinemusicresultforwarder.cpp' |
507 | === renamed file 'src/onlinemusicresultforwarder.h' => 'src/musicaggregator/onlinemusicresultforwarder.h' |
508 | --- src/onlinemusicresultforwarder.h 2014-07-30 13:50:55 +0000 |
509 | +++ src/musicaggregator/onlinemusicresultforwarder.h 2014-10-30 09:54:03 +0000 |
510 | @@ -20,7 +20,7 @@ |
511 | #ifndef ONLINEMUSICRESULTFORWARDER_H |
512 | #define ONLINEMUSICRESULTFORWARDER_H |
513 | |
514 | -#include "bufferedresultforwarder.h" |
515 | +#include "../utils/bufferedresultforwarder.h" |
516 | |
517 | /* |
518 | ResultForwarder that buffers results up until it gets |
519 | |
520 | === renamed file 'data/paper-white-bg-v2.png' => 'src/musicaggregator/paper-white-bg-v2.png' |
521 | === renamed file 'data/musicaggregator-screenshot.jpg' => 'src/musicaggregator/screenshot.jpg' |
522 | Binary files data/musicaggregator-screenshot.jpg 2014-02-20 11:59:22 +0000 and src/musicaggregator/screenshot.jpg 2014-10-30 09:54:03 +0000 differ |
523 | === added directory 'src/mymusic' |
524 | === added file 'src/mymusic/CMakeLists.txt' |
525 | --- src/mymusic/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
526 | +++ src/mymusic/CMakeLists.txt 2014-10-30 09:54:03 +0000 |
527 | @@ -0,0 +1,29 @@ |
528 | +include_directories(${UNITY_INCLUDE_DIRS}) |
529 | + |
530 | +add_library(mediascanner-music MODULE music-scope.cpp) |
531 | +#set_target_properties(mediascanner-music PROPERTIES PREFIX "") |
532 | +target_link_libraries(mediascanner-music scope-utils ${UNITY_LDFLAGS} ${GIO_DEPS_LDFLAGS}) |
533 | + |
534 | +configure_file(manifest.json.in manifest.json) |
535 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/mediascanner-music.ini.in mediascanner-music.ini) |
536 | + |
537 | +if(CLICK_MODE) |
538 | + click_build(com.ubuntu.scopes.mymusic ${VERSION} |
539 | + ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json) |
540 | + click_scope(com.ubuntu.scopes.mymusic mymusic |
541 | + mediascanner-music ${CMAKE_CURRENT_BINARY_DIR}/mediascanner-music.ini) |
542 | + click_scope_data(com.ubuntu.scopes.mymusic mymusic |
543 | + screenshot.jpg |
544 | + icon.png) |
545 | +else() |
546 | + set(scopedir "${CMAKE_INSTALL_LIBDIR}/unity-scopes/mediascanner-music") |
547 | + install( |
548 | + TARGETS mediascanner-music |
549 | + LIBRARY DESTINATION "${scopedir}") |
550 | + install( |
551 | + FILES |
552 | + ${CMAKE_CURRENT_BINARY_DIR}/mediascanner-music.ini |
553 | + screenshot.jpg |
554 | + icon.png |
555 | + DESTINATION "${scopedir}") |
556 | +endif(CLICK_MODE) |
557 | |
558 | === added file 'src/mymusic/apparmor.json' |
559 | --- src/mymusic/apparmor.json 1970-01-01 00:00:00 +0000 |
560 | +++ src/mymusic/apparmor.json 2014-10-30 09:54:03 +0000 |
561 | @@ -0,0 +1,5 @@ |
562 | +{ |
563 | + "template": "unconfined", |
564 | + "policy_groups": [], |
565 | + "policy_version": 1.2 |
566 | +} |
567 | |
568 | === renamed file 'data/music-scope.png' => 'src/mymusic/icon.png' |
569 | === added file 'src/mymusic/manifest.json.in' |
570 | --- src/mymusic/manifest.json.in 1970-01-01 00:00:00 +0000 |
571 | +++ src/mymusic/manifest.json.in 2014-10-30 09:54:03 +0000 |
572 | @@ -0,0 +1,16 @@ |
573 | +{ |
574 | + "description": "My Music scope", |
575 | + "framework": "ubuntu-sdk-14.10-dev2", |
576 | + "architecture": "@CLICK_ARCH@", |
577 | + "hooks": { |
578 | + "mymusic": { |
579 | + "scope": "mymusic", |
580 | + "apparmor": "apparmor.json" |
581 | + } |
582 | + }, |
583 | + "icon": "mymusic/icon.png", |
584 | + "maintainer": "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>", |
585 | + "name": "com.ubuntu.scopes.mymusic", |
586 | + "title": "My Music scope", |
587 | + "version": "@VERSION@" |
588 | +} |
589 | |
590 | === renamed file 'data/mediascanner-music.ini.in.in' => 'src/mymusic/mediascanner-music.ini.in' |
591 | --- data/mediascanner-music.ini.in.in 2014-08-07 13:32:30 +0000 |
592 | +++ src/mymusic/mediascanner-music.ini.in 2014-10-30 09:54:03 +0000 |
593 | @@ -2,14 +2,10 @@ |
594 | _DisplayName=My Music |
595 | _Description=This is an Ubuntu search plugin that scans the device for music and allows it to be searched and displayed in the Dash. |
596 | Author=Canonical Ltd. |
597 | -Art=@SCOPES_DATADIR@/mediascanner-music/mediascanner-music-screenshot.jpg |
598 | -Icon=@SCOPES_DATADIR@/mediascanner-music/music-scope.png |
599 | +Art=./screenshot.jpg |
600 | +Icon=./icon.png |
601 | _SearchHint=Search local music collection |
602 | -HotKey= |
603 | |
604 | [Appearance] |
605 | LogoOverlayColor=#26000000 |
606 | |
607 | -[Desktop Entry] |
608 | -X-Ubuntu-Gettext-Domain=unity-scope-mediascanner |
609 | - |
610 | |
611 | === renamed file 'src/music-scope.cpp' => 'src/mymusic/music-scope.cpp' |
612 | --- src/music-scope.cpp 2014-09-16 15:40:24 +0000 |
613 | +++ src/mymusic/music-scope.cpp 2014-10-30 09:54:03 +0000 |
614 | @@ -36,7 +36,7 @@ |
615 | #include <unity/scopes/VariantBuilder.h> |
616 | |
617 | #include "music-scope.h" |
618 | -#include "i18n.h" |
619 | +#include "../utils/i18n.h" |
620 | |
621 | #define MAX_RESULTS 100 |
622 | #define MAX_GENRES 100 |
623 | @@ -133,7 +133,7 @@ |
624 | namespace json = Json; |
625 | |
626 | void MusicScope::start(std::string const&) { |
627 | - setlocale(LC_ALL, ""); |
628 | + init_gettext(*this); |
629 | store.reset(new MediaStore(MS_READ_ONLY)); |
630 | client = http::make_client(); |
631 | set_api_key(); |
632 | |
633 | === renamed file 'src/music-scope.h' => 'src/mymusic/music-scope.h' |
634 | === renamed file 'data/mediascanner-music-screenshot.jpg' => 'src/mymusic/screenshot.jpg' |
635 | Binary files data/mediascanner-music-screenshot.jpg 2014-02-20 11:59:22 +0000 and src/mymusic/screenshot.jpg 2014-10-30 09:54:03 +0000 differ |
636 | === added directory 'src/myvideos' |
637 | === added file 'src/myvideos/CMakeLists.txt' |
638 | --- src/myvideos/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
639 | +++ src/myvideos/CMakeLists.txt 2014-10-30 09:54:03 +0000 |
640 | @@ -0,0 +1,29 @@ |
641 | +include_directories(${UNITY_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) |
642 | + |
643 | +add_library(mediascanner-video MODULE video-scope.cpp) |
644 | +#set_target_properties(mediascanner-video PROPERTIES PREFIX "") |
645 | +target_link_libraries(mediascanner-video scope-utils ${UNITY_LDFLAGS} ${Boost_LIBRARIES}) |
646 | + |
647 | +configure_file(manifest.json.in manifest.json) |
648 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/mediascanner-video.ini.in mediascanner-video.ini) |
649 | + |
650 | +if(CLICK_MODE) |
651 | + click_build(com.ubuntu.scopes.myvideos ${VERSION} |
652 | + ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json) |
653 | + click_scope(com.ubuntu.scopes.myvideos myvideos |
654 | + mediascanner-video ${CMAKE_CURRENT_BINARY_DIR}/mediascanner-video.ini) |
655 | + click_scope_data(com.ubuntu.scopes.myvideos myvideos |
656 | + screenshot.jpg |
657 | + icon.png) |
658 | +else() |
659 | + set(scopedir "${CMAKE_INSTALL_LIBDIR}/unity-scopes/mediascanner-video") |
660 | + install( |
661 | + TARGETS mediascanner-video |
662 | + LIBRARY DESTINATION "${scopedir}") |
663 | + install( |
664 | + FILES |
665 | + ${CMAKE_CURRENT_BINARY_DIR}/mediascanner-video.ini |
666 | + screenshot.jpg |
667 | + icon.png |
668 | + DESTINATION "${scopedir}") |
669 | +endif(CLICK_MODE) |
670 | |
671 | === added file 'src/myvideos/apparmor.json' |
672 | --- src/myvideos/apparmor.json 1970-01-01 00:00:00 +0000 |
673 | +++ src/myvideos/apparmor.json 2014-10-30 09:54:03 +0000 |
674 | @@ -0,0 +1,5 @@ |
675 | +{ |
676 | + "template": "unconfined", |
677 | + "policy_groups": [], |
678 | + "policy_version": 1.2 |
679 | +} |
680 | |
681 | === added file 'src/myvideos/icon.png' |
682 | Binary files src/myvideos/icon.png 1970-01-01 00:00:00 +0000 and src/myvideos/icon.png 2014-10-30 09:54:03 +0000 differ |
683 | === added file 'src/myvideos/manifest.json.in' |
684 | --- src/myvideos/manifest.json.in 1970-01-01 00:00:00 +0000 |
685 | +++ src/myvideos/manifest.json.in 2014-10-30 09:54:03 +0000 |
686 | @@ -0,0 +1,16 @@ |
687 | +{ |
688 | + "description": "My Videos scope", |
689 | + "framework": "ubuntu-sdk-14.10-dev2", |
690 | + "architecture": "@CLICK_ARCH@", |
691 | + "hooks": { |
692 | + "mymusic": { |
693 | + "scope": "myvideos", |
694 | + "apparmor": "apparmor.json" |
695 | + } |
696 | + }, |
697 | + "icon": "myvideos/icon.png", |
698 | + "maintainer": "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>", |
699 | + "name": "com.ubuntu.scopes.myvideos", |
700 | + "title": "My Videos scope", |
701 | + "version": "@VERSION@" |
702 | +} |
703 | |
704 | === renamed file 'data/mediascanner-video.ini.in.in' => 'src/myvideos/mediascanner-video.ini.in' |
705 | --- data/mediascanner-video.ini.in.in 2014-08-07 13:32:30 +0000 |
706 | +++ src/myvideos/mediascanner-video.ini.in 2014-10-30 09:54:03 +0000 |
707 | @@ -2,13 +2,10 @@ |
708 | _DisplayName=My Videos |
709 | _Description=This is an Ubuntu search plugin that scans the device for videos and allows them to be searched and displayed in the Dash. |
710 | Author=Canonical Ltd. |
711 | -Art=@SCOPES_DATADIR@/mediascanner-video/mediascanner-video-screenshot.jpg |
712 | -Icon=@SCOPES_DATADIR@/mediascanner-video/video-scope.png |
713 | +Art=./screenshot.jpg |
714 | +Icon=./icon.png |
715 | _SearchHint= |
716 | HotKey= |
717 | |
718 | [Appearance] |
719 | LogoOverlayColor=#26000000 |
720 | - |
721 | -[Desktop Entry] |
722 | -X-Ubuntu-Gettext-Domain=unity-scope-hollywood |
723 | |
724 | === renamed file 'data/mediascanner-video-screenshot.jpg' => 'src/myvideos/screenshot.jpg' |
725 | Binary files data/mediascanner-video-screenshot.jpg 2014-02-20 11:59:22 +0000 and src/myvideos/screenshot.jpg 2014-10-30 09:54:03 +0000 differ |
726 | === renamed file 'src/video-scope.cpp' => 'src/myvideos/video-scope.cpp' |
727 | --- src/video-scope.cpp 2014-10-09 14:19:51 +0000 |
728 | +++ src/myvideos/video-scope.cpp 2014-10-30 09:54:03 +0000 |
729 | @@ -32,7 +32,7 @@ |
730 | #include <unity/scopes/VariantBuilder.h> |
731 | |
732 | #include "video-scope.h" |
733 | -#include "i18n.h" |
734 | +#include "../utils/i18n.h" |
735 | |
736 | #define MAX_RESULTS 100 |
737 | |
738 | @@ -101,7 +101,7 @@ |
739 | }; |
740 | |
741 | void VideoScope::start(std::string const&) { |
742 | - setlocale(LC_ALL, ""); |
743 | + init_gettext(*this); |
744 | store.reset(new MediaStore(MS_READ_ONLY)); |
745 | } |
746 | |
747 | |
748 | === renamed file 'src/video-scope.h' => 'src/myvideos/video-scope.h' |
749 | === added directory 'src/utils' |
750 | === added file 'src/utils/CMakeLists.txt' |
751 | --- src/utils/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
752 | +++ src/utils/CMakeLists.txt 2014-10-30 09:54:03 +0000 |
753 | @@ -0,0 +1,11 @@ |
754 | +include_directories(${UNITY_INCLUDE_DIRS}) |
755 | + |
756 | +add_definitions(-fPIC) |
757 | + |
758 | +add_library(scope-utils STATIC |
759 | + resultforwarder.cpp |
760 | + bufferedresultforwarder.cpp |
761 | + notify-strategy.cpp |
762 | + i18n.cpp) |
763 | + |
764 | +target_link_libraries(scope-utils ${UNITY_SCOPES_LDFLAGS}) |
765 | |
766 | === renamed file 'src/bufferedresultforwarder.cpp' => 'src/utils/bufferedresultforwarder.cpp' |
767 | === renamed file 'src/bufferedresultforwarder.h' => 'src/utils/bufferedresultforwarder.h' |
768 | === added file 'src/utils/i18n.cpp' |
769 | --- src/utils/i18n.cpp 1970-01-01 00:00:00 +0000 |
770 | +++ src/utils/i18n.cpp 2014-10-30 09:54:03 +0000 |
771 | @@ -0,0 +1,32 @@ |
772 | +/* |
773 | + * Copyright (C) 2014 Canonical Ltd. |
774 | + * |
775 | + * This program is free software: you can redistribute it and/or modify it |
776 | + * under the terms of the GNU General Public License version 3, as published |
777 | + * by the Free Software Foundation. |
778 | + * |
779 | + * This program is distributed in the hope that it will be useful, but |
780 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
781 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
782 | + * PURPOSE. See the GNU General Public License for more details. |
783 | + * |
784 | + * You should have received a copy of the GNU General Public License along |
785 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
786 | + */ |
787 | + |
788 | +#include <config.h> |
789 | +#include "i18n.h" |
790 | +#include <unity/scopes/ScopeBase.h> |
791 | + |
792 | +using unity::scopes::ScopeBase; |
793 | + |
794 | +void init_gettext(const ScopeBase &scope) { |
795 | + setlocale(LC_ALL, ""); |
796 | + |
797 | +#ifdef CLICK_MODE |
798 | + std::string locale_dir = scope.scope_directory() + "/../locale"; |
799 | + bindtextdomain(GETTEXT_PACKAGE, locale_dir.c_str()); |
800 | +#else |
801 | + bindtextdomain(GETTEXT_PACKAGE, LOCALE_DIR); |
802 | +#endif |
803 | +} |
804 | |
805 | === renamed file 'src/i18n.h' => 'src/utils/i18n.h' |
806 | --- src/i18n.h 2014-04-25 17:35:42 +0000 |
807 | +++ src/utils/i18n.h 2014-10-30 09:54:03 +0000 |
808 | @@ -21,4 +21,12 @@ |
809 | |
810 | #define _(value) dgettext(GETTEXT_PACKAGE, value) |
811 | |
812 | +namespace unity { |
813 | +namespace scopes { |
814 | +class ScopeBase; |
815 | +} |
816 | +} |
817 | + |
818 | +void init_gettext(const unity::scopes::ScopeBase &scope); |
819 | + |
820 | #endif |
821 | |
822 | === renamed file 'src/notify-strategy.cpp' => 'src/utils/notify-strategy.cpp' |
823 | === renamed file 'src/notify-strategy.h' => 'src/utils/notify-strategy.h' |
824 | === renamed file 'src/resultforwarder.cpp' => 'src/utils/resultforwarder.cpp' |
825 | === renamed file 'src/resultforwarder.h' => 'src/utils/resultforwarder.h' |
826 | === added directory 'src/videoaggregator' |
827 | === added file 'src/videoaggregator/CMakeLists.txt' |
828 | --- src/videoaggregator/CMakeLists.txt 1970-01-01 00:00:00 +0000 |
829 | +++ src/videoaggregator/CMakeLists.txt 2014-10-30 09:54:03 +0000 |
830 | @@ -0,0 +1,37 @@ |
831 | +include_directories(${UNITY_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS}) |
832 | + |
833 | +add_library(videoaggregator MODULE |
834 | + videoaggregatorscope.cpp |
835 | + videoaggregatorquery.cpp) |
836 | +target_link_libraries(videoaggregator scope-utils ${UNITY_SCOPES_LDFLAGS}) |
837 | + |
838 | +configure_file(manifest.json.in manifest.json) |
839 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/videoaggregator.ini.in videoaggregator.ini) |
840 | +intltool_merge(${CMAKE_CURRENT_SOURCE_DIR}/videoaggregator-settings.ini.in videoaggregator-settings.ini) |
841 | + |
842 | +if(CLICK_MODE) |
843 | + click_build(com.ubuntu.scopes.video ${VERSION} |
844 | + ${CMAKE_CURRENT_BINARY_DIR}/manifest.json apparmor.json) |
845 | + click_scope(com.ubuntu.scopes.video videoaggregator |
846 | + videoaggregator |
847 | + ${CMAKE_CURRENT_BINARY_DIR}/videoaggregator.ini |
848 | + ${CMAKE_CURRENT_BINARY_DIR}/videoaggregator-settings.ini) |
849 | + click_scope_data(com.ubuntu.scopes.video videoaggregator |
850 | + screenshot.jpg |
851 | + icon.png |
852 | + paper-white-bg-v2.png |
853 | + ) |
854 | +else() |
855 | + set(scopedir "${CMAKE_INSTALL_LIBDIR}/unity-scopes/videoaggregator") |
856 | + install( |
857 | + TARGETS videoaggregator |
858 | + LIBRARY DESTINATION "${scopedir}") |
859 | + install( |
860 | + FILES |
861 | + ${CMAKE_CURRENT_BINARY_DIR}/videoaggregator.ini |
862 | + ${CMAKE_CURRENT_BINARY_DIR}/videoaggregator-settings.ini |
863 | + screenshot.jpg |
864 | + icon.png |
865 | + paper-white-bg-v2.png |
866 | + DESTINATION "${scopedir}") |
867 | +endif(CLICK_MODE) |
868 | |
869 | === added file 'src/videoaggregator/apparmor.json' |
870 | --- src/videoaggregator/apparmor.json 1970-01-01 00:00:00 +0000 |
871 | +++ src/videoaggregator/apparmor.json 2014-10-30 09:54:03 +0000 |
872 | @@ -0,0 +1,5 @@ |
873 | +{ |
874 | + "template": "unconfined", |
875 | + "policy_groups": [], |
876 | + "policy_version": 1.2 |
877 | +} |
878 | |
879 | === renamed file 'data/video-scope.png' => 'src/videoaggregator/icon.png' |
880 | Binary files data/video-scope.png 2014-08-07 09:54:06 +0000 and src/videoaggregator/icon.png 2014-10-30 09:54:03 +0000 differ |
881 | === added file 'src/videoaggregator/manifest.json.in' |
882 | --- src/videoaggregator/manifest.json.in 1970-01-01 00:00:00 +0000 |
883 | +++ src/videoaggregator/manifest.json.in 2014-10-30 09:54:03 +0000 |
884 | @@ -0,0 +1,16 @@ |
885 | +{ |
886 | + "description": "Music scope", |
887 | + "framework": "ubuntu-sdk-14.10-dev2", |
888 | + "architecture": "@CLICK_ARCH@", |
889 | + "hooks": { |
890 | + "videoaggregator": { |
891 | + "scope": "videoaggregator", |
892 | + "apparmor": "apparmor.json" |
893 | + } |
894 | + }, |
895 | + "icon": "videoaggregator/icon.png", |
896 | + "maintainer": "Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com>", |
897 | + "name": "com.ubuntu.scopes.video", |
898 | + "title": "Video scope", |
899 | + "version": "@VERSION@" |
900 | +} |
901 | |
902 | === added file 'src/videoaggregator/paper-white-bg-v2.png' |
903 | 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-10-30 09:54:03 +0000 differ |
904 | === renamed file 'data/videoaggregator-screenshot.jpg' => 'src/videoaggregator/screenshot.jpg' |
905 | Binary files data/videoaggregator-screenshot.jpg 2014-02-20 11:59:22 +0000 and src/videoaggregator/screenshot.jpg 2014-10-30 09:54:03 +0000 differ |
906 | === renamed file 'data/videoaggregator-settings.ini.in.in' => 'src/videoaggregator/videoaggregator-settings.ini.in' |
907 | === renamed file 'data/videoaggregator.ini.in.in' => 'src/videoaggregator/videoaggregator.ini.in' |
908 | --- data/videoaggregator.ini.in.in 2014-10-03 13:25:48 +0000 |
909 | +++ src/videoaggregator/videoaggregator.ini.in 2014-10-30 09:54:03 +0000 |
910 | @@ -2,15 +2,12 @@ |
911 | _DisplayName=Video |
912 | _Description=This is an Ubuntu search plugin that merges all video sources into one. |
913 | Author=Canonical Ltd. |
914 | -Art=@SCOPES_DATADIR@/videoaggregator/videoaggregator-screenshot.jpg |
915 | -Icon=@SCOPES_DATADIR@/mediascanner-video/video-scope.png |
916 | +Art=./screenshot.jpg |
917 | +Icon=./icon.png |
918 | _SearchHint=Search video |
919 | HotKey= |
920 | |
921 | [Appearance] |
922 | LogoOverlayColor=#26000000 |
923 | -PageHeader.Background=@SCOPES_DATADIR@/paper-white-bg-v2.png |
924 | - |
925 | -[Desktop Entry] |
926 | -X-Ubuntu-Gettext-Domain=unity-scope-videoaggregator |
927 | +PageHeader.Background=./paper-white-bg-v2.png |
928 | |
929 | |
930 | === renamed file 'src/videoaggregatorquery.cpp' => 'src/videoaggregator/videoaggregatorquery.cpp' |
931 | --- src/videoaggregatorquery.cpp 2014-07-31 13:16:12 +0000 |
932 | +++ src/videoaggregator/videoaggregatorquery.cpp 2014-10-30 09:54:03 +0000 |
933 | @@ -28,10 +28,10 @@ |
934 | #include <unity/scopes/CannedQuery.h> |
935 | #include <unity/scopes/SearchReply.h> |
936 | |
937 | -#include "i18n.h" |
938 | +#include "../utils/i18n.h" |
939 | #include "videoaggregatorquery.h" |
940 | -#include "resultforwarder.h" |
941 | -#include "bufferedresultforwarder.h" |
942 | +#include "../utils/resultforwarder.h" |
943 | +#include "../utils/bufferedresultforwarder.h" |
944 | |
945 | using namespace unity::scopes; |
946 | |
947 | |
948 | === renamed file 'src/videoaggregatorquery.h' => 'src/videoaggregator/videoaggregatorquery.h' |
949 | === renamed file 'src/videoaggregatorscope.cpp' => 'src/videoaggregator/videoaggregatorscope.cpp' |
950 | --- src/videoaggregatorscope.cpp 2014-08-01 14:46:26 +0000 |
951 | +++ src/videoaggregator/videoaggregatorscope.cpp 2014-10-30 09:54:03 +0000 |
952 | @@ -17,22 +17,28 @@ |
953 | * |
954 | */ |
955 | |
956 | +#include <config.h> |
957 | #include "videoaggregatorscope.h" |
958 | #include "videoaggregatorquery.h" |
959 | #include <unity/scopes/Registry.h> |
960 | #include <unity/scopes/Category.h> |
961 | #include <unity/scopes/CategoryRenderer.h> |
962 | #include <iostream> |
963 | +#include "../utils/i18n.h" |
964 | |
965 | using namespace unity::scopes; |
966 | |
967 | const std::vector<const char*> SUBSCOPE_NAMES{ |
968 | +#ifdef CLICK_MODE |
969 | + "com.ubuntu.scopes.myvideos_myvideos", |
970 | +#else |
971 | "mediascanner-video", |
972 | +#endif |
973 | "com.ubuntu.scopes.youtube_youtube", |
974 | }; |
975 | |
976 | void VideoAggregatorScope::start(std::string const&) { |
977 | - setlocale(LC_ALL, ""); |
978 | + init_gettext(*this); |
979 | find_subscopes(true); |
980 | } |
981 | |
982 | |
983 | === renamed file 'src/videoaggregatorscope.h' => 'src/videoaggregator/videoaggregatorscope.h' |
984 | === modified file 'tests/CMakeLists.txt' |
985 | --- tests/CMakeLists.txt 2014-09-16 15:45:31 +0000 |
986 | +++ tests/CMakeLists.txt 2014-10-30 09:54:03 +0000 |
987 | @@ -13,22 +13,22 @@ |
988 | |
989 | add_executable(test-music-scope |
990 | test-music-scope.cpp |
991 | - ../src/music-scope.cpp |
992 | + ../src/mymusic/music-scope.cpp |
993 | ) |
994 | -target_link_libraries(test-music-scope ${UNITY_LDFLAGS} ${gtest_libs} ${GIO_DEPS_LDFLAGS}) |
995 | +target_link_libraries(test-music-scope |
996 | + scope-utils ${UNITY_LDFLAGS} ${gtest_libs} ${GIO_DEPS_LDFLAGS}) |
997 | add_test(test-music-scope test-music-scope) |
998 | |
999 | add_executable(test-video-scope |
1000 | test-video-scope.cpp |
1001 | - ../src/video-scope.cpp |
1002 | + ../src/myvideos/video-scope.cpp |
1003 | ) |
1004 | -target_link_libraries(test-video-scope ${UNITY_LDFLAGS} ${gtest_libs} ${Boost_LIBRARIES}) |
1005 | +target_link_libraries(test-video-scope |
1006 | + scope-utils ${UNITY_LDFLAGS} ${gtest_libs} ${Boost_LIBRARIES}) |
1007 | add_test(test-video-scope test-video-scope) |
1008 | |
1009 | add_executable(test-result-forwarder |
1010 | - test-result-forwarder.cpp |
1011 | - ../src/notify-strategy.cpp |
1012 | - ../src/resultforwarder.cpp |
1013 | - ../src/bufferedresultforwarder.cpp) |
1014 | -target_link_libraries(test-result-forwarder ${UNITY_LDFLAGS} ${gtest_libs}) |
1015 | + test-result-forwarder.cpp) |
1016 | +target_link_libraries(test-result-forwarder |
1017 | + scope-utils ${UNITY_LDFLAGS} ${gtest_libs}) |
1018 | add_test(test-result-forwarder test-result-forwarder) |
1019 | |
1020 | === modified file 'tests/test-music-scope.cpp' |
1021 | --- tests/test-music-scope.cpp 2014-09-10 07:33:32 +0000 |
1022 | +++ tests/test-music-scope.cpp 2014-10-30 09:54:03 +0000 |
1023 | @@ -14,7 +14,7 @@ |
1024 | #include <unity/scopes/testing/Result.h> |
1025 | #include <unity/scopes/testing/TypedScopeFixture.h> |
1026 | |
1027 | -#include "../src/music-scope.h" |
1028 | +#include "../src/mymusic/music-scope.h" |
1029 | |
1030 | using namespace mediascanner; |
1031 | using namespace unity::scopes; |
1032 | @@ -37,6 +37,7 @@ |
1033 | ASSERT_EQ(0, setenv("MEDIASCANNER_CACHEDIR", cachedir.c_str(), 1)); |
1034 | store.reset(new MediaStore(MS_READ_WRITE)); |
1035 | |
1036 | + set_scope_directory("/no/such/directory"); |
1037 | unity::scopes::testing::TypedScopeFixture<MusicScope>::SetUp(); |
1038 | } |
1039 | |
1040 | |
1041 | === modified file 'tests/test-result-forwarder.cpp' |
1042 | --- tests/test-result-forwarder.cpp 2014-07-30 13:50:55 +0000 |
1043 | +++ tests/test-result-forwarder.cpp 2014-10-30 09:54:03 +0000 |
1044 | @@ -20,9 +20,9 @@ |
1045 | #include <gtest/gtest.h> |
1046 | #include <unity/scopes/testing/MockSearchReply.h> |
1047 | #include <unity/scopes/testing/Category.h> |
1048 | -#include "../src/bufferedresultforwarder.h" |
1049 | -#include "../src/resultforwarder.h" |
1050 | -#include "../src/notify-strategy.h" |
1051 | +#include "../src/utils/bufferedresultforwarder.h" |
1052 | +#include "../src/utils/resultforwarder.h" |
1053 | +#include "../src/utils/notify-strategy.h" |
1054 | |
1055 | using namespace unity::scopes; |
1056 | using ::testing::Truly; |
1057 | |
1058 | === modified file 'tests/test-video-scope.cpp' |
1059 | --- tests/test-video-scope.cpp 2014-09-17 10:31:46 +0000 |
1060 | +++ tests/test-video-scope.cpp 2014-10-30 09:54:03 +0000 |
1061 | @@ -14,7 +14,7 @@ |
1062 | #include <unity/scopes/testing/Result.h> |
1063 | #include <unity/scopes/testing/TypedScopeFixture.h> |
1064 | |
1065 | -#include "../src/video-scope.h" |
1066 | +#include "../src/myvideos/video-scope.h" |
1067 | |
1068 | using namespace mediascanner; |
1069 | using namespace unity::scopes; |
1070 | @@ -37,6 +37,7 @@ |
1071 | ASSERT_EQ(0, setenv("MEDIASCANNER_CACHEDIR", cachedir.c_str(), 1)); |
1072 | store.reset(new MediaStore(MS_READ_WRITE)); |
1073 | |
1074 | + set_scope_directory("/no/such/directory"); |
1075 | unity::scopes::testing::TypedScopeFixture<VideoScope>::SetUp(); |
1076 | } |
1077 |