Merge lp:~marcustomlinson/qtcreator-plugin-ubuntu/refactor-scope-template into lp:qtcreator-plugin-ubuntu
- refactor-scope-template
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | Zoltan Balogh |
Approved revision: | 433 |
Merged at revision: | 393 |
Proposed branch: | lp:~marcustomlinson/qtcreator-plugin-ubuntu/refactor-scope-template |
Merge into: | lp:qtcreator-plugin-ubuntu |
Diff against target: |
1816 lines (+518/-788) 24 files modified
share/qtcreator/templates/wizards/ubuntu/scope/CMakeLists.txt (+20/-29) share/qtcreator/templates/wizards/ubuntu/scope/cmake/FindGMock.cmake (+0/-12) share/qtcreator/templates/wizards/ubuntu/scope/cmake/FindIntltool.cmake (+0/-265) share/qtcreator/templates/wizards/ubuntu/scope/data/CMakeLists.txt (+0/-10) share/qtcreator/templates/wizards/ubuntu/scope/include/api/config.h (+0/-27) share/qtcreator/templates/wizards/ubuntu/scope/po/POTFILES.in (+11/-11) share/qtcreator/templates/wizards/ubuntu/scope/src/CMakeLists.txt (+31/-33) share/qtcreator/templates/wizards/ubuntu/scope/src/client.cpp (+2/-3) share/qtcreator/templates/wizards/ubuntu/scope/src/client.h (+17/-9) share/qtcreator/templates/wizards/ubuntu/scope/src/data/displayName-settings.ini.in (+21/-0) share/qtcreator/templates/wizards/ubuntu/scope/src/data/displayName.ini.in (+1/-0) share/qtcreator/templates/wizards/ubuntu/scope/src/localization.h (+3/-3) share/qtcreator/templates/wizards/ubuntu/scope/src/preview.cpp (+20/-21) share/qtcreator/templates/wizards/ubuntu/scope/src/preview.h (+3/-7) share/qtcreator/templates/wizards/ubuntu/scope/src/query.cpp (+41/-41) share/qtcreator/templates/wizards/ubuntu/scope/src/query.h (+6/-10) share/qtcreator/templates/wizards/ubuntu/scope/src/scope.cpp (+5/-7) share/qtcreator/templates/wizards/ubuntu/scope/src/scope.h (+5/-9) share/qtcreator/templates/wizards/ubuntu/scope/tests/CMakeLists.txt (+15/-8) share/qtcreator/templates/wizards/ubuntu/scope/tests/server/server.py (+1/-1) share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/CMakeLists.txt (+7/-25) share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/scope/test-scope.cpp (+0/-232) share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/test-scope.py (+290/-0) share/qtcreator/templates/wizards/ubuntu/scope/wizard.xml (+19/-25) |
To merge this branch: | bzr merge lp:~marcustomlinson/qtcreator-plugin-ubuntu/refactor-scope-template |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Benjamin Zeller | Approve | ||
PS Jenkins bot | continuous-integration | Approve | |
Review via email: mp+259083@code.launchpad.net |
Commit message
Refactored the scope templates to be more simplistic and comprehensible:
* Reduced directory structure to as few folders as possible
* Renamed scope ini file to <scope-name>.ini
* Added a <scope-
* Cleaned out unnecessary complexities from source and CMake files
* More descriptive comments and variable names
* Updated tests to use python3-
* Removed cmake/ modules folder (SDK now includes cmake-extras)
* Allow scope template to build with gcc > 4.9
* Added "Keywords" key to scope ini
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
- 433. By Marcus Tomlinson
-
Fixed comment
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:433
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'share/qtcreator/templates/wizards/ubuntu/scope/CMakeLists.txt' | |||
2 | --- share/qtcreator/templates/wizards/ubuntu/scope/CMakeLists.txt 2015-01-07 10:50:28 +0000 | |||
3 | +++ share/qtcreator/templates/wizards/ubuntu/scope/CMakeLists.txt 2015-05-19 10:38:08 +0000 | |||
4 | @@ -1,12 +1,11 @@ | |||
5 | 1 | project(%ProjectName:l% CXX) | 1 | project(%ProjectName:l% CXX) |
6 | 2 | cmake_minimum_required(VERSION 2.8.10) | 2 | cmake_minimum_required(VERSION 2.8.10) |
7 | 3 | set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake" "${CMAKE_MODULE_PATH}") | ||
8 | 4 | 3 | ||
10 | 5 | # We require g++ 4.9, to avoid ABI breakage with earlier version. | 4 | # We require at least g++ 4.9, to avoid ABI breakage with earlier versions. |
11 | 6 | set(cxx_version_required 4.9) | 5 | set(cxx_version_required 4.9) |
15 | 7 | if("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | 6 | if (CMAKE_COMPILER_IS_GNUCXX) |
16 | 8 | if (NOT CMAKE_CXX_COMPILER_VERSION MATCHES "^${cxx_version_required}") | 7 | if (CMAKE_CXX_COMPILER_VERSION VERSION_LESS ${cxx_version_required}) |
17 | 9 | message(FATAL_ERROR "g++ version must be ${cxx_version_required}!") | 8 | message(FATAL_ERROR "g++ version must be at least ${cxx_version_required}!") |
18 | 10 | endif() | 9 | endif() |
19 | 11 | endif() | 10 | endif() |
20 | 12 | 11 | ||
21 | @@ -21,17 +20,14 @@ | |||
22 | 21 | -DQT_NO_KEYWORDS | 20 | -DQT_NO_KEYWORDS |
23 | 22 | ) | 21 | ) |
24 | 23 | 22 | ||
25 | 23 | # Search for our dependencies | ||
26 | 24 | include(GNUInstallDirs) | 24 | include(GNUInstallDirs) |
27 | 25 | find_package(PkgConfig) | 25 | find_package(PkgConfig) |
28 | 26 | find_package(Intltool) | 26 | find_package(Intltool) |
37 | 27 | 27 | @if "%ContentType%".substring(0, "network-netcpp-q".length) === "network-netcpp-q" | |
38 | 28 | # We depend on Boost for string trimming | 28 | find_package(Qt5Core REQUIRED) |
39 | 29 | find_package( | 29 | @endif |
40 | 30 | Boost | 30 | |
33 | 31 | REQUIRED | ||
34 | 32 | ) | ||
35 | 33 | |||
36 | 34 | # Search for our dependencies | ||
41 | 35 | pkg_check_modules( | 31 | pkg_check_modules( |
42 | 36 | SCOPE | 32 | SCOPE |
43 | 37 | libunity-scopes>=0.6.0 | 33 | libunity-scopes>=0.6.0 |
44 | @@ -44,19 +40,16 @@ | |||
45 | 44 | REQUIRED | 40 | REQUIRED |
46 | 45 | ) | 41 | ) |
47 | 46 | 42 | ||
48 | 47 | @if "%ContentType%".substring(0, "network-netcpp-q".length) === "network-netcpp-q" | ||
49 | 48 | find_package(Qt5Core REQUIRED) | ||
50 | 49 | include_directories(${Qt5Core_INCLUDE_DIRS}) | ||
51 | 50 | @endif | ||
52 | 51 | |||
53 | 52 | # Add our dependencies to the include paths | 43 | # Add our dependencies to the include paths |
54 | 53 | include_directories( | 44 | include_directories( |
57 | 54 | "${CMAKE_SOURCE_DIR}/include" | 45 | "${CMAKE_SOURCE_DIR}/src" |
56 | 55 | ${Boost_INCLUDE_DIRS} | ||
58 | 56 | ${SCOPE_INCLUDE_DIRS} | 46 | ${SCOPE_INCLUDE_DIRS} |
59 | 47 | @if "%ContentType%".substring(0, "network-netcpp-q".length) === "network-netcpp-q" | ||
60 | 48 | ${Qt5Core_INCLUDE_DIRS} | ||
61 | 49 | @endif | ||
62 | 57 | ) | 50 | ) |
63 | 58 | 51 | ||
65 | 59 | # Do not remove this line, its required for the correct functionality of the Ubuntu-SDK | 52 | # Do not remove these 2 lines, they are required for the correct functionality of the Ubuntu-SDK |
66 | 60 | set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file") | 53 | set(UBUNTU_MANIFEST_PATH "manifest.json.in" CACHE INTERNAL "Tells QtCreator location and name of the manifest file") |
67 | 61 | set(UBUNTU_PROJECT_TYPE "Scope" CACHE INTERNAL "Tells QtCreator this is a Scope project") | 54 | set(UBUNTU_PROJECT_TYPE "Scope" CACHE INTERNAL "Tells QtCreator this is a Scope project") |
68 | 62 | 55 | ||
69 | @@ -68,44 +61,42 @@ | |||
70 | 68 | set(SCOPE_NAME "${PACKAGE_NAME}_%ClickHookName:l%") | 61 | set(SCOPE_NAME "${PACKAGE_NAME}_%ClickHookName:l%") |
71 | 69 | 62 | ||
72 | 70 | # If we need to refer to the scope's name or package in code, these definitions will help | 63 | # If we need to refer to the scope's name or package in code, these definitions will help |
73 | 71 | |||
74 | 72 | add_definitions(-DPACKAGE_NAME="${PACKAGE_NAME}") | 64 | add_definitions(-DPACKAGE_NAME="${PACKAGE_NAME}") |
75 | 73 | add_definitions(-DSCOPE_NAME="${SCOPE_NAME}") | 65 | add_definitions(-DSCOPE_NAME="${SCOPE_NAME}") |
76 | 74 | add_definitions(-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}") | 66 | add_definitions(-DGETTEXT_PACKAGE="${GETTEXT_PACKAGE}") |
77 | 75 | 67 | ||
79 | 76 | #This command figures out the target architecture and puts it into the manifest file | 68 | # This command figures out the target architecture and puts it into the manifest file |
80 | 77 | execute_process( | 69 | execute_process( |
81 | 78 | COMMAND dpkg-architecture -qDEB_HOST_ARCH | 70 | COMMAND dpkg-architecture -qDEB_HOST_ARCH |
82 | 79 | OUTPUT_VARIABLE CLICK_ARCH | 71 | OUTPUT_VARIABLE CLICK_ARCH |
83 | 80 | OUTPUT_STRIP_TRAILING_WHITESPACE | 72 | OUTPUT_STRIP_TRAILING_WHITESPACE |
84 | 81 | ) | 73 | ) |
85 | 82 | 74 | ||
86 | 75 | # Configure and install the click manifest and apparmor files | ||
87 | 83 | configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) | 76 | configure_file(manifest.json.in ${CMAKE_CURRENT_BINARY_DIR}/manifest.json) |
88 | 84 | |||
89 | 85 | # Install the click manifest | ||
90 | 86 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION "/") | 77 | install(FILES ${CMAKE_CURRENT_BINARY_DIR}/manifest.json DESTINATION "/") |
91 | 87 | install(FILES "%ClickHookName:l%.apparmor" DESTINATION "/") | 78 | install(FILES "%ClickHookName:l%.apparmor" DESTINATION "/") |
92 | 88 | 79 | ||
93 | 89 | # Make these files show up in QtCreator | 80 | # Make these files show up in QtCreator |
94 | 90 | file(GLOB_RECURSE | 81 | file(GLOB_RECURSE |
95 | 91 | _PO_FILES | 82 | _PO_FILES |
97 | 92 | "po/*.po" | 83 | "po/*.po" |
98 | 93 | ) | 84 | ) |
99 | 94 | add_custom_target(hidden_files | 85 | add_custom_target(hidden_files |
100 | 95 | ALL | 86 | ALL |
101 | 96 | SOURCES | 87 | SOURCES |
102 | 97 | manifest.json.in | 88 | manifest.json.in |
103 | 98 | %ClickHookName:l%.apparmor | 89 | %ClickHookName:l%.apparmor |
105 | 99 | data/${SCOPE_NAME}.ini.in | 90 | src/data/%ClickHookName:l%.ini.in |
106 | 91 | src/data/%ClickHookName:l%-settings.ini.in | ||
107 | 100 | po/POTFILES.in | 92 | po/POTFILES.in |
108 | 101 | po/${GETTEXT_PACKAGE}.pot | 93 | po/${GETTEXT_PACKAGE}.pot |
109 | 102 | ${_PO_FILES} | 94 | ${_PO_FILES} |
110 | 103 | ) | 95 | ) |
111 | 104 | 96 | ||
112 | 105 | # Add our main directories | 97 | # Add our main directories |
113 | 98 | add_subdirectory(po) | ||
114 | 106 | add_subdirectory(src) | 99 | add_subdirectory(src) |
115 | 107 | add_subdirectory(data) | ||
116 | 108 | add_subdirectory(po) | ||
117 | 109 | 100 | ||
118 | 110 | # Set up the tests | 101 | # Set up the tests |
119 | 111 | enable_testing() | 102 | enable_testing() |
120 | 112 | 103 | ||
121 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/cmake' | |||
122 | === removed file 'share/qtcreator/templates/wizards/ubuntu/scope/cmake/FindGMock.cmake' | |||
123 | --- share/qtcreator/templates/wizards/ubuntu/scope/cmake/FindGMock.cmake 2014-09-03 12:55:33 +0000 | |||
124 | +++ share/qtcreator/templates/wizards/ubuntu/scope/cmake/FindGMock.cmake 1970-01-01 00:00:00 +0000 | |||
125 | @@ -1,12 +0,0 @@ | |||
126 | 1 | # Build with system gmock and embedded gtest | ||
127 | 2 | set (GMOCK_INCLUDE_DIRS "/usr/include/gmock/include" CACHE PATH "gmock source include directory") | ||
128 | 3 | set (GMOCK_SOURCE_DIR "/usr/src/gmock" CACHE PATH "gmock source directory") | ||
129 | 4 | set (GTEST_INCLUDE_DIRS "${GMOCK_SOURCE_DIR}/gtest/include" CACHE PATH "gtest source include directory") | ||
130 | 5 | |||
131 | 6 | add_subdirectory(${GMOCK_SOURCE_DIR} "${CMAKE_CURRENT_BINARY_DIR}/gmock") | ||
132 | 7 | |||
133 | 8 | set(GTEST_LIBRARIES gtest) | ||
134 | 9 | set(GTEST_MAIN_LIBRARIES gtest_main) | ||
135 | 10 | set(GMOCK_LIBRARIES gmock gmock_main) | ||
136 | 11 | |||
137 | 12 | set(GTEST_BOTH_LIBRARIES ${GTEST_LIBRARIES} ${GTEST_MAIN_LIBRARIES}) | ||
138 | 13 | 0 | ||
139 | === removed file 'share/qtcreator/templates/wizards/ubuntu/scope/cmake/FindIntltool.cmake' | |||
140 | --- share/qtcreator/templates/wizards/ubuntu/scope/cmake/FindIntltool.cmake 2015-04-13 09:11:18 +0000 | |||
141 | +++ share/qtcreator/templates/wizards/ubuntu/scope/cmake/FindIntltool.cmake 1970-01-01 00:00:00 +0000 | |||
142 | @@ -1,265 +0,0 @@ | |||
143 | 1 | # Copyright (C) 2014 Canonical Ltd | ||
144 | 2 | # | ||
145 | 3 | # This program is free software: you can redistribute it and/or modify | ||
146 | 4 | # it under the terms of the GNU Lesser General Public License version 3 as | ||
147 | 5 | # published by the Free Software Foundation. | ||
148 | 6 | # | ||
149 | 7 | # This program is distributed in the hope that it will be useful, | ||
150 | 8 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
151 | 9 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
152 | 10 | # GNU Lesser General Public License for more details. | ||
153 | 11 | # | ||
154 | 12 | # You should have received a copy of the GNU Lesser General Public License | ||
155 | 13 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
156 | 14 | |||
157 | 15 | # This package provides macros that wrap the intltool programs. | ||
158 | 16 | # | ||
159 | 17 | # An example of common usage is: | ||
160 | 18 | # | ||
161 | 19 | # For an ini file: | ||
162 | 20 | # | ||
163 | 21 | # intltool_merge_translations( | ||
164 | 22 | # "foo.ini.in" | ||
165 | 23 | # "${CMAKE_CURRENT_BINARY_DIR}/foo.ini" | ||
166 | 24 | # ALL | ||
167 | 25 | # UTF8 | ||
168 | 26 | # ) | ||
169 | 27 | # | ||
170 | 28 | # Inside po/CMakeLists.txt: | ||
171 | 29 | # | ||
172 | 30 | # intltool_update_potfile( | ||
173 | 31 | # ALL | ||
174 | 32 | # GETTEXT_PACKAGE ${GETTEXT_PACKAGE} | ||
175 | 33 | # ) | ||
176 | 34 | # | ||
177 | 35 | # intltool_install_translations( | ||
178 | 36 | # ALL | ||
179 | 37 | # GETTEXT_PACKAGE ${GETTEXT_PACKAGE} | ||
180 | 38 | # ) | ||
181 | 39 | |||
182 | 40 | find_package(Gettext REQUIRED) | ||
183 | 41 | |||
184 | 42 | find_program(INTLTOOL_UPDATE_EXECUTABLE intltool-update) | ||
185 | 43 | |||
186 | 44 | if(INTLTOOL_UPDATE_EXECUTABLE) | ||
187 | 45 | execute_process( | ||
188 | 46 | COMMAND ${INTLTOOL_UPDATE_EXECUTABLE} --version | ||
189 | 47 | OUTPUT_VARIABLE intltool_update_version | ||
190 | 48 | ERROR_QUIET | ||
191 | 49 | OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
192 | 50 | if (intltool_update_version MATCHES "^intltool-update \\(.*\\) [0-9]") | ||
193 | 51 | string( | ||
194 | 52 | REGEX REPLACE "^intltool-update \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" | ||
195 | 53 | INTLTOOL_UPDATE_VERSION_STRING "${intltool_update_version}" | ||
196 | 54 | ) | ||
197 | 55 | endif() | ||
198 | 56 | unset(intltool_update_version) | ||
199 | 57 | endif() | ||
200 | 58 | |||
201 | 59 | find_program(INTLTOOL_MERGE_EXECUTABLE intltool-merge) | ||
202 | 60 | |||
203 | 61 | if(INTLTOOL_MERGE_EXECUTABLE) | ||
204 | 62 | execute_process( | ||
205 | 63 | COMMAND ${INTLTOOL_MERGE_EXECUTABLE} --version | ||
206 | 64 | OUTPUT_VARIABLE intltool_merge_version | ||
207 | 65 | ERROR_QUIET | ||
208 | 66 | OUTPUT_STRIP_TRAILING_WHITESPACE) | ||
209 | 67 | if (intltool_update_version MATCHES "^intltool-merge \\(.*\\) [0-9]") | ||
210 | 68 | string( | ||
211 | 69 | REGEX REPLACE "^intltool-merge \\([^\\)]*\\) ([0-9\\.]+[^ \n]*).*" "\\1" | ||
212 | 70 | INTLTOOL_MERGE_VERSION_STRING "${intltool_merge_version}" | ||
213 | 71 | ) | ||
214 | 72 | endif() | ||
215 | 73 | unset(intltool_merge_version) | ||
216 | 74 | endif() | ||
217 | 75 | |||
218 | 76 | include(FindPackageHandleStandardArgs) | ||
219 | 77 | |||
220 | 78 | find_package_handle_standard_args( | ||
221 | 79 | Intltool | ||
222 | 80 | REQUIRED_VARS | ||
223 | 81 | INTLTOOL_UPDATE_EXECUTABLE | ||
224 | 82 | INTLTOOL_MERGE_EXECUTABLE | ||
225 | 83 | VERSION_VAR | ||
226 | 84 | INTLTOOL_UPDATE_VERSION_STRING | ||
227 | 85 | HANDLE_COMPONENTS | ||
228 | 86 | ) | ||
229 | 87 | |||
230 | 88 | function(APPEND_EACH LISTNAME GLUE OUTPUT) | ||
231 | 89 | set(_tmp_list "") | ||
232 | 90 | foreach(VAL ${${LISTNAME}}) | ||
233 | 91 | list(APPEND _tmp_list "${GLUE}${VAL}") | ||
234 | 92 | endforeach(VAL ${${LISTNAME}}) | ||
235 | 93 | set(${OUTPUT} "${_tmp_list}" PARENT_SCOPE) | ||
236 | 94 | endfunction() | ||
237 | 95 | |||
238 | 96 | function(INTLTOOL_UPDATE_POTFILE) | ||
239 | 97 | set(_options ALL) | ||
240 | 98 | set(_oneValueArgs GETTEXT_PACKAGE OUTPUT_FILE PO_DIRECTORY) | ||
241 | 99 | |||
242 | 100 | cmake_parse_arguments(_ARG "${_options}" "${_oneValueArgs}" "" ${ARGN}) | ||
243 | 101 | |||
244 | 102 | set(_POT_FILE "${PROJECT}.pot") | ||
245 | 103 | |||
246 | 104 | set(_GETTEXT_PACKAGE "") | ||
247 | 105 | if(_ARG_GETTEXT_PACKAGE) | ||
248 | 106 | set(_POT_FILE "${_ARG_GETTEXT_PACKAGE}.pot") | ||
249 | 107 | set(_GETTEXT_PACKAGE --gettext-package="${_ARG_GETTEXT_PACKAGE}") | ||
250 | 108 | endif() | ||
251 | 109 | |||
252 | 110 | set(_OUTPUT_FILE "") | ||
253 | 111 | if(_ARG_OUTPUT_FILE) | ||
254 | 112 | set(_POT_FILE "${_ARG_OUTPUT_FILE}") | ||
255 | 113 | set(_OUTPUT_FILE --output-file="${_ARG_OUTPUT_FILE}") | ||
256 | 114 | endif() | ||
257 | 115 | |||
258 | 116 | set(_PO_DIRECTORY "${CMAKE_SOURCE_DIR}/po") | ||
259 | 117 | if(_ARG_PO_DIRECTORY) | ||
260 | 118 | set(_PO_DIRECTORY "${_ARG_PO_DIRECTORY}") | ||
261 | 119 | endif() | ||
262 | 120 | |||
263 | 121 | file( | ||
264 | 122 | GLOB_RECURSE _CODE_SOURCES | ||
265 | 123 | ${CMAKE_SOURCE_DIR}/*.cpp | ||
266 | 124 | ${CMAKE_SOURCE_DIR}/*.cc | ||
267 | 125 | ${CMAKE_SOURCE_DIR}/*.cxx | ||
268 | 126 | ${CMAKE_SOURCE_DIR}/*.vala | ||
269 | 127 | ${CMAKE_SOURCE_DIR}/*.c | ||
270 | 128 | ${CMAKE_SOURCE_DIR}/*.h | ||
271 | 129 | ${CMAKE_SOURCE_DIR}/*.ini.in | ||
272 | 130 | ) | ||
273 | 131 | |||
274 | 132 | add_custom_command( | ||
275 | 133 | OUTPUT | ||
276 | 134 | "${_PO_DIRECTORY}/${_POT_FILE}" | ||
277 | 135 | COMMAND ${INTLTOOL_UPDATE_EXECUTABLE} --pot ${_OUTPUT_FILE} ${_GETTEXT_PACKAGE} | ||
278 | 136 | DEPENDS | ||
279 | 137 | "${_PO_DIRECTORY}/POTFILES.in" | ||
280 | 138 | ${_CODE_SOURCES} | ||
281 | 139 | WORKING_DIRECTORY ${_PO_DIRECTORY} | ||
282 | 140 | ) | ||
283 | 141 | |||
284 | 142 | _GETTEXT_GET_UNIQUE_TARGET_NAME(${_POT_FILE} _UNIQUE_TARGET_NAME) | ||
285 | 143 | |||
286 | 144 | if(_ARG_ALL) | ||
287 | 145 | add_custom_target( | ||
288 | 146 | ${_UNIQUE_TARGET_NAME} | ||
289 | 147 | ALL | ||
290 | 148 | DEPENDS | ||
291 | 149 | "${_PO_DIRECTORY}/${_POT_FILE}" | ||
292 | 150 | ) | ||
293 | 151 | else() | ||
294 | 152 | add_custom_target( | ||
295 | 153 | ${_UNIQUE_TARGET_NAME} | ||
296 | 154 | DEPENDS | ||
297 | 155 | "${_PO_DIRECTORY}/${_POT_FILE}" | ||
298 | 156 | ) | ||
299 | 157 | endif() | ||
300 | 158 | endfunction() | ||
301 | 159 | |||
302 | 160 | function(INTLTOOL_INSTALL_TRANSLATIONS) | ||
303 | 161 | set(_options ALL) | ||
304 | 162 | set(_oneValueArgs GETTEXT_PACKAGE POT_FILE) | ||
305 | 163 | |||
306 | 164 | cmake_parse_arguments(_ARG "${_options}" "${_oneValueArgs}" "" ${ARGN}) | ||
307 | 165 | |||
308 | 166 | set(_POT_FILE "${PROJECT}.pot") | ||
309 | 167 | |||
310 | 168 | if(_ARG_GETTEXT_PACKAGE) | ||
311 | 169 | set(_POT_FILE "${_ARG_GETTEXT_PACKAGE}.pot") | ||
312 | 170 | endif() | ||
313 | 171 | |||
314 | 172 | if(_ARG_OUTPUT_FILE) | ||
315 | 173 | set(_POT_FILE "${_ARG_OUTPUT_FILE}") | ||
316 | 174 | endif() | ||
317 | 175 | |||
318 | 176 | file( | ||
319 | 177 | GLOB _PO_FILES | ||
320 | 178 | ${CMAKE_CURRENT_SOURCE_DIR}/*.po | ||
321 | 179 | ) | ||
322 | 180 | |||
323 | 181 | get_filename_component(_ABS_POT_FILE ${_POT_FILE} ABSOLUTE) | ||
324 | 182 | |||
325 | 183 | foreach(_PO_FILE ${_PO_FILES}) | ||
326 | 184 | add_custom_command( | ||
327 | 185 | OUTPUT | ||
328 | 186 | ${_PO_FILE} | ||
329 | 187 | COMMAND | ||
330 | 188 | ${GETTEXT_MSGMERGE_EXECUTABLE} --quiet --update --backup=none -s ${_PO_FILE} ${_ABS_POT_FILE} | ||
331 | 189 | DEPENDS | ||
332 | 190 | ${_ABS_POT_FILE} | ||
333 | 191 | ) | ||
334 | 192 | endforeach() | ||
335 | 193 | |||
336 | 194 | if(_ARG_ALL) | ||
337 | 195 | gettext_create_translations( | ||
338 | 196 | ${_POT_FILE} | ||
339 | 197 | ALL | ||
340 | 198 | ${_PO_FILES} | ||
341 | 199 | ) | ||
342 | 200 | else() | ||
343 | 201 | gettext_create_translations( | ||
344 | 202 | ${_POT_FILE} | ||
345 | 203 | ${_PO_FILES} | ||
346 | 204 | ) | ||
347 | 205 | endif() | ||
348 | 206 | endfunction() | ||
349 | 207 | |||
350 | 208 | function(INTLTOOL_MERGE_TRANSLATIONS FILENAME OUTPUT_FILE) | ||
351 | 209 | set(_options ALL UTF8 PASS_THROUGH) | ||
352 | 210 | set(_oneValueArgs PO_DIRECTORY) | ||
353 | 211 | |||
354 | 212 | cmake_parse_arguments(_ARG "${_options}" "${_oneValueArgs}" "" ${ARGN}) | ||
355 | 213 | |||
356 | 214 | get_filename_component(_ABS_FILENAME ${FILENAME} ABSOLUTE) | ||
357 | 215 | |||
358 | 216 | set(_PO_DIRECTORY "${CMAKE_SOURCE_DIR}/po") | ||
359 | 217 | if(_ARG_PO_DIRECTORY) | ||
360 | 218 | set(_PO_DIRECTORY "${_ARG_PO_DIRECTORY}") | ||
361 | 219 | endif() | ||
362 | 220 | |||
363 | 221 | set(_UTF8 "") | ||
364 | 222 | if(_ARG_UTF8) | ||
365 | 223 | set(_UTF8 "--utf8") | ||
366 | 224 | endif() | ||
367 | 225 | |||
368 | 226 | set(_PASS_THROUGH "") | ||
369 | 227 | if(_ARG_PASS_THROUGH) | ||
370 | 228 | set(_PASS_THROUGH "--pass-through") | ||
371 | 229 | endif() | ||
372 | 230 | |||
373 | 231 | file( | ||
374 | 232 | GLOB_RECURSE _PO_FILES | ||
375 | 233 | ${_PO_DIRECTORY}/*.po | ||
376 | 234 | ) | ||
377 | 235 | |||
378 | 236 | add_custom_command( | ||
379 | 237 | OUTPUT | ||
380 | 238 | ${OUTPUT_FILE} | ||
381 | 239 | COMMAND | ||
382 | 240 | ${INTLTOOL_MERGE_EXECUTABLE} --desktop-style --quiet ${_UTF8} ${_PASS_THROUGH} ${_PO_DIRECTORY} ${FILENAME} ${OUTPUT_FILE} | ||
383 | 241 | DEPENDS | ||
384 | 242 | ${_ABS_FILENAME} | ||
385 | 243 | ${_PO_FILES} | ||
386 | 244 | WORKING_DIRECTORY | ||
387 | 245 | ${CMAKE_CURRENT_SOURCE_DIR} | ||
388 | 246 | ) | ||
389 | 247 | |||
390 | 248 | get_filename_component(_OUTPUT_NAME ${OUTPUT_FILE} NAME) | ||
391 | 249 | _GETTEXT_GET_UNIQUE_TARGET_NAME(${_OUTPUT_NAME} _UNIQUE_TARGET_NAME) | ||
392 | 250 | |||
393 | 251 | if(_ARG_ALL) | ||
394 | 252 | add_custom_target( | ||
395 | 253 | ${_UNIQUE_TARGET_NAME} | ||
396 | 254 | ALL | ||
397 | 255 | DEPENDS | ||
398 | 256 | ${OUTPUT_FILE} | ||
399 | 257 | ) | ||
400 | 258 | else() | ||
401 | 259 | add_custom_target( | ||
402 | 260 | ${_UNIQUE_TARGET_NAME} | ||
403 | 261 | DEPENDS | ||
404 | 262 | ${OUTPUT_FILE} | ||
405 | 263 | ) | ||
406 | 264 | endif() | ||
407 | 265 | endfunction() | ||
408 | 266 | 0 | ||
409 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/data' | |||
410 | === removed file 'share/qtcreator/templates/wizards/ubuntu/scope/data/CMakeLists.txt' | |||
411 | --- share/qtcreator/templates/wizards/ubuntu/scope/data/CMakeLists.txt 2014-11-21 14:45:30 +0000 | |||
412 | +++ share/qtcreator/templates/wizards/ubuntu/scope/data/CMakeLists.txt 1970-01-01 00:00:00 +0000 | |||
413 | @@ -1,10 +0,0 @@ | |||
414 | 1 | |||
415 | 2 | # Install the scope images | ||
416 | 3 | install( | ||
417 | 4 | FILES | ||
418 | 5 | "icon.png" | ||
419 | 6 | "logo.png" | ||
420 | 7 | "screenshot.png" | ||
421 | 8 | DESTINATION | ||
422 | 9 | "${SCOPE_INSTALL_DIR}" | ||
423 | 10 | ) | ||
424 | 11 | 0 | ||
425 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/include' | |||
426 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/include/api' | |||
427 | === removed file 'share/qtcreator/templates/wizards/ubuntu/scope/include/api/config.h' | |||
428 | --- share/qtcreator/templates/wizards/ubuntu/scope/include/api/config.h 2014-10-27 16:24:10 +0000 | |||
429 | +++ share/qtcreator/templates/wizards/ubuntu/scope/include/api/config.h 1970-01-01 00:00:00 +0000 | |||
430 | @@ -1,27 +0,0 @@ | |||
431 | 1 | #ifndef API_CONFIG_H_ | ||
432 | 2 | #define API_CONFIG_H_ | ||
433 | 3 | |||
434 | 4 | #include <memory> | ||
435 | 5 | #include <string> | ||
436 | 6 | |||
437 | 7 | namespace api { | ||
438 | 8 | |||
439 | 9 | struct Config { | ||
440 | 10 | typedef std::shared_ptr<Config> Ptr; | ||
441 | 11 | |||
442 | 12 | @if "%ContentType%".substring(0, "network".length) === "network" | ||
443 | 13 | /* | ||
444 | 14 | * The root of all API request URLs | ||
445 | 15 | */ | ||
446 | 16 | std::string apiroot { "http://api.openweathermap.org" }; | ||
447 | 17 | |||
448 | 18 | /* | ||
449 | 19 | * The custom HTTP user agent string for this library | ||
450 | 20 | */ | ||
451 | 21 | std::string user_agent { "example-network-scope 0.1; (foo)" }; | ||
452 | 22 | @endif | ||
453 | 23 | }; | ||
454 | 24 | |||
455 | 25 | } | ||
456 | 26 | |||
457 | 27 | #endif /* API_CONFIG_H_ */ | ||
458 | 28 | 0 | ||
459 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/include/scope' | |||
460 | === modified file 'share/qtcreator/templates/wizards/ubuntu/scope/po/POTFILES.in' | |||
461 | --- share/qtcreator/templates/wizards/ubuntu/scope/po/POTFILES.in 2015-01-07 10:50:28 +0000 | |||
462 | +++ share/qtcreator/templates/wizards/ubuntu/scope/po/POTFILES.in 2015-05-19 10:38:08 +0000 | |||
463 | @@ -1,11 +1,11 @@ | |||
475 | 1 | [type: gettext/ini] data/%ProjectName:l%.%ClickDomain:l%_%ClickHookName:l%.ini.in | 1 | [type: gettext/ini] src/data/%ClickHookName:l%.ini.in |
476 | 2 | include/api/config.h | 2 | [type: gettext/ini] src/data/%ClickHookName:l%-settings.ini.in |
477 | 3 | include/api/client.h | 3 | src/client.cpp |
478 | 4 | include/scope/preview.h | 4 | src/client.h |
479 | 5 | include/scope/localization.h | 5 | src/localization.h |
480 | 6 | include/scope/query.h | 6 | src/preview.cpp |
481 | 7 | include/scope/scope.h | 7 | src/preview.h |
482 | 8 | src/api/client.cpp | 8 | src/query.cpp |
483 | 9 | src/scope/query.cpp | 9 | src/query.h |
484 | 10 | src/scope/scope.cpp | 10 | src/scope.cpp |
485 | 11 | src/scope/preview.cpp | 11 | src/scope.h |
486 | 12 | 12 | ||
487 | === modified file 'share/qtcreator/templates/wizards/ubuntu/scope/src/CMakeLists.txt' | |||
488 | --- share/qtcreator/templates/wizards/ubuntu/scope/src/CMakeLists.txt 2014-11-21 14:45:30 +0000 | |||
489 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/CMakeLists.txt 2015-05-19 10:38:08 +0000 | |||
490 | @@ -1,66 +1,64 @@ | |||
491 | 1 | 1 | ||
494 | 2 | # Put the ini file in the build directory next to the scope | 2 | # Put the ini files in the build directory next to the scope |
495 | 3 | # .so file so test tools can find both easily. | 3 | # .so file so that the test tools can find them. |
496 | 4 | intltool_merge_translations( | 4 | intltool_merge_translations( |
498 | 5 | "${CMAKE_SOURCE_DIR}/data/${SCOPE_NAME}.ini.in" | 5 | "data/%ClickHookName:l%.ini.in" |
499 | 6 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini" | 6 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini" |
500 | 7 | ALL | 7 | ALL |
501 | 8 | UTF8 | 8 | UTF8 |
502 | 9 | ) | 9 | ) |
503 | 10 | intltool_merge_translations( | ||
504 | 11 | "data/%ClickHookName:l%-settings.ini.in" | ||
505 | 12 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}-settings.ini" | ||
506 | 13 | ALL | ||
507 | 14 | UTF8 | ||
508 | 15 | ) | ||
509 | 10 | 16 | ||
511 | 11 | # Install the scope ini file | 17 | # Install the scope ini files |
512 | 12 | install( | 18 | install( |
515 | 13 | FILES "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini" | 19 | FILES |
516 | 14 | DESTINATION ${SCOPE_INSTALL_DIR} | 20 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}.ini" |
517 | 21 | "${CMAKE_CURRENT_BINARY_DIR}/${SCOPE_NAME}-settings.ini" | ||
518 | 22 | DESTINATION | ||
519 | 23 | ${SCOPE_INSTALL_DIR} | ||
520 | 15 | ) | 24 | ) |
521 | 16 | 25 | ||
522 | 26 | # Put the logo file in the build directory next to the scope | ||
523 | 27 | # .ini file so that the test tools can find it. | ||
524 | 17 | configure_file( | 28 | configure_file( |
526 | 18 | "${CMAKE_SOURCE_DIR}/data/logo.png" | 29 | "data/logo.png" |
527 | 19 | "${CMAKE_CURRENT_BINARY_DIR}/logo.png" | 30 | "${CMAKE_CURRENT_BINARY_DIR}/logo.png" |
528 | 20 | @ONLY | 31 | @ONLY |
529 | 21 | COPYONLY | 32 | COPYONLY |
530 | 22 | ) | 33 | ) |
531 | 23 | 34 | ||
538 | 24 | # The sources to build the scope | 35 | # Install the scope images |
539 | 25 | set(SCOPE_SOURCES | 36 | install( |
540 | 26 | api/client.cpp | 37 | FILES |
541 | 27 | scope/preview.cpp | 38 | "data/icon.png" |
542 | 28 | scope/query.cpp | 39 | "data/logo.png" |
543 | 29 | scope/scope.cpp | 40 | "data/screenshot.png" |
544 | 41 | DESTINATION | ||
545 | 42 | ${SCOPE_INSTALL_DIR} | ||
546 | 30 | ) | 43 | ) |
547 | 31 | 44 | ||
549 | 32 | # Find all the headers | 45 | # Find all the sources |
550 | 33 | file(GLOB_RECURSE | 46 | file(GLOB_RECURSE |
567 | 34 | SCOPE_HEADERS | 47 | SCOPE_SOURCES |
568 | 35 | "${CMAKE_SOURCE_DIR}/include/*.h" | 48 | "*.cpp" |
569 | 36 | ) | 49 | "*.h" |
554 | 37 | |||
555 | 38 | # Build an object library for the scope code | ||
556 | 39 | add_library( | ||
557 | 40 | scope-static OBJECT | ||
558 | 41 | ${SCOPE_SOURCES} | ||
559 | 42 | ${SCOPE_HEADERS} | ||
560 | 43 | ) | ||
561 | 44 | |||
562 | 45 | # Ensure we export all the symbols | ||
563 | 46 | set_target_properties( | ||
564 | 47 | scope-static | ||
565 | 48 | PROPERTIES | ||
566 | 49 | LINK_FLAGS "-Wl,--export-all-symbols" | ||
570 | 50 | ) | 50 | ) |
571 | 51 | 51 | ||
572 | 52 | # Build a shared library containing our scope code. | 52 | # Build a shared library containing our scope code. |
573 | 53 | # This will be the actual plugin that is loaded. | ||
574 | 54 | add_library( | 53 | add_library( |
575 | 55 | scope SHARED | 54 | scope SHARED |
577 | 56 | $<TARGET_OBJECTS:scope-static> | 55 | ${SCOPE_SOURCES} |
578 | 57 | ) | 56 | ) |
579 | 58 | 57 | ||
580 | 59 | # Link against the object library and our external library dependencies | 58 | # Link against the object library and our external library dependencies |
581 | 60 | target_link_libraries( | 59 | target_link_libraries( |
582 | 61 | scope | 60 | scope |
583 | 62 | ${SCOPE_LDFLAGS} | 61 | ${SCOPE_LDFLAGS} |
584 | 63 | ${Boost_LIBRARIES} | ||
585 | 64 | ) | 62 | ) |
586 | 65 | 63 | ||
587 | 66 | @if "%ContentType%".substring(0, "network-netcpp-q".length) === "network-netcpp-q" | 64 | @if "%ContentType%".substring(0, "network-netcpp-q".length) === "network-netcpp-q" |
588 | 67 | 65 | ||
589 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/src/api' | |||
590 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/src/api/client.cpp' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/client.cpp' | |||
591 | --- share/qtcreator/templates/wizards/ubuntu/scope/src/api/client.cpp 2014-12-15 10:12:40 +0000 | |||
592 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/client.cpp 2015-05-19 10:38:08 +0000 | |||
593 | @@ -1,4 +1,4 @@ | |||
595 | 1 | #include <api/client.h> | 1 | #include <client.h> |
596 | 2 | 2 | ||
597 | 3 | @if "%ContentType%".substring(0, "network-netcpp".length) === "network-netcpp" | 3 | @if "%ContentType%".substring(0, "network-netcpp".length) === "network-netcpp" |
598 | 4 | #include <core/net/error.h> | 4 | #include <core/net/error.h> |
599 | @@ -18,7 +18,6 @@ | |||
600 | 18 | @endif | 18 | @endif |
601 | 19 | @endif | 19 | @endif |
602 | 20 | 20 | ||
603 | 21 | using namespace api; | ||
604 | 22 | using namespace std; | 21 | using namespace std; |
605 | 23 | 22 | ||
606 | 24 | Client::Client(Config::Ptr config) : | 23 | Client::Client(Config::Ptr config) : |
607 | @@ -495,6 +494,6 @@ | |||
608 | 495 | cancelled_ = true; | 494 | cancelled_ = true; |
609 | 496 | } | 495 | } |
610 | 497 | 496 | ||
612 | 498 | Config::Ptr Client::config() { | 497 | Client::Config::Ptr Client::config() { |
613 | 499 | return config_; | 498 | return config_; |
614 | 500 | } | 499 | } |
615 | 501 | 500 | ||
616 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/include/api/client.h' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/client.h' | |||
617 | --- share/qtcreator/templates/wizards/ubuntu/scope/include/api/client.h 2014-10-29 15:28:52 +0000 | |||
618 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/client.h 2015-05-19 10:38:08 +0000 | |||
619 | @@ -1,11 +1,10 @@ | |||
624 | 1 | #ifndef API_CLIENT_H_ | 1 | #ifndef CLIENT_H_ |
625 | 2 | #define API_CLIENT_H_ | 2 | #define CLIENT_H_ |
622 | 3 | |||
623 | 4 | #include <api/config.h> | ||
626 | 5 | 3 | ||
627 | 6 | #include <atomic> | 4 | #include <atomic> |
628 | 7 | #include <deque> | 5 | #include <deque> |
629 | 8 | #include <map> | 6 | #include <map> |
630 | 7 | #include <memory> | ||
631 | 9 | #include <string> | 8 | #include <string> |
632 | 10 | @if "%ContentType%".substring(0, "network".length) === "network" | 9 | @if "%ContentType%".substring(0, "network".length) === "network" |
633 | 11 | #include <core/net/http/request.h> | 10 | #include <core/net/http/request.h> |
634 | @@ -22,8 +21,6 @@ | |||
635 | 22 | @endif | 21 | @endif |
636 | 23 | @endif | 22 | @endif |
637 | 24 | 23 | ||
638 | 25 | namespace api { | ||
639 | 26 | |||
640 | 27 | /** | 24 | /** |
641 | 28 | * Provide a nice way to access the HTTP API. | 25 | * Provide a nice way to access the HTTP API. |
642 | 29 | * | 26 | * |
643 | @@ -32,6 +29,19 @@ | |||
644 | 32 | class Client { | 29 | class Client { |
645 | 33 | public: | 30 | public: |
646 | 34 | 31 | ||
647 | 32 | /** | ||
648 | 33 | * Client configuration | ||
649 | 34 | */ | ||
650 | 35 | struct Config { | ||
651 | 36 | typedef std::shared_ptr<Config> Ptr; | ||
652 | 37 | |||
653 | 38 | // The root of all API request URLs | ||
654 | 39 | std::string apiroot { "http://api.openweathermap.org" }; | ||
655 | 40 | |||
656 | 41 | // The custom HTTP user agent string for this library | ||
657 | 42 | std::string user_agent { "example-network-scope 0.1; (foo)" }; | ||
658 | 43 | }; | ||
659 | 44 | |||
660 | 35 | @if "%ContentType%" == "empty" | 45 | @if "%ContentType%" == "empty" |
661 | 36 | /** | 46 | /** |
662 | 37 | * Result struct | 47 | * Result struct |
663 | @@ -163,6 +173,4 @@ | |||
664 | 163 | std::atomic<bool> cancelled_; | 173 | std::atomic<bool> cancelled_; |
665 | 164 | }; | 174 | }; |
666 | 165 | 175 | ||
670 | 166 | } | 176 | #endif // CLIENT_H_ |
668 | 167 | |||
669 | 168 | #endif // API_CLIENT_H_ | ||
671 | 169 | 177 | ||
672 | === added directory 'share/qtcreator/templates/wizards/ubuntu/scope/src/data' | |||
673 | === added file 'share/qtcreator/templates/wizards/ubuntu/scope/src/data/displayName-settings.ini.in' | |||
674 | --- share/qtcreator/templates/wizards/ubuntu/scope/src/data/displayName-settings.ini.in 1970-01-01 00:00:00 +0000 | |||
675 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/data/displayName-settings.ini.in 2015-05-19 10:38:08 +0000 | |||
676 | @@ -0,0 +1,21 @@ | |||
677 | 1 | @if "%ContentType%".substring(0, "network".length) === "network" | ||
678 | 2 | # Below are some example settings. You can access your scope's | ||
679 | 3 | # settings by calling settings() from the Query::run() method. | ||
680 | 4 | # E.g. auto location = settings().at("location").get_string(); | ||
681 | 5 | |||
682 | 6 | #[location] | ||
683 | 7 | #type = string | ||
684 | 8 | #defaultValue = London,uk | ||
685 | 9 | #_displayName = Default Location | ||
686 | 10 | |||
687 | 11 | #[units] | ||
688 | 12 | #type = list | ||
689 | 13 | #_displayName = Temperature Units | ||
690 | 14 | #_displayValues = Metric;Imperial | ||
691 | 15 | #defaultValue = 0 | ||
692 | 16 | |||
693 | 17 | #[forecast] | ||
694 | 18 | #type = boolean | ||
695 | 19 | #defaultValue = true | ||
696 | 20 | #_displayName = Show Forecast | ||
697 | 21 | @endif | ||
698 | 0 | 22 | ||
699 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/data/displayName.ini.in' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/data/displayName.ini.in' | |||
700 | --- share/qtcreator/templates/wizards/ubuntu/scope/data/displayName.ini.in 2014-11-21 14:45:30 +0000 | |||
701 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/data/displayName.ini.in 2015-05-19 10:38:08 +0000 | |||
702 | @@ -4,6 +4,7 @@ | |||
703 | 4 | Art=screenshot.png | 4 | Art=screenshot.png |
704 | 5 | Author=Firstname Lastname | 5 | Author=Firstname Lastname |
705 | 6 | Icon=icon.png | 6 | Icon=icon.png |
706 | 7 | Keywords=weather | ||
707 | 7 | 8 | ||
708 | 8 | [Appearance] | 9 | [Appearance] |
709 | 9 | PageHeader.Logo=logo.png | 10 | PageHeader.Logo=logo.png |
710 | 10 | 11 | ||
711 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/data/icon.png' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/data/icon.png' | |||
712 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/data/logo.png' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/data/logo.png' | |||
713 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/data/screenshot.png' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/data/screenshot.png' | |||
714 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/include/scope/localization.h' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/localization.h' | |||
715 | --- share/qtcreator/templates/wizards/ubuntu/scope/include/scope/localization.h 2014-10-13 13:33:36 +0000 | |||
716 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/localization.h 2015-05-19 10:38:08 +0000 | |||
717 | @@ -1,5 +1,5 @@ | |||
720 | 1 | #ifndef SCOPE_LOCALIZATION_H_ | 1 | #ifndef LOCALIZATION_H_ |
721 | 2 | #define SCOPE_LOCALIZATION_H_ | 2 | #define LOCALIZATION_H_ |
722 | 3 | 3 | ||
723 | 4 | #include <libintl.h> | 4 | #include <libintl.h> |
724 | 5 | #include <string> | 5 | #include <string> |
725 | @@ -18,5 +18,5 @@ | |||
726 | 18 | } | 18 | } |
727 | 19 | } | 19 | } |
728 | 20 | 20 | ||
730 | 21 | #endif // SCOPE_LOCALIZATION_H_ | 21 | #endif // LOCALIZATION_H_ |
731 | 22 | 22 | ||
732 | 23 | 23 | ||
733 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/src/scope/preview.cpp' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/preview.cpp' | |||
734 | --- share/qtcreator/templates/wizards/ubuntu/scope/src/scope/preview.cpp 2014-12-15 10:12:40 +0000 | |||
735 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/preview.cpp 2015-05-19 10:38:08 +0000 | |||
736 | @@ -1,4 +1,4 @@ | |||
738 | 1 | #include <scope/preview.h> | 1 | #include <preview.h> |
739 | 2 | 2 | ||
740 | 3 | #include <unity/scopes/ColumnLayout.h> | 3 | #include <unity/scopes/ColumnLayout.h> |
741 | 4 | #include <unity/scopes/PreviewWidget.h> | 4 | #include <unity/scopes/PreviewWidget.h> |
742 | @@ -11,10 +11,9 @@ | |||
743 | 11 | namespace sc = unity::scopes; | 11 | namespace sc = unity::scopes; |
744 | 12 | 12 | ||
745 | 13 | using namespace std; | 13 | using namespace std; |
746 | 14 | using namespace scope; | ||
747 | 15 | 14 | ||
748 | 16 | Preview::Preview(const sc::Result &result, const sc::ActionMetadata &metadata) : | 15 | Preview::Preview(const sc::Result &result, const sc::ActionMetadata &metadata) : |
750 | 17 | sc::PreviewQueryBase(result, metadata) { | 16 | sc::PreviewQueryBase(result, metadata) { |
751 | 18 | } | 17 | } |
752 | 19 | 18 | ||
753 | 20 | void Preview::cancelled() { | 19 | void Preview::cancelled() { |
754 | @@ -32,36 +31,36 @@ | |||
755 | 32 | // However, we recommend that scopes define layouts for the best visual appearance. | 31 | // However, we recommend that scopes define layouts for the best visual appearance. |
756 | 33 | 32 | ||
757 | 34 | // Single column layout | 33 | // Single column layout |
759 | 35 | layout1col.add_column( { "image", "header", "summary" }); | 34 | layout1col.add_column( { "image_widget", "header_widget", "summary_widget" } ); |
760 | 36 | 35 | ||
761 | 37 | // Two column layout | 36 | // Two column layout |
764 | 38 | layout2col.add_column( { "image" }); | 37 | layout2col.add_column( { "image_widget" } ); |
765 | 39 | layout2col.add_column( { "header", "summary" }); | 38 | layout2col.add_column( { "header_widget", "summary_widget" } ); |
766 | 40 | 39 | ||
767 | 41 | // Three cokumn layout | 40 | // Three cokumn layout |
771 | 42 | layout3col.add_column( { "image" }); | 41 | layout3col.add_column( { "image_widget" }); |
772 | 43 | layout3col.add_column( { "header", "summary" }); | 42 | layout3col.add_column( { "header_widget", "summary_widget" } ); |
773 | 44 | layout3col.add_column( { }); | 43 | layout3col.add_column( { } ); |
774 | 45 | 44 | ||
775 | 46 | // Register the layouts we just created | 45 | // Register the layouts we just created |
777 | 47 | reply->register_layout( { layout1col, layout2col, layout3col }); | 46 | reply->register_layout( { layout1col, layout2col, layout3col } ); |
778 | 47 | |||
779 | 48 | // Define the image section | ||
780 | 49 | sc::PreviewWidget image("image_widget", "image"); | ||
781 | 50 | // It has a single "source" property, mapped to the result's "art" property | ||
782 | 51 | image.add_attribute_mapping("source", "art"); | ||
783 | 48 | 52 | ||
784 | 49 | // Define the header section | 53 | // Define the header section |
787 | 50 | sc::PreviewWidget header("header", "header"); | 54 | sc::PreviewWidget header("header_widget", "header"); |
788 | 51 | // It has title and a subtitle properties | 55 | // It has a "title" and a "subtitle" property |
789 | 52 | header.add_attribute_mapping("title", "title"); | 56 | header.add_attribute_mapping("title", "title"); |
790 | 53 | header.add_attribute_mapping("subtitle", "subtitle"); | 57 | header.add_attribute_mapping("subtitle", "subtitle"); |
791 | 54 | 58 | ||
792 | 55 | // Define the image section | ||
793 | 56 | sc::PreviewWidget image("image", "image"); | ||
794 | 57 | // It has a single source property, mapped to the result's art property | ||
795 | 58 | image.add_attribute_mapping("source", "art"); | ||
796 | 59 | |||
797 | 60 | // Define the summary section | 59 | // Define the summary section |
801 | 61 | sc::PreviewWidget description("summary", "text"); | 60 | sc::PreviewWidget summary("summary_widget", "text"); |
802 | 62 | // It has a text property, mapped to the result's description property | 61 | // It has a "text" property, mapped to the result's "description" property |
803 | 63 | description.add_attribute_mapping("text", "description"); | 62 | summary.add_attribute_mapping("text", "description"); |
804 | 64 | 63 | ||
805 | 65 | // Push each of the sections | 64 | // Push each of the sections |
807 | 66 | reply->push( { image, header, description }); | 65 | reply->push( { image, header, summary } ); |
808 | 67 | } | 66 | } |
809 | 68 | 67 | ||
810 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/include/scope/preview.h' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/preview.h' | |||
811 | --- share/qtcreator/templates/wizards/ubuntu/scope/include/scope/preview.h 2014-09-03 14:56:27 +0000 | |||
812 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/preview.h 2015-05-19 10:38:08 +0000 | |||
813 | @@ -1,5 +1,5 @@ | |||
816 | 1 | #ifndef SCOPE_PREVIEW_H_ | 1 | #ifndef PREVIEW_H_ |
817 | 2 | #define SCOPE_PREVIEW_H_ | 2 | #define PREVIEW_H_ |
818 | 3 | 3 | ||
819 | 4 | #include <unity/scopes/PreviewQueryBase.h> | 4 | #include <unity/scopes/PreviewQueryBase.h> |
820 | 5 | 5 | ||
821 | @@ -9,8 +9,6 @@ | |||
822 | 9 | } | 9 | } |
823 | 10 | } | 10 | } |
824 | 11 | 11 | ||
825 | 12 | namespace scope { | ||
826 | 13 | |||
827 | 14 | /** | 12 | /** |
828 | 15 | * Represents an individual preview request. | 13 | * Represents an individual preview request. |
829 | 16 | * | 14 | * |
830 | @@ -32,6 +30,4 @@ | |||
831 | 32 | void run(unity::scopes::PreviewReplyProxy const& reply) override; | 30 | void run(unity::scopes::PreviewReplyProxy const& reply) override; |
832 | 33 | }; | 31 | }; |
833 | 34 | 32 | ||
837 | 35 | } | 33 | #endif // PREVIEW_H_ |
835 | 36 | |||
836 | 37 | #endif // SCOPE_PREVIEW_H_ | ||
838 | 38 | 34 | ||
839 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/src/scope/query.cpp' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/query.cpp' | |||
840 | --- share/qtcreator/templates/wizards/ubuntu/scope/src/scope/query.cpp 2014-12-15 10:12:40 +0000 | |||
841 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/query.cpp 2015-05-19 10:38:08 +0000 | |||
842 | @@ -1,7 +1,5 @@ | |||
847 | 1 | #include <boost/algorithm/string/trim.hpp> | 1 | #include <query.h> |
848 | 2 | 2 | #include <localization.h> | |
845 | 3 | #include <scope/localization.h> | ||
846 | 4 | #include <scope/query.h> | ||
849 | 5 | 3 | ||
850 | 6 | #include <unity/scopes/Annotation.h> | 4 | #include <unity/scopes/Annotation.h> |
851 | 7 | #include <unity/scopes/CategorisedResult.h> | 5 | #include <unity/scopes/CategorisedResult.h> |
852 | @@ -10,18 +8,16 @@ | |||
853 | 10 | #include <unity/scopes/SearchReply.h> | 8 | #include <unity/scopes/SearchReply.h> |
854 | 11 | 9 | ||
855 | 12 | #include <iomanip> | 10 | #include <iomanip> |
856 | 11 | #include <iostream> | ||
857 | 13 | #include <sstream> | 12 | #include <sstream> |
858 | 14 | 13 | ||
859 | 15 | namespace sc = unity::scopes; | 14 | namespace sc = unity::scopes; |
860 | 16 | namespace alg = boost::algorithm; | ||
861 | 17 | 15 | ||
862 | 18 | using namespace std; | 16 | using namespace std; |
863 | 19 | using namespace api; | ||
864 | 20 | using namespace scope; | ||
865 | 21 | 17 | ||
866 | 22 | @if "%ContentType%" == "empty" | 18 | @if "%ContentType%" == "empty" |
867 | 23 | /** | 19 | /** |
869 | 24 | * Define the layout for theresults | 20 | * Define the layout for the results. |
870 | 25 | * | 21 | * |
871 | 26 | * The icon size is medium, and ask for the card layout | 22 | * The icon size is medium, and ask for the card layout |
872 | 27 | * itself to be horizontal. I.e. the text will be placed | 23 | * itself to be horizontal. I.e. the text will be placed |
873 | @@ -49,13 +45,36 @@ | |||
874 | 49 | 45 | ||
875 | 50 | @if "%ContentType%".substring(0, "network".length) === "network" | 46 | @if "%ContentType%".substring(0, "network".length) === "network" |
876 | 51 | /** | 47 | /** |
878 | 52 | * Define the layout for the forecast results | 48 | * Define the larger "current weather" layout. |
879 | 49 | * | ||
880 | 50 | * The icons are larger. | ||
881 | 51 | */ | ||
882 | 52 | const static string CURRENT_TEMPLATE = | ||
883 | 53 | R"( | ||
884 | 54 | { | ||
885 | 55 | "schema-version": 1, | ||
886 | 56 | "template": { | ||
887 | 57 | "category-layout": "grid", | ||
888 | 58 | "card-size": "medium" | ||
889 | 59 | }, | ||
890 | 60 | "components": { | ||
891 | 61 | "title": "title", | ||
892 | 62 | "art" : { | ||
893 | 63 | "field": "art" | ||
894 | 64 | }, | ||
895 | 65 | "subtitle": "subtitle" | ||
896 | 66 | } | ||
897 | 67 | } | ||
898 | 68 | )"; | ||
899 | 69 | |||
900 | 70 | /** | ||
901 | 71 | * Define the layout for the forecast results. | ||
902 | 53 | * | 72 | * |
903 | 54 | * The icon size is small, and ask for the card layout | 73 | * The icon size is small, and ask for the card layout |
904 | 55 | * itself to be horizontal. I.e. the text will be placed | 74 | * itself to be horizontal. I.e. the text will be placed |
905 | 56 | * next to the image. | 75 | * next to the image. |
906 | 57 | */ | 76 | */ |
908 | 58 | const static string WEATHER_TEMPLATE = | 77 | const static string FORECAST_TEMPLATE = |
909 | 59 | R"( | 78 | R"( |
910 | 60 | { | 79 | { |
911 | 61 | "schema-version": 1, | 80 | "schema-version": 1, |
912 | @@ -73,33 +92,10 @@ | |||
913 | 73 | } | 92 | } |
914 | 74 | } | 93 | } |
915 | 75 | )"; | 94 | )"; |
916 | 76 | |||
917 | 77 | /** | ||
918 | 78 | * Define the larger "current weather" layout. | ||
919 | 79 | * | ||
920 | 80 | * The icons are larger. | ||
921 | 81 | */ | ||
922 | 82 | const static string CITY_TEMPLATE = | ||
923 | 83 | R"( | ||
924 | 84 | { | ||
925 | 85 | "schema-version": 1, | ||
926 | 86 | "template": { | ||
927 | 87 | "category-layout": "grid", | ||
928 | 88 | "card-size": "medium" | ||
929 | 89 | }, | ||
930 | 90 | "components": { | ||
931 | 91 | "title": "title", | ||
932 | 92 | "art" : { | ||
933 | 93 | "field": "art" | ||
934 | 94 | }, | ||
935 | 95 | "subtitle": "subtitle" | ||
936 | 96 | } | ||
937 | 97 | } | ||
938 | 98 | )"; | ||
939 | 99 | @endif | 95 | @endif |
940 | 100 | 96 | ||
941 | 101 | Query::Query(const sc::CannedQuery &query, const sc::SearchMetadata &metadata, | 97 | Query::Query(const sc::CannedQuery &query, const sc::SearchMetadata &metadata, |
943 | 102 | Config::Ptr config) : | 98 | Client::Config::Ptr config) : |
944 | 103 | sc::SearchQueryBase(query, metadata), client_(config) { | 99 | sc::SearchQueryBase(query, metadata), client_(config) { |
945 | 104 | } | 100 | } |
946 | 105 | 101 | ||
947 | @@ -113,8 +109,8 @@ | |||
948 | 113 | // Start by getting information about the query | 109 | // Start by getting information about the query |
949 | 114 | const sc::CannedQuery &query(sc::SearchQueryBase::query()); | 110 | const sc::CannedQuery &query(sc::SearchQueryBase::query()); |
950 | 115 | 111 | ||
953 | 116 | // Trim the query string of whitespace | 112 | // Get the query string |
954 | 117 | string query_string = alg::trim_copy(query.query_string()); | 113 | string query_string = query.query_string(); |
955 | 118 | 114 | ||
956 | 119 | // the Client is the helper class that provides the results | 115 | // the Client is the helper class that provides the results |
957 | 120 | // without mixing APIs and scopes code. | 116 | // without mixing APIs and scopes code. |
958 | @@ -168,8 +164,10 @@ | |||
959 | 168 | // Start by getting information about the query | 164 | // Start by getting information about the query |
960 | 169 | const sc::CannedQuery &query(sc::SearchQueryBase::query()); | 165 | const sc::CannedQuery &query(sc::SearchQueryBase::query()); |
961 | 170 | 166 | ||
964 | 171 | // Trim the query string of whitespace | 167 | // Get the query string |
965 | 172 | string query_string = alg::trim_copy(query.query_string()); | 168 | string query_string = query.query_string(); |
966 | 169 | |||
967 | 170 | /// Populate current weather category | ||
968 | 173 | 171 | ||
969 | 174 | // the Client is the helper class that provides the results | 172 | // the Client is the helper class that provides the results |
970 | 175 | // without mixing APIs and scopes code. | 173 | // without mixing APIs and scopes code. |
971 | @@ -190,7 +188,7 @@ | |||
972 | 190 | 188 | ||
973 | 191 | // Register a category for the current weather, with the title we just built | 189 | // Register a category for the current weather, with the title we just built |
974 | 192 | auto location_cat = reply->register_category("current", ss.str(), "", | 190 | auto location_cat = reply->register_category("current", ss.str(), "", |
976 | 193 | sc::CategoryRenderer(CITY_TEMPLATE)); | 191 | sc::CategoryRenderer(CURRENT_TEMPLATE)); |
977 | 194 | 192 | ||
978 | 195 | { | 193 | { |
979 | 196 | // Create a single result for the current weather category | 194 | // Create a single result for the current weather category |
980 | @@ -218,6 +216,8 @@ | |||
981 | 218 | } | 216 | } |
982 | 219 | } | 217 | } |
983 | 220 | 218 | ||
984 | 219 | /// Populate weather forecast category | ||
985 | 220 | |||
986 | 221 | Client::Forecast forecast; | 221 | Client::Forecast forecast; |
987 | 222 | if (query_string.empty()) { | 222 | if (query_string.empty()) { |
988 | 223 | // If there is no search string, get the forecast for London | 223 | // If there is no search string, get the forecast for London |
989 | @@ -228,8 +228,8 @@ | |||
990 | 228 | } | 228 | } |
991 | 229 | 229 | ||
992 | 230 | // Register a category for the forecast | 230 | // Register a category for the forecast |
995 | 231 | auto forecast_cat = reply->register_category("forecast", | 231 | auto forecast_cat = reply->register_category("forecast", _("7 day forecast"), "", |
996 | 232 | _("7 day forecast"), "", sc::CategoryRenderer(WEATHER_TEMPLATE)); | 232 | sc::CategoryRenderer(FORECAST_TEMPLATE)); |
997 | 233 | 233 | ||
998 | 234 | // For each of the forecast days | 234 | // For each of the forecast days |
999 | 235 | for (const auto &weather : forecast.weather) { | 235 | for (const auto &weather : forecast.weather) { |
1000 | 236 | 236 | ||
1001 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/include/scope/query.h' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/query.h' | |||
1002 | --- share/qtcreator/templates/wizards/ubuntu/scope/include/scope/query.h 2014-09-03 14:56:27 +0000 | |||
1003 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/query.h 2015-05-19 10:38:08 +0000 | |||
1004 | @@ -1,13 +1,11 @@ | |||
1007 | 1 | #ifndef SCOPE_QUERY_H_ | 1 | #ifndef QUERY_H_ |
1008 | 2 | #define SCOPE_QUERY_H_ | 2 | #define QUERY_H_ |
1009 | 3 | 3 | ||
1011 | 4 | #include <api/client.h> | 4 | #include <client.h> |
1012 | 5 | 5 | ||
1013 | 6 | #include <unity/scopes/SearchQueryBase.h> | 6 | #include <unity/scopes/SearchQueryBase.h> |
1014 | 7 | #include <unity/scopes/ReplyProxyFwd.h> | 7 | #include <unity/scopes/ReplyProxyFwd.h> |
1015 | 8 | 8 | ||
1016 | 9 | namespace scope { | ||
1017 | 10 | |||
1018 | 11 | /** | 9 | /** |
1019 | 12 | * Represents an individual query. | 10 | * Represents an individual query. |
1020 | 13 | * | 11 | * |
1021 | @@ -18,7 +16,7 @@ | |||
1022 | 18 | class Query: public unity::scopes::SearchQueryBase { | 16 | class Query: public unity::scopes::SearchQueryBase { |
1023 | 19 | public: | 17 | public: |
1024 | 20 | Query(const unity::scopes::CannedQuery &query, | 18 | Query(const unity::scopes::CannedQuery &query, |
1026 | 21 | const unity::scopes::SearchMetadata &metadata, api::Config::Ptr config); | 19 | const unity::scopes::SearchMetadata &metadata, Client::Config::Ptr config); |
1027 | 22 | 20 | ||
1028 | 23 | ~Query() = default; | 21 | ~Query() = default; |
1029 | 24 | 22 | ||
1030 | @@ -27,10 +25,8 @@ | |||
1031 | 27 | void run(const unity::scopes::SearchReplyProxy &reply) override; | 25 | void run(const unity::scopes::SearchReplyProxy &reply) override; |
1032 | 28 | 26 | ||
1033 | 29 | private: | 27 | private: |
1035 | 30 | api::Client client_; | 28 | Client client_; |
1036 | 31 | }; | 29 | }; |
1037 | 32 | 30 | ||
1041 | 33 | } | 31 | #endif // QUERY_H_ |
1039 | 34 | |||
1040 | 35 | #endif // SCOPE_QUERY_H_ | ||
1042 | 36 | 32 | ||
1043 | 37 | 33 | ||
1044 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/src/scope' | |||
1045 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/src/scope/scope.cpp' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/scope.cpp' | |||
1046 | --- share/qtcreator/templates/wizards/ubuntu/scope/src/scope/scope.cpp 2014-10-27 16:24:10 +0000 | |||
1047 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/scope.cpp 2015-05-19 10:38:08 +0000 | |||
1048 | @@ -1,7 +1,7 @@ | |||
1053 | 1 | #include <scope/localization.h> | 1 | #include <preview.h> |
1054 | 2 | #include <scope/preview.h> | 2 | #include <query.h> |
1055 | 3 | #include <scope/query.h> | 3 | #include <scope.h> |
1056 | 4 | #include <scope/scope.h> | 4 | #include <localization.h> |
1057 | 5 | 5 | ||
1058 | 6 | #include <iostream> | 6 | #include <iostream> |
1059 | 7 | #include <sstream> | 7 | #include <sstream> |
1060 | @@ -9,11 +9,9 @@ | |||
1061 | 9 | 9 | ||
1062 | 10 | namespace sc = unity::scopes; | 10 | namespace sc = unity::scopes; |
1063 | 11 | using namespace std; | 11 | using namespace std; |
1064 | 12 | using namespace api; | ||
1065 | 13 | using namespace scope; | ||
1066 | 14 | 12 | ||
1067 | 15 | void Scope::start(string const&) { | 13 | void Scope::start(string const&) { |
1069 | 16 | config_ = make_shared<Config>(); | 14 | config_ = make_shared<Client::Config>(); |
1070 | 17 | 15 | ||
1071 | 18 | setlocale(LC_ALL, ""); | 16 | setlocale(LC_ALL, ""); |
1072 | 19 | string translation_directory = ScopeBase::scope_directory() | 17 | string translation_directory = ScopeBase::scope_directory() |
1073 | 20 | 18 | ||
1074 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/include/scope/scope.h' => 'share/qtcreator/templates/wizards/ubuntu/scope/src/scope.h' | |||
1075 | --- share/qtcreator/templates/wizards/ubuntu/scope/include/scope/scope.h 2014-09-03 14:56:27 +0000 | |||
1076 | +++ share/qtcreator/templates/wizards/ubuntu/scope/src/scope.h 2015-05-19 10:38:08 +0000 | |||
1077 | @@ -1,7 +1,7 @@ | |||
1080 | 1 | #ifndef SCOPE_SCOPE_H_ | 1 | #ifndef SCOPE_H_ |
1081 | 2 | #define SCOPE_SCOPE_H_ | 2 | #define SCOPE_H_ |
1082 | 3 | 3 | ||
1084 | 4 | #include <api/config.h> | 4 | #include <client.h> |
1085 | 5 | 5 | ||
1086 | 6 | #include <unity/scopes/ScopeBase.h> | 6 | #include <unity/scopes/ScopeBase.h> |
1087 | 7 | #include <unity/scopes/QueryBase.h> | 7 | #include <unity/scopes/QueryBase.h> |
1088 | @@ -9,8 +9,6 @@ | |||
1089 | 9 | #include <unity/scopes/QueryBase.h> | 9 | #include <unity/scopes/QueryBase.h> |
1090 | 10 | #include <unity/scopes/PreviewQueryBase.h> | 10 | #include <unity/scopes/PreviewQueryBase.h> |
1091 | 11 | 11 | ||
1092 | 12 | namespace scope { | ||
1093 | 13 | |||
1094 | 14 | /** | 12 | /** |
1095 | 15 | * Defines the lifecycle of scope plugin, and acts as a factory | 13 | * Defines the lifecycle of scope plugin, and acts as a factory |
1096 | 16 | * for Query and Preview objects. | 14 | * for Query and Preview objects. |
1097 | @@ -45,9 +43,7 @@ | |||
1098 | 45 | unity::scopes::SearchMetadata const&) override; | 43 | unity::scopes::SearchMetadata const&) override; |
1099 | 46 | 44 | ||
1100 | 47 | protected: | 45 | protected: |
1102 | 48 | api::Config::Ptr config_; | 46 | Client::Config::Ptr config_; |
1103 | 49 | }; | 47 | }; |
1104 | 50 | 48 | ||
1108 | 51 | } | 49 | #endif // SCOPE_H_ |
1106 | 52 | |||
1107 | 53 | #endif // SCOPE_SCOPE_H_ | ||
1109 | 54 | 50 | ||
1110 | === modified file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/CMakeLists.txt' | |||
1111 | --- share/qtcreator/templates/wizards/ubuntu/scope/tests/CMakeLists.txt 2014-10-27 16:24:10 +0000 | |||
1112 | +++ share/qtcreator/templates/wizards/ubuntu/scope/tests/CMakeLists.txt 2015-05-19 10:38:08 +0000 | |||
1113 | @@ -19,14 +19,22 @@ | |||
1114 | 19 | ) | 19 | ) |
1115 | 20 | 20 | ||
1116 | 21 | # Where to find the scope ini file and .so | 21 | # Where to find the scope ini file and .so |
1120 | 22 | add_definitions( | 22 | set(TEST_SCOPE_DIRECTORY "${CMAKE_BINARY_DIR}/src") |
1118 | 23 | -DTEST_SCOPE_DIRECTORY="${CMAKE_BINARY_DIR}/src" | ||
1119 | 24 | ) | ||
1121 | 25 | 23 | ||
1122 | 26 | @if "%ContentType%".substring(0, "network".length) === "network" | ||
1123 | 27 | file(GLOB_RECURSE | 24 | file(GLOB_RECURSE |
1124 | 28 | TEST_FIXTURES | 25 | TEST_FIXTURES |
1126 | 29 | "server/*" | 26 | @if "%ContentType%" == "empty" |
1127 | 27 | "unit/*.py" | ||
1128 | 28 | @elsif "%ContentType%" == "network-netcpp-json" | ||
1129 | 29 | "server/*.json" | ||
1130 | 30 | "*.py" | ||
1131 | 31 | @elsif "%ContentType%" == "network-netcpp-qjson" | ||
1132 | 32 | "server/*.json" | ||
1133 | 33 | "*.py" | ||
1134 | 34 | @elsif "%ContentType%" == "network-netcpp-qxml" | ||
1135 | 35 | "server/*.xml" | ||
1136 | 36 | "*.py" | ||
1137 | 37 | @endif | ||
1138 | 30 | ) | 38 | ) |
1139 | 31 | 39 | ||
1140 | 32 | # Make this file show up in QtCreator | 40 | # Make this file show up in QtCreator |
1141 | @@ -34,10 +42,9 @@ | |||
1142 | 34 | SOURCES ${TEST_FIXTURES} | 42 | SOURCES ${TEST_FIXTURES} |
1143 | 35 | ) | 43 | ) |
1144 | 36 | 44 | ||
1145 | 45 | @if "%ContentType%".substring(0, "network".length) === "network" | ||
1146 | 37 | # Where to find the test server binary | 46 | # Where to find the test server binary |
1150 | 38 | add_definitions( | 47 | set(FAKE_SERVER "${CMAKE_CURRENT_SOURCE_DIR}/server/server.py") |
1148 | 39 | -DFAKE_SERVER="${CMAKE_CURRENT_SOURCE_DIR}/server/server.py" | ||
1149 | 40 | ) | ||
1151 | 41 | @endif | 48 | @endif |
1152 | 42 | 49 | ||
1153 | 43 | # Add the unit tests | 50 | # Add the unit tests |
1154 | 44 | 51 | ||
1155 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/daily/London,uk.json' => 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/London,uk.json' | |||
1156 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/daily/London,uk.xml' => 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/London,uk.xml' | |||
1157 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/daily/Manchester,uk.json' => 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/Manchester,uk.json' | |||
1158 | === renamed file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/daily/Manchester,uk.xml' => 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/Manchester,uk.xml' | |||
1159 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/forecast/daily' | |||
1160 | === modified file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/server/server.py' | |||
1161 | --- share/qtcreator/templates/wizards/ubuntu/scope/tests/server/server.py 2014-10-29 16:46:30 +0000 | |||
1162 | +++ share/qtcreator/templates/wizards/ubuntu/scope/tests/server/server.py 2015-05-19 10:38:08 +0000 | |||
1163 | @@ -44,7 +44,7 @@ | |||
1164 | 44 | if 'mode' in query: | 44 | if 'mode' in query: |
1165 | 45 | mode = query['mode'][0] | 45 | mode = query['mode'][0] |
1166 | 46 | 46 | ||
1168 | 47 | self.wfile.write(bytes(read_file('forecast/daily/%s.%s' % (query['q'][0], mode)), 'UTF-8')) | 47 | self.wfile.write(bytes(read_file('forecast/%s.%s' % (query['q'][0], mode)), 'UTF-8')) |
1169 | 48 | else: | 48 | else: |
1170 | 49 | self.send_response(404) | 49 | self.send_response(404) |
1171 | 50 | self.send_header("Content-type", "text/html") | 50 | self.send_header("Content-type", "text/html") |
1172 | 51 | 51 | ||
1173 | === modified file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/CMakeLists.txt' | |||
1174 | --- share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/CMakeLists.txt 2014-10-29 15:28:52 +0000 | |||
1175 | +++ share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/CMakeLists.txt 2015-05-19 10:38:08 +0000 | |||
1176 | @@ -1,31 +1,13 @@ | |||
1177 | 1 | 1 | ||
1202 | 2 | # Our test executable. | 2 | # This command ensures that test-scope.py has execute permission |
1203 | 3 | # It includes the object code from the scope | 3 | execute_process(COMMAND chmod +x "${CMAKE_CURRENT_SOURCE_DIR}/test-scope.py") |
1180 | 4 | add_executable( | ||
1181 | 5 | scope-unit-tests | ||
1182 | 6 | scope/test-scope.cpp | ||
1183 | 7 | $<TARGET_OBJECTS:scope-static> | ||
1184 | 8 | ) | ||
1185 | 9 | |||
1186 | 10 | # Link against the scope, and all of our test lib dependencies | ||
1187 | 11 | target_link_libraries( | ||
1188 | 12 | scope-unit-tests | ||
1189 | 13 | ${GTEST_BOTH_LIBRARIES} | ||
1190 | 14 | ${GMOCK_LIBRARIES} | ||
1191 | 15 | ${SCOPE_LDFLAGS} | ||
1192 | 16 | ${TEST_LDFLAGS} | ||
1193 | 17 | ${Boost_LIBRARIES} | ||
1194 | 18 | ) | ||
1195 | 19 | |||
1196 | 20 | @if "%ContentType%".substring(0, "network-netcpp-q".length) === "network-netcpp-q" | ||
1197 | 21 | qt5_use_modules( | ||
1198 | 22 | scope-unit-tests | ||
1199 | 23 | Core | ||
1200 | 24 | ) | ||
1201 | 25 | @endif | ||
1204 | 26 | 4 | ||
1205 | 27 | # Register the test with CTest | 5 | # Register the test with CTest |
1206 | 28 | add_test( | 6 | add_test( |
1207 | 29 | scope-unit-tests | 7 | scope-unit-tests |
1209 | 30 | scope-unit-tests | 8 | @if "%ContentType%" == "empty" |
1210 | 9 | "${CMAKE_CURRENT_SOURCE_DIR}/test-scope.py" "${SCOPE_NAME}" "${TEST_SCOPE_DIRECTORY}/${SCOPE_NAME}.ini" | ||
1211 | 10 | @elsif "%ContentType%".substring(0, "network".length) === "network" | ||
1212 | 11 | "${CMAKE_CURRENT_SOURCE_DIR}/test-scope.py" "${SCOPE_NAME}" "${TEST_SCOPE_DIRECTORY}/${SCOPE_NAME}.ini" "${FAKE_SERVER}" | ||
1213 | 12 | @endif | ||
1214 | 31 | ) | 13 | ) |
1215 | 32 | 14 | ||
1216 | === removed directory 'share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/scope' | |||
1217 | === removed file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/scope/test-scope.cpp' | |||
1218 | --- share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/scope/test-scope.cpp 2014-10-27 16:24:10 +0000 | |||
1219 | +++ share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/scope/test-scope.cpp 1970-01-01 00:00:00 +0000 | |||
1220 | @@ -1,232 +0,0 @@ | |||
1221 | 1 | #include <scope/scope.h> | ||
1222 | 2 | |||
1223 | 3 | #include <core/posix/exec.h> | ||
1224 | 4 | #include <gtest/gtest.h> | ||
1225 | 5 | #include <gmock/gmock.h> | ||
1226 | 6 | #include <string> | ||
1227 | 7 | #include <unity/scopes/SearchReply.h> | ||
1228 | 8 | #include <unity/scopes/SearchReplyProxyFwd.h> | ||
1229 | 9 | #include <unity/scopes/Variant.h> | ||
1230 | 10 | #include <unity/scopes/testing/Category.h> | ||
1231 | 11 | #include <unity/scopes/testing/MockSearchReply.h> | ||
1232 | 12 | #include <unity/scopes/testing/TypedScopeFixture.h> | ||
1233 | 13 | |||
1234 | 14 | using namespace std; | ||
1235 | 15 | using namespace testing; | ||
1236 | 16 | using namespace scope; | ||
1237 | 17 | |||
1238 | 18 | namespace posix = core::posix; | ||
1239 | 19 | namespace sc = unity::scopes; | ||
1240 | 20 | namespace sct = unity::scopes::testing; | ||
1241 | 21 | |||
1242 | 22 | /** | ||
1243 | 23 | * Keep the tests in an anonymous namespace | ||
1244 | 24 | */ | ||
1245 | 25 | namespace { | ||
1246 | 26 | |||
1247 | 27 | /** | ||
1248 | 28 | * Custom matcher to check the properties of search results | ||
1249 | 29 | */ | ||
1250 | 30 | MATCHER_P2(ResultProp, prop, value, "") { | ||
1251 | 31 | if (arg.contains(prop)) { | ||
1252 | 32 | *result_listener << "result[" << prop << "] is " << arg[prop].serialize_json(); | ||
1253 | 33 | } else { | ||
1254 | 34 | *result_listener << "result[" << prop << "] is not set"; | ||
1255 | 35 | } | ||
1256 | 36 | return arg.contains(prop) && arg[prop] == sc::Variant(value); | ||
1257 | 37 | } | ||
1258 | 38 | |||
1259 | 39 | /** | ||
1260 | 40 | * Custom matcher to check the presence of departments | ||
1261 | 41 | */ | ||
1262 | 42 | MATCHER_P(IsDepartment, department, "") { | ||
1263 | 43 | return arg->serialize() == department->serialize(); | ||
1264 | 44 | } | ||
1265 | 45 | |||
1266 | 46 | typedef sct::TypedScopeFixture<Scope> TypedScopeFixtureScope; | ||
1267 | 47 | |||
1268 | 48 | class TestScope: public TypedScopeFixtureScope { | ||
1269 | 49 | protected: | ||
1270 | 50 | @if "%ContentType%".substring(0, "network".length) === "network" | ||
1271 | 51 | void SetUp() override | ||
1272 | 52 | { | ||
1273 | 53 | // Start up Python-based fake OpenWeatherMap server | ||
1274 | 54 | fake_server_ = posix::exec("/usr/bin/python3", { FAKE_SERVER }, { }, | ||
1275 | 55 | posix::StandardStream::stdout); | ||
1276 | 56 | |||
1277 | 57 | // Check it's running | ||
1278 | 58 | ASSERT_GT(fake_server_.pid(), 0); | ||
1279 | 59 | string port; | ||
1280 | 60 | // The server will print out the random port it is using | ||
1281 | 61 | fake_server_.cout() >> port; | ||
1282 | 62 | // Check we have a port | ||
1283 | 63 | ASSERT_FALSE(port.empty()); | ||
1284 | 64 | |||
1285 | 65 | // Build up the API root | ||
1286 | 66 | string apiroot = "http://127.0.0.1:" + port; | ||
1287 | 67 | // Override the API root that the scope will use | ||
1288 | 68 | setenv("NETWORK_SCOPE_APIROOT", apiroot.c_str(), true); | ||
1289 | 69 | |||
1290 | 70 | // Do the parent SetUp | ||
1291 | 71 | TypedScopeFixture::set_scope_directory(TEST_SCOPE_DIRECTORY); | ||
1292 | 72 | TypedScopeFixtureScope::SetUp(); | ||
1293 | 73 | } | ||
1294 | 74 | |||
1295 | 75 | /** | ||
1296 | 76 | * Start by assuming the server is invalid | ||
1297 | 77 | */ | ||
1298 | 78 | posix::ChildProcess fake_server_ = posix::ChildProcess::invalid(); | ||
1299 | 79 | @endif | ||
1300 | 80 | }; | ||
1301 | 81 | |||
1302 | 82 | TEST_F(TestScope, empty_search_string) { | ||
1303 | 83 | @if "%ContentType%".substring(0, "network".length) === "network" | ||
1304 | 84 | const sc::CategoryRenderer renderer; | ||
1305 | 85 | NiceMock<sct::MockSearchReply> reply; | ||
1306 | 86 | |||
1307 | 87 | // Build a query with an empty search string | ||
1308 | 88 | sc::CannedQuery query(SCOPE_NAME, "", ""); | ||
1309 | 89 | |||
1310 | 90 | // Expect the current weather category | ||
1311 | 91 | EXPECT_CALL(reply, register_category("current", "London, GB", "", _)).Times(1) | ||
1312 | 92 | .WillOnce(Return(make_shared<sct::Category>("current", "London, GB", "", renderer))); | ||
1313 | 93 | |||
1314 | 94 | // With one result | ||
1315 | 95 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1316 | 96 | ResultProp("title", "21.8°C"), | ||
1317 | 97 | ResultProp("art", "http://openweathermap.org/img/w/02d.png"), | ||
1318 | 98 | ResultProp("subtitle", "few clouds") | ||
1319 | 99 | )))).WillOnce( | ||
1320 | 100 | Return(true)); | ||
1321 | 101 | |||
1322 | 102 | // Expect the forecast category | ||
1323 | 103 | EXPECT_CALL(reply, register_category("forecast", "7 day forecast", "", _)).Times(1) | ||
1324 | 104 | .WillOnce(Return(make_shared<sct::Category>("forecast", "7 day forecast", "", renderer))); | ||
1325 | 105 | |||
1326 | 106 | // With seven results | ||
1327 | 107 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1328 | 108 | ResultProp("title", "25.1°C to 18.8°C"), | ||
1329 | 109 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1330 | 110 | ResultProp("subtitle", "light rain") | ||
1331 | 111 | )))).WillOnce(Return(true)); | ||
1332 | 112 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1333 | 113 | ResultProp("title", "20.9°C to 15.5°C"), | ||
1334 | 114 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1335 | 115 | ResultProp("subtitle", "moderate rain") | ||
1336 | 116 | )))).WillOnce(Return(true)); | ||
1337 | 117 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1338 | 118 | ResultProp("title", "19.6°C to 13.2°C"), | ||
1339 | 119 | ResultProp("art", "http://openweathermap.org/img/w/03d.png"), | ||
1340 | 120 | ResultProp("subtitle", "scattered clouds") | ||
1341 | 121 | )))).WillOnce(Return(true)); | ||
1342 | 122 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1343 | 123 | ResultProp("title", "18.1°C to 13.5°C"), | ||
1344 | 124 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1345 | 125 | ResultProp("subtitle", "moderate rain") | ||
1346 | 126 | )))).WillOnce(Return(true)); | ||
1347 | 127 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1348 | 128 | ResultProp("title", "17.4°C to 15.4°C"), | ||
1349 | 129 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1350 | 130 | ResultProp("subtitle", "heavy intensity rain") | ||
1351 | 131 | )))).WillOnce(Return(true)); | ||
1352 | 132 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1353 | 133 | ResultProp("title", "18.4°C to 16.2°C"), | ||
1354 | 134 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1355 | 135 | ResultProp("subtitle", "moderate rain") | ||
1356 | 136 | )))).WillOnce(Return(true)); | ||
1357 | 137 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1358 | 138 | ResultProp("title", "19°C to 16.7°C"), | ||
1359 | 139 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1360 | 140 | ResultProp("subtitle", "light rain") | ||
1361 | 141 | )))).WillOnce(Return(true)); | ||
1362 | 142 | |||
1363 | 143 | sc::SearchReplyProxy reply_proxy(&reply, [](sc::SearchReply*) {}); // note: this is a std::shared_ptr with empty deleter | ||
1364 | 144 | sc::SearchMetadata meta_data("en_EN", "phone"); | ||
1365 | 145 | |||
1366 | 146 | // Create a query object | ||
1367 | 147 | auto search_query = scope->search(query, meta_data); | ||
1368 | 148 | ASSERT_NE(nullptr, search_query); | ||
1369 | 149 | |||
1370 | 150 | // Run the search | ||
1371 | 151 | search_query->run(reply_proxy); | ||
1372 | 152 | |||
1373 | 153 | // Google Mock will make assertions when the mocks are destructed. | ||
1374 | 154 | @endif | ||
1375 | 155 | } | ||
1376 | 156 | |||
1377 | 157 | TEST_F(TestScope, search) { | ||
1378 | 158 | @if "%ContentType%".substring(0, "network".length) === "network" | ||
1379 | 159 | const sc::CategoryRenderer renderer; | ||
1380 | 160 | NiceMock<sct::MockSearchReply> reply; | ||
1381 | 161 | |||
1382 | 162 | // Build a query with a non-empty search string | ||
1383 | 163 | sc::CannedQuery query(SCOPE_NAME, "Manchester,uk", ""); | ||
1384 | 164 | |||
1385 | 165 | // Expect the current weather category | ||
1386 | 166 | EXPECT_CALL(reply, register_category("current", "Manchester, GB", "", _)).Times(1) | ||
1387 | 167 | .WillOnce(Return(make_shared<sct::Category>("current", "Manchester, GB", "", renderer))); | ||
1388 | 168 | |||
1389 | 169 | // With one result | ||
1390 | 170 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1391 | 171 | ResultProp("title", "17.4°C"), | ||
1392 | 172 | ResultProp("art", "http://openweathermap.org/img/w/03d.png"), | ||
1393 | 173 | ResultProp("subtitle", "scattered clouds") | ||
1394 | 174 | )))).WillOnce( | ||
1395 | 175 | Return(true)); | ||
1396 | 176 | |||
1397 | 177 | // Expect the forecast category | ||
1398 | 178 | EXPECT_CALL(reply, register_category("forecast", "7 day forecast", "", _)).Times(1) | ||
1399 | 179 | .WillOnce(Return(make_shared<sct::Category>("forecast", "7 day forecast", "", renderer))); | ||
1400 | 180 | |||
1401 | 181 | // With seven results | ||
1402 | 182 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1403 | 183 | ResultProp("title", "18.8°C to 12°C"), | ||
1404 | 184 | ResultProp("art", "http://openweathermap.org/img/w/01d.png"), | ||
1405 | 185 | ResultProp("subtitle", "sky is clear") | ||
1406 | 186 | )))).WillOnce(Return(true)); | ||
1407 | 187 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1408 | 188 | ResultProp("title", "18.6°C to 12.3°C"), | ||
1409 | 189 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1410 | 190 | ResultProp("subtitle", "moderate rain") | ||
1411 | 191 | )))).WillOnce(Return(true)); | ||
1412 | 192 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1413 | 193 | ResultProp("title", "17.1°C to 10.8°C"), | ||
1414 | 194 | ResultProp("art", "http://openweathermap.org/img/w/04d.png"), | ||
1415 | 195 | ResultProp("subtitle", "broken clouds") | ||
1416 | 196 | )))).WillOnce(Return(true)); | ||
1417 | 197 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1418 | 198 | ResultProp("title", "16°C to 12.2°C"), | ||
1419 | 199 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1420 | 200 | ResultProp("subtitle", "moderate rain") | ||
1421 | 201 | )))).WillOnce(Return(true)); | ||
1422 | 202 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1423 | 203 | ResultProp("title", "15.7°C to 13°C"), | ||
1424 | 204 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1425 | 205 | ResultProp("subtitle", "light rain") | ||
1426 | 206 | )))).WillOnce(Return(true)); | ||
1427 | 207 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1428 | 208 | ResultProp("title", "17.6°C to 14.1°C"), | ||
1429 | 209 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1430 | 210 | ResultProp("subtitle", "moderate rain") | ||
1431 | 211 | )))).WillOnce(Return(true)); | ||
1432 | 212 | EXPECT_CALL(reply, push(Matcher<sc::CategorisedResult const&>(AllOf( | ||
1433 | 213 | ResultProp("title", "15.5°C to 13.4°C"), | ||
1434 | 214 | ResultProp("art", "http://openweathermap.org/img/w/10d.png"), | ||
1435 | 215 | ResultProp("subtitle", "moderate rain") | ||
1436 | 216 | )))).WillOnce(Return(true)); | ||
1437 | 217 | |||
1438 | 218 | sc::SearchReplyProxy reply_proxy(&reply, [](sc::SearchReply*) {}); // note: this is a std::shared_ptr with empty deleter | ||
1439 | 219 | sc::SearchMetadata meta_data("en_EN", "phone"); | ||
1440 | 220 | |||
1441 | 221 | // Create a query object | ||
1442 | 222 | auto search_query = scope->search(query, meta_data); | ||
1443 | 223 | ASSERT_NE(nullptr, search_query); | ||
1444 | 224 | |||
1445 | 225 | // Run the search | ||
1446 | 226 | search_query->run(reply_proxy); | ||
1447 | 227 | |||
1448 | 228 | // Google Mock will make assertions when the mocks are destructed. | ||
1449 | 229 | @endif | ||
1450 | 230 | } | ||
1451 | 231 | |||
1452 | 232 | } // namespace | ||
1453 | 233 | 0 | ||
1454 | === added file 'share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/test-scope.py' | |||
1455 | --- share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/test-scope.py 1970-01-01 00:00:00 +0000 | |||
1456 | +++ share/qtcreator/templates/wizards/ubuntu/scope/tests/unit/test-scope.py 2015-05-19 10:38:08 +0000 | |||
1457 | @@ -0,0 +1,290 @@ | |||
1458 | 1 | #!/usr/bin/env python3 | ||
1459 | 2 | |||
1460 | 3 | from scope_harness import * | ||
1461 | 4 | from scope_harness.testing import * | ||
1462 | 5 | import unittest, sys, os | ||
1463 | 6 | from subprocess import Popen, PIPE | ||
1464 | 7 | |||
1465 | 8 | @if "%ContentType%".substring(0, "network".length) === "network" | ||
1466 | 9 | class AppsTest (ScopeHarnessTestCase): | ||
1467 | 10 | @classmethod | ||
1468 | 11 | def setUpClass(cls): | ||
1469 | 12 | cls.process = Popen(["/usr/bin/python3", FAKE_SERVER], stdout=PIPE) | ||
1470 | 13 | port = cls.process.stdout.readline().decode("utf-8").rstrip('\n') | ||
1471 | 14 | os.environ["NETWORK_SCOPE_APIROOT"] = "http://127.0.0.1:" + port | ||
1472 | 15 | |||
1473 | 16 | @classmethod | ||
1474 | 17 | def tearDownClass(cls): | ||
1475 | 18 | cls.process.terminate() | ||
1476 | 19 | |||
1477 | 20 | |||
1478 | 21 | def start_harness(self): | ||
1479 | 22 | self.harness = ScopeHarness.new_from_scope_list(Parameters([SCOPE_INI])) | ||
1480 | 23 | self.view = self.harness.results_view | ||
1481 | 24 | self.view.active_scope = SCOPE_NAME | ||
1482 | 25 | |||
1483 | 26 | |||
1484 | 27 | @if "%ContentType%" == "network-netcpp-qxml" | ||
1485 | 28 | def test_surfacing_results(self): | ||
1486 | 29 | self.start_harness() | ||
1487 | 30 | self.view.search_query = '' | ||
1488 | 31 | |||
1489 | 32 | match = CategoryListMatcher() \ | ||
1490 | 33 | .has_exactly(2) \ | ||
1491 | 34 | .mode(CategoryListMatcherMode.BY_ID) \ | ||
1492 | 35 | .category(CategoryMatcher("current") \ | ||
1493 | 36 | .title("London, GB") \ | ||
1494 | 37 | .has_at_least(1) \ | ||
1495 | 38 | .result(ResultMatcher("2643743") \ | ||
1496 | 39 | .title("21.8°C") \ | ||
1497 | 40 | .art("http://openweathermap.org/img/w/02d.png") \ | ||
1498 | 41 | .subtitle("few clouds") ) ) \ | ||
1499 | 42 | .category(CategoryMatcher("forecast") \ | ||
1500 | 43 | .title("7 day forecast") \ | ||
1501 | 44 | .has_at_least(7) \ | ||
1502 | 45 | .result(ResultMatcher("1000000") \ | ||
1503 | 46 | .title("25.1°C to 18.8°C") \ | ||
1504 | 47 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1505 | 48 | .subtitle("light rain") ) \ | ||
1506 | 49 | .result(ResultMatcher("1000001") \ | ||
1507 | 50 | .title("20.9°C to 15.5°C") \ | ||
1508 | 51 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1509 | 52 | .subtitle("moderate rain") ) \ | ||
1510 | 53 | .result(ResultMatcher("1000002") \ | ||
1511 | 54 | .title("19.6°C to 13.2°C") \ | ||
1512 | 55 | .art("http://openweathermap.org/img/w/03d.png") \ | ||
1513 | 56 | .subtitle("scattered clouds") ) \ | ||
1514 | 57 | .result(ResultMatcher("1000003") \ | ||
1515 | 58 | .title("18.1°C to 13.5°C") \ | ||
1516 | 59 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1517 | 60 | .subtitle("moderate rain") ) \ | ||
1518 | 61 | .result(ResultMatcher("1000004") \ | ||
1519 | 62 | .title("17.4°C to 15.4°C") \ | ||
1520 | 63 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1521 | 64 | .subtitle("heavy intensity rain") ) \ | ||
1522 | 65 | .result(ResultMatcher("1000005") \ | ||
1523 | 66 | .title("18.4°C to 16.2°C") \ | ||
1524 | 67 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1525 | 68 | .subtitle("moderate rain") ) \ | ||
1526 | 69 | .result(ResultMatcher("1000006") \ | ||
1527 | 70 | .title("19°C to 16.7°C") \ | ||
1528 | 71 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1529 | 72 | .subtitle("light rain") ) ) \ | ||
1530 | 73 | .match(self.view.categories) | ||
1531 | 74 | self.assertMatchResult(match) | ||
1532 | 75 | @else | ||
1533 | 76 | def test_surfacing_results(self): | ||
1534 | 77 | self.start_harness() | ||
1535 | 78 | self.view.search_query = '' | ||
1536 | 79 | |||
1537 | 80 | match = CategoryListMatcher() \ | ||
1538 | 81 | .has_exactly(2) \ | ||
1539 | 82 | .mode(CategoryListMatcherMode.BY_ID) \ | ||
1540 | 83 | .category(CategoryMatcher("current") \ | ||
1541 | 84 | .title("London, GB") \ | ||
1542 | 85 | .has_at_least(1) \ | ||
1543 | 86 | .result(ResultMatcher("5091") \ | ||
1544 | 87 | .title("21.8°C") \ | ||
1545 | 88 | .art("http://openweathermap.org/img/w/02d.png") \ | ||
1546 | 89 | .subtitle("few clouds") ) ) \ | ||
1547 | 90 | .category(CategoryMatcher("forecast") \ | ||
1548 | 91 | .title("7 day forecast") \ | ||
1549 | 92 | .has_at_least(7) \ | ||
1550 | 93 | .result(ResultMatcher("500") \ | ||
1551 | 94 | .title("25.1°C to 18.8°C") \ | ||
1552 | 95 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1553 | 96 | .subtitle("light rain") ) \ | ||
1554 | 97 | .result(ResultMatcher("501") \ | ||
1555 | 98 | .title("20.9°C to 15.5°C") \ | ||
1556 | 99 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1557 | 100 | .subtitle("moderate rain") ) \ | ||
1558 | 101 | .result(ResultMatcher("802") \ | ||
1559 | 102 | .title("19.6°C to 13.2°C") \ | ||
1560 | 103 | .art("http://openweathermap.org/img/w/03d.png") \ | ||
1561 | 104 | .subtitle("scattered clouds") ) \ | ||
1562 | 105 | .result(ResultMatcher("501") \ | ||
1563 | 106 | .title("18.1°C to 13.5°C") \ | ||
1564 | 107 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1565 | 108 | .subtitle("moderate rain") ) \ | ||
1566 | 109 | .result(ResultMatcher("502") \ | ||
1567 | 110 | .title("17.4°C to 15.4°C") \ | ||
1568 | 111 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1569 | 112 | .subtitle("heavy intensity rain") ) \ | ||
1570 | 113 | .result(ResultMatcher("501") \ | ||
1571 | 114 | .title("18.4°C to 16.2°C") \ | ||
1572 | 115 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1573 | 116 | .subtitle("moderate rain") ) \ | ||
1574 | 117 | .result(ResultMatcher("500") \ | ||
1575 | 118 | .title("19°C to 16.7°C") \ | ||
1576 | 119 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1577 | 120 | .subtitle("light rain") ) ) \ | ||
1578 | 121 | .match(self.view.categories) | ||
1579 | 122 | self.assertMatchResult(match) | ||
1580 | 123 | @endif | ||
1581 | 124 | |||
1582 | 125 | |||
1583 | 126 | @if "%ContentType%" == "network-netcpp-qxml" | ||
1584 | 127 | def test_search_results(self): | ||
1585 | 128 | self.start_harness() | ||
1586 | 129 | self.view.search_query = 'Manchester,uk' | ||
1587 | 130 | |||
1588 | 131 | match = CategoryListMatcher() \ | ||
1589 | 132 | .has_exactly(2) \ | ||
1590 | 133 | .mode(CategoryListMatcherMode.BY_ID) \ | ||
1591 | 134 | .category(CategoryMatcher("current") \ | ||
1592 | 135 | .title("Manchester, GB") \ | ||
1593 | 136 | .has_at_least(1) \ | ||
1594 | 137 | .result(ResultMatcher("2643123") \ | ||
1595 | 138 | .title("17.4°C") \ | ||
1596 | 139 | .art("http://openweathermap.org/img/w/03d.png") \ | ||
1597 | 140 | .subtitle("scattered clouds") ) ) \ | ||
1598 | 141 | .category(CategoryMatcher("forecast") \ | ||
1599 | 142 | .title("7 day forecast") \ | ||
1600 | 143 | .has_at_least(7) \ | ||
1601 | 144 | .result(ResultMatcher("1000000") \ | ||
1602 | 145 | .title("18.8°C to 12°C") \ | ||
1603 | 146 | .art("http://openweathermap.org/img/w/01d.png") \ | ||
1604 | 147 | .subtitle("sky is clear") ) \ | ||
1605 | 148 | .result(ResultMatcher("1000001") \ | ||
1606 | 149 | .title("18.6°C to 12.3°C") \ | ||
1607 | 150 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1608 | 151 | .subtitle("moderate rain") ) \ | ||
1609 | 152 | .result(ResultMatcher("1000002") \ | ||
1610 | 153 | .title("17.1°C to 10.8°C") \ | ||
1611 | 154 | .art("http://openweathermap.org/img/w/04d.png") \ | ||
1612 | 155 | .subtitle("broken clouds") ) \ | ||
1613 | 156 | .result(ResultMatcher("1000003") \ | ||
1614 | 157 | .title("16°C to 12.2°C") \ | ||
1615 | 158 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1616 | 159 | .subtitle("moderate rain") ) \ | ||
1617 | 160 | .result(ResultMatcher("1000004") \ | ||
1618 | 161 | .title("15.7°C to 13°C") \ | ||
1619 | 162 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1620 | 163 | .subtitle("light rain") ) \ | ||
1621 | 164 | .result(ResultMatcher("1000005") \ | ||
1622 | 165 | .title("17.6°C to 14.1°C") \ | ||
1623 | 166 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1624 | 167 | .subtitle("moderate rain") ) \ | ||
1625 | 168 | .result(ResultMatcher("1000006") \ | ||
1626 | 169 | .title("15.5°C to 13.4°C") \ | ||
1627 | 170 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1628 | 171 | .subtitle("moderate rain") ) ) \ | ||
1629 | 172 | .match(self.view.categories) | ||
1630 | 173 | self.assertMatchResult(match) | ||
1631 | 174 | @else | ||
1632 | 175 | def test_search_results(self): | ||
1633 | 176 | self.start_harness() | ||
1634 | 177 | self.view.search_query = 'Manchester,uk' | ||
1635 | 178 | |||
1636 | 179 | match = CategoryListMatcher() \ | ||
1637 | 180 | .has_exactly(2) \ | ||
1638 | 181 | .mode(CategoryListMatcherMode.BY_ID) \ | ||
1639 | 182 | .category(CategoryMatcher("current") \ | ||
1640 | 183 | .title("Manchester, GB") \ | ||
1641 | 184 | .has_at_least(1) \ | ||
1642 | 185 | .result(ResultMatcher("5060") \ | ||
1643 | 186 | .title("17.4°C") \ | ||
1644 | 187 | .art("http://openweathermap.org/img/w/03d.png") \ | ||
1645 | 188 | .subtitle("scattered clouds") ) ) \ | ||
1646 | 189 | .category(CategoryMatcher("forecast") \ | ||
1647 | 190 | .title("7 day forecast") \ | ||
1648 | 191 | .has_at_least(7) \ | ||
1649 | 192 | .result(ResultMatcher("800") \ | ||
1650 | 193 | .title("18.8°C to 12°C") \ | ||
1651 | 194 | .art("http://openweathermap.org/img/w/01d.png") \ | ||
1652 | 195 | .subtitle("sky is clear") ) \ | ||
1653 | 196 | .result(ResultMatcher("501") \ | ||
1654 | 197 | .title("18.6°C to 12.3°C") \ | ||
1655 | 198 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1656 | 199 | .subtitle("moderate rain") ) \ | ||
1657 | 200 | .result(ResultMatcher("803") \ | ||
1658 | 201 | .title("17.1°C to 10.8°C") \ | ||
1659 | 202 | .art("http://openweathermap.org/img/w/04d.png") \ | ||
1660 | 203 | .subtitle("broken clouds") ) \ | ||
1661 | 204 | .result(ResultMatcher("501") \ | ||
1662 | 205 | .title("16°C to 12.2°C") \ | ||
1663 | 206 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1664 | 207 | .subtitle("moderate rain") ) \ | ||
1665 | 208 | .result(ResultMatcher("500") \ | ||
1666 | 209 | .title("15.7°C to 13°C") \ | ||
1667 | 210 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1668 | 211 | .subtitle("light rain") ) \ | ||
1669 | 212 | .result(ResultMatcher("501") \ | ||
1670 | 213 | .title("17.6°C to 14.1°C") \ | ||
1671 | 214 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1672 | 215 | .subtitle("moderate rain") ) \ | ||
1673 | 216 | .result(ResultMatcher("501") \ | ||
1674 | 217 | .title("15.5°C to 13.4°C") \ | ||
1675 | 218 | .art("http://openweathermap.org/img/w/10d.png") \ | ||
1676 | 219 | .subtitle("moderate rain") ) ) \ | ||
1677 | 220 | .match(self.view.categories) | ||
1678 | 221 | self.assertMatchResult(match) | ||
1679 | 222 | @endif | ||
1680 | 223 | |||
1681 | 224 | |||
1682 | 225 | if __name__ == '__main__': | ||
1683 | 226 | SCOPE_NAME = sys.argv[1] | ||
1684 | 227 | SCOPE_INI = sys.argv[2] | ||
1685 | 228 | FAKE_SERVER = sys.argv[3] | ||
1686 | 229 | |||
1687 | 230 | unittest.main(argv = sys.argv[:1]) | ||
1688 | 231 | |||
1689 | 232 | @elsif "%ContentType%" == "empty" | ||
1690 | 233 | class AppsTest (ScopeHarnessTestCase): | ||
1691 | 234 | def start_harness(self): | ||
1692 | 235 | self.harness = ScopeHarness.new_from_scope_list(Parameters([SCOPE_INI])) | ||
1693 | 236 | self.view = self.harness.results_view | ||
1694 | 237 | self.view.active_scope = SCOPE_NAME | ||
1695 | 238 | |||
1696 | 239 | |||
1697 | 240 | def test_surfacing_results(self): | ||
1698 | 241 | self.start_harness() | ||
1699 | 242 | self.view.search_query = '' | ||
1700 | 243 | |||
1701 | 244 | match = CategoryListMatcher() \ | ||
1702 | 245 | .has_exactly(1) \ | ||
1703 | 246 | .mode(CategoryListMatcherMode.BY_ID) \ | ||
1704 | 247 | .category(CategoryMatcher("results") \ | ||
1705 | 248 | .title("2 results") \ | ||
1706 | 249 | .has_at_least(2) \ | ||
1707 | 250 | .result(ResultMatcher("uri") \ | ||
1708 | 251 | .title("default") \ | ||
1709 | 252 | .art("art.png") \ | ||
1710 | 253 | .subtitle("subtitle") ) \ | ||
1711 | 254 | .result(ResultMatcher("uri2") \ | ||
1712 | 255 | .title("default") \ | ||
1713 | 256 | .art("art2.png") \ | ||
1714 | 257 | .subtitle("subtitle2") ) ) \ | ||
1715 | 258 | .match(self.view.categories) | ||
1716 | 259 | self.assertMatchResult(match) | ||
1717 | 260 | |||
1718 | 261 | |||
1719 | 262 | def test_search_results(self): | ||
1720 | 263 | self.start_harness() | ||
1721 | 264 | self.view.search_query = 'test' | ||
1722 | 265 | |||
1723 | 266 | match = CategoryListMatcher() \ | ||
1724 | 267 | .has_exactly(1) \ | ||
1725 | 268 | .mode(CategoryListMatcherMode.BY_ID) \ | ||
1726 | 269 | .category(CategoryMatcher("results") \ | ||
1727 | 270 | .title("2 results") \ | ||
1728 | 271 | .has_at_least(2) \ | ||
1729 | 272 | .result(ResultMatcher("uri") \ | ||
1730 | 273 | .title("test") \ | ||
1731 | 274 | .art("art.png") \ | ||
1732 | 275 | .subtitle("subtitle") ) \ | ||
1733 | 276 | .result(ResultMatcher("uri2") \ | ||
1734 | 277 | .title("test") \ | ||
1735 | 278 | .art("art2.png") \ | ||
1736 | 279 | .subtitle("subtitle2") ) ) \ | ||
1737 | 280 | .match(self.view.categories) | ||
1738 | 281 | self.assertMatchResult(match) | ||
1739 | 282 | |||
1740 | 283 | |||
1741 | 284 | if __name__ == '__main__': | ||
1742 | 285 | SCOPE_NAME = sys.argv[1] | ||
1743 | 286 | SCOPE_INI = sys.argv[2] | ||
1744 | 287 | |||
1745 | 288 | unittest.main(argv = sys.argv[:1]) | ||
1746 | 289 | |||
1747 | 290 | @endif | ||
1748 | 0 | 291 | ||
1749 | === modified file 'share/qtcreator/templates/wizards/ubuntu/scope/wizard.xml' | |||
1750 | --- share/qtcreator/templates/wizards/ubuntu/scope/wizard.xml 2015-01-15 12:51:26 +0000 | |||
1751 | +++ share/qtcreator/templates/wizards/ubuntu/scope/wizard.xml 2015-05-19 10:38:08 +0000 | |||
1752 | @@ -9,37 +9,31 @@ | |||
1753 | 9 | <displayname>Unity Scope (cmake)</displayname> | 9 | <displayname>Unity Scope (cmake)</displayname> |
1754 | 10 | <displaycategory>Ubuntu</displaycategory> | 10 | <displaycategory>Ubuntu</displaycategory> |
1755 | 11 | <files> | 11 | <files> |
1756 | 12 | <file source="cmake/FindGMock.cmake"/> | ||
1757 | 13 | <file source="cmake/FindIntltool.cmake"/> | ||
1758 | 14 | |||
1759 | 15 | <file source="data/CMakeLists.txt"/> | ||
1760 | 16 | <file source="data/displayName.ini.in" target="data/%ProjectName:l%.%ClickDomain:l%_%ClickHookName:l%.ini.in"/> | ||
1761 | 17 | <file source="data/icon.png" binary="true"/> | ||
1762 | 18 | <file source="data/logo.png" binary="true"/> | ||
1763 | 19 | <file source="data/screenshot.png" binary="true"/> | ||
1764 | 20 | |||
1765 | 21 | <file source="include/api/config.h"/> | ||
1766 | 22 | <file source="include/api/client.h"/> | ||
1767 | 23 | <file source="include/scope/localization.h"/> | ||
1768 | 24 | <file source="include/scope/preview.h"/> | ||
1769 | 25 | <file source="include/scope/query.h"/> | ||
1770 | 26 | <file source="include/scope/scope.h"/> | ||
1771 | 27 | |||
1772 | 28 | <file source="src/CMakeLists.txt"/> | 12 | <file source="src/CMakeLists.txt"/> |
1777 | 29 | <file source="src/api/client.cpp"/> | 13 | <file source="src/data/displayName.ini.in" target="src/data/%ClickHookName:l%.ini.in"/> |
1778 | 30 | <file source="src/scope/query.cpp"/> | 14 | <file source="src/data/displayName-settings.ini.in" target="src/data/%ClickHookName:l%-settings.ini.in"/> |
1779 | 31 | <file source="src/scope/scope.cpp" openeditor="true"/> | 15 | <file source="src/data/icon.png" binary="true"/> |
1780 | 32 | <file source="src/scope/preview.cpp"/> | 16 | <file source="src/data/logo.png" binary="true"/> |
1781 | 17 | <file source="src/data/screenshot.png" binary="true"/> | ||
1782 | 18 | <file source="src/client.cpp"/> | ||
1783 | 19 | <file source="src/client.h"/> | ||
1784 | 20 | <file source="src/localization.h"/> | ||
1785 | 21 | <file source="src/preview.cpp"/> | ||
1786 | 22 | <file source="src/preview.h"/> | ||
1787 | 23 | <file source="src/query.cpp"/> | ||
1788 | 24 | <file source="src/query.h"/> | ||
1789 | 25 | <file source="src/scope.cpp" openeditor="true"/> | ||
1790 | 26 | <file source="src/scope.h"/> | ||
1791 | 33 | 27 | ||
1792 | 34 | <file source="po/CMakeLists.txt"/> | 28 | <file source="po/CMakeLists.txt"/> |
1793 | 35 | <file source="po/displayName.pot" target="po/%ProjectName:l%.pot"/> | 29 | <file source="po/displayName.pot" target="po/%ProjectName:l%.pot"/> |
1794 | 36 | <file source="po/Makefile.in.in"/> | 30 | <file source="po/Makefile.in.in"/> |
1795 | 37 | <file source="po/POTFILES.in"/> | 31 | <file source="po/POTFILES.in"/> |
1796 | 38 | 32 | ||
1801 | 39 | <file source="tests/server/forecast/daily/Manchester,uk.json"/> | 33 | <file source="tests/server/forecast/Manchester,uk.json"/> |
1802 | 40 | <file source="tests/server/forecast/daily/Manchester,uk.xml"/> | 34 | <file source="tests/server/forecast/Manchester,uk.xml"/> |
1803 | 41 | <file source="tests/server/forecast/daily/London,uk.json"/> | 35 | <file source="tests/server/forecast/London,uk.json"/> |
1804 | 42 | <file source="tests/server/forecast/daily/London,uk.xml"/> | 36 | <file source="tests/server/forecast/London,uk.xml"/> |
1805 | 43 | <file source="tests/server/weather/Manchester,uk.json"/> | 37 | <file source="tests/server/weather/Manchester,uk.json"/> |
1806 | 44 | <file source="tests/server/weather/Manchester,uk.xml"/> | 38 | <file source="tests/server/weather/Manchester,uk.xml"/> |
1807 | 45 | <file source="tests/server/weather/London,uk.json"/> | 39 | <file source="tests/server/weather/London,uk.json"/> |
1808 | @@ -47,7 +41,7 @@ | |||
1809 | 47 | <file source="tests/server/server.py"/> | 41 | <file source="tests/server/server.py"/> |
1810 | 48 | <file source="tests/CMakeLists.txt"/> | 42 | <file source="tests/CMakeLists.txt"/> |
1811 | 49 | <file source="tests/unit/CMakeLists.txt"/> | 43 | <file source="tests/unit/CMakeLists.txt"/> |
1813 | 50 | <file source="tests/unit/scope/test-scope.cpp"/> | 44 | <file source="tests/unit/test-scope.py"/> |
1814 | 51 | 45 | ||
1815 | 52 | <file source="CMakeLists.txt" openproject="true"/> | 46 | <file source="CMakeLists.txt" openproject="true"/> |
1816 | 53 | <file source="displayName.apparmor" target="%ClickHookName:l%.apparmor"/> | 47 | <file source="displayName.apparmor" target="%ClickHookName:l%.apparmor"/> |
FAILED: Continuous integration, rev:432 /code.launchpad .net/~marcustom linson/ qtcreator- plugin- ubuntu/ refactor- scope-template/ +merge/ 259083/ +edit-commit- message
No commit message was specified in the merge proposal. Click on the following link and set the commit message (if you want a jenkins rebuild you need to trigger it yourself):
https:/
http:// jenkins. qa.ubuntu. com/job/ qtcreator- plugin- ubuntu- ci/542/ jenkins. qa.ubuntu. com/job/ qtcreator- plugin- ubuntu- wily-amd64- ci/3 jenkins. qa.ubuntu. com/job/ qtcreator- plugin- ubuntu- wily-armhf- ci/3
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/qtcreator- plugin- ubuntu- ci/542/ rebuild
http://