Merge lp:~mikemc/unity-scope-click/cxx-test-fix into lp:unity-scope-click
- cxx-test-fix
- Merge into trunk
Status: | Merged |
---|---|
Approved by: | dobey |
Approved revision: | 114 |
Merged at revision: | 107 |
Proposed branch: | lp:~mikemc/unity-scope-click/cxx-test-fix |
Merge into: | lp:unity-scope-click |
Diff against target: |
578 lines (+75/-183) 9 files modified
CMakeLists.txt (+12/-1) scope/CMakeLists.txt (+3/-2) scope/Config.h.in (+36/-0) scope/clickquery.cpp (+10/-2) scope/clickquery.h (+0/-46) scope/clickscope.cpp (+11/-5) scope/clickscope.h (+0/-47) scope/download-manager.h (+0/-79) scope/tests/CMakeLists.txt (+3/-1) |
To merge this branch: | bzr merge lp:~mikemc/unity-scope-click/cxx-test-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Approve | |
dobey (community) | Approve | ||
Review via email: mp+201669@code.launchpad.net |
Commit message
- Fix linkage issues in building Qt test suite for new c++ scope
Description of the change
- Fix linkage issues in building Qt test suite for new c++ scope
also includes some preprocessor work to build correctly whether using latest trunk of libunity-api or the most recent package. This isn't ideal because it'll require a bit of extra typing and we'll have to make sure to put the same tests in any new files, so hopefully we can remove it soon and just have a hard requirement for building on v0.1.8 or later.
'make check' runs the tests now, which will fail. but hey, they run!
dobey (dobey) wrote : | # |
- 113. By Mike McCracken
-
remove unnecessary extra variable
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:112
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
- 114. By Mike McCracken
-
- use explicit path to the scope dirs
dobey (dobey) : | # |
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:114
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
Click here to trigger a rebuild:
http://
Preview Diff
1 | === modified file 'CMakeLists.txt' |
2 | --- CMakeLists.txt 2014-01-13 21:55:16 +0000 |
3 | +++ CMakeLists.txt 2014-01-14 21:01:26 +0000 |
4 | @@ -7,7 +7,18 @@ |
5 | set(SCOPE_DATA_DIR share/unity/scopes) # FIXME, not correct. |
6 | |
7 | include(FindPkgConfig) |
8 | -pkg_check_modules(UNITY_SCOPES libunity-scopes REQUIRED) |
9 | + |
10 | +pkg_check_modules(UNITY_SCOPES REQUIRED libunity-scopes) |
11 | + |
12 | +# Config.h variables to account for breaking changes in 0.1.8: |
13 | +if (UNITY_SCOPES_VERSION VERSION_GREATER 0.1.7) |
14 | + SET (UNITY_SCOPES_API_HEADERS_NOW_UNDER_UNITY 1) |
15 | + SET (UNITY_SCOPES_API_NEW_SHORTER_NAMESPACE 1) |
16 | +else() |
17 | + SET (UNITY_SCOPES_API_HEADERS_NOW_UNDER_UNITY 0) |
18 | + SET (UNITY_SCOPES_API_NEW_SHORTER_NAMESPACE 0) |
19 | +endif () |
20 | + |
21 | |
22 | pkg_check_modules(LIBSIGNON REQUIRED libsignon-qt5 accounts-qt5) |
23 | add_definitions(${LIBSIGNON_CFLAGS} ${LIBSIGNON_CFLAGS_OTHER}) |
24 | |
25 | === modified file 'scope/CMakeLists.txt' |
26 | --- scope/CMakeLists.txt 2014-01-13 19:14:10 +0000 |
27 | +++ scope/CMakeLists.txt 2014-01-14 21:01:26 +0000 |
28 | @@ -3,10 +3,12 @@ |
29 | find_package (Qt5Core REQUIRED) |
30 | |
31 | file (GLOB SCOPE_SOURCES *.cpp) |
32 | -file (GLOB SCOPE_HEADERS *.h) |
33 | |
34 | add_library (${SCOPE_LIB_NAME} SHARED ${SCOPE_SOURCES} ) |
35 | |
36 | +configure_file(Config.h.in Config.h) |
37 | +include_directories (${CMAKE_CURRENT_BINARY_DIR}) |
38 | + |
39 | qt5_use_modules (${SCOPE_LIB_NAME} Network) |
40 | |
41 | target_link_libraries (${SCOPE_LIB_NAME} |
42 | @@ -15,5 +17,4 @@ |
43 | |
44 | set_property (TARGET ${SCOPE_LIB_NAME} PROPERTY COMPILE_FLAGS ${UNITY_SCOPES_CFLAGS}) |
45 | |
46 | - |
47 | add_subdirectory (tests) |
48 | |
49 | === added file 'scope/Config.h.in' |
50 | --- scope/Config.h.in 1970-01-01 00:00:00 +0000 |
51 | +++ scope/Config.h.in 2014-01-14 21:01:26 +0000 |
52 | @@ -0,0 +1,36 @@ |
53 | +/* |
54 | + * Copyright (C) 2014 Canonical Ltd. |
55 | + * |
56 | + * This program is free software: you can redistribute it and/or modify it |
57 | + * under the terms of the GNU General Public License version 3, as published |
58 | + * by the Free Software Foundation. |
59 | + * |
60 | + * This program is distributed in the hope that it will be useful, but |
61 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
62 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
63 | + * PURPOSE. See the GNU General Public License for more details. |
64 | + * |
65 | + * You should have received a copy of the GNU General Public License along |
66 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
67 | + * |
68 | + * In addition, as a special exception, the copyright holders give |
69 | + * permission to link the code of portions of this program with the |
70 | + * OpenSSL library under certain conditions as described in each |
71 | + * individual source file, and distribute linked combinations |
72 | + * including the two. |
73 | + * You must obey the GNU General Public License in all respects |
74 | + * for all of the code used other than OpenSSL. If you modify |
75 | + * file(s) with this exception, you may extend this exception to your |
76 | + * version of the file(s), but you are not obligated to do so. If you |
77 | + * do not wish to do so, delete this exception statement from your |
78 | + * version. If you delete this exception statement from all source |
79 | + * files in the program, then also delete it here. |
80 | + */ |
81 | + |
82 | +#ifndef _CONFIG_H_ |
83 | +#define _CONFIG_H_ |
84 | + |
85 | +#define UNITY_SCOPES_API_HEADERS_NOW_UNDER_UNITY @UNITY_SCOPES_API_HEADERS_NOW_UNDER_UNITY@ |
86 | +#define UNITY_SCOPES_API_NEW_SHORTER_NAMESPACE @UNITY_SCOPES_API_NEW_SHORTER_NAMESPACE@ |
87 | + |
88 | +#endif /* _CONFIG_H_ */ |
89 | |
90 | === modified file 'scope/clickquery.cpp' |
91 | --- scope/clickquery.cpp 2014-01-13 22:00:30 +0000 |
92 | +++ scope/clickquery.cpp 2014-01-14 21:01:26 +0000 |
93 | @@ -27,13 +27,21 @@ |
94 | * files in the program, then also delete it here. |
95 | */ |
96 | |
97 | -#include "clickquery.h" |
98 | +#include <clickquery.h> |
99 | + |
100 | +#if UNITY_SCOPES_API_HEADERS_NOW_UNDER_UNITY |
101 | +#include <unity/scopes/Annotation.h> |
102 | +#include <unity/scopes/CategoryRenderer.h> |
103 | +#include <unity/scopes/CategorisedResult.h> |
104 | +#include <unity/scopes/Query.h> |
105 | +#include <unity/scopes/Reply.h> |
106 | +#else |
107 | #include <scopes/Annotation.h> |
108 | #include <scopes/CategoryRenderer.h> |
109 | #include <scopes/CategorisedResult.h> |
110 | #include <scopes/Query.h> |
111 | #include <scopes/Reply.h> |
112 | - |
113 | +#endif |
114 | |
115 | ClickQuery::ClickQuery(string const& query) : |
116 | query_(query) |
117 | |
118 | === added file 'scope/clickquery.h' |
119 | --- scope/clickquery.h 1970-01-01 00:00:00 +0000 |
120 | +++ scope/clickquery.h 2014-01-14 21:01:26 +0000 |
121 | @@ -0,0 +1,62 @@ |
122 | +/* |
123 | + * Copyright (C) 2014 Canonical Ltd. |
124 | + * |
125 | + * This program is free software: you can redistribute it and/or modify it |
126 | + * under the terms of the GNU General Public License version 3, as published |
127 | + * by the Free Software Foundation. |
128 | + * |
129 | + * This program is distributed in the hope that it will be useful, but |
130 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
131 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
132 | + * PURPOSE. See the GNU General Public License for more details. |
133 | + * |
134 | + * You should have received a copy of the GNU General Public License along |
135 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
136 | + * |
137 | + * In addition, as a special exception, the copyright holders give |
138 | + * permission to link the code of portions of this program with the |
139 | + * OpenSSL library under certain conditions as described in each |
140 | + * individual source file, and distribute linked combinations |
141 | + * including the two. |
142 | + * You must obey the GNU General Public License in all respects |
143 | + * for all of the code used other than OpenSSL. If you modify |
144 | + * file(s) with this exception, you may extend this exception to your |
145 | + * version of the file(s), but you are not obligated to do so. If you |
146 | + * do not wish to do so, delete this exception statement from your |
147 | + * version. If you delete this exception statement from all source |
148 | + * files in the program, then also delete it here. |
149 | + */ |
150 | + |
151 | +#ifndef _CLICKQUERY_H_ |
152 | +#define _CLICKQUERY_H_ |
153 | + |
154 | +#include <Config.h> |
155 | + |
156 | +#if UNITY_SCOPES_API_HEADERS_NOW_UNDER_UNITY |
157 | +#include <unity/scopes/QueryBase.h> |
158 | +#else |
159 | +#include <scopes/QueryBase.h> |
160 | +#endif |
161 | + |
162 | +#if UNITY_SCOPES_API_NEW_SHORTER_NAMESPACE |
163 | +using namespace unity::scopes; |
164 | +#else |
165 | +using namespace unity::api::scopes; |
166 | +#endif |
167 | + |
168 | +using namespace std; |
169 | + |
170 | +class ClickQuery : public QueryBase |
171 | +{ |
172 | +public: |
173 | + ClickQuery(string const& query); |
174 | + ~ClickQuery(); |
175 | + virtual void cancelled() override; |
176 | + |
177 | + virtual void run(ReplyProxy const& reply) override; |
178 | + |
179 | +private: |
180 | + string query_; |
181 | +}; |
182 | + |
183 | +#endif /* _CLICKQUERY_H_ */ |
184 | |
185 | === removed file 'scope/clickquery.h' |
186 | --- scope/clickquery.h 2014-01-13 22:00:30 +0000 |
187 | +++ scope/clickquery.h 1970-01-01 00:00:00 +0000 |
188 | @@ -1,46 +0,0 @@ |
189 | -/* |
190 | - * Copyright (C) 2014 Canonical Ltd. |
191 | - * |
192 | - * This program is free software: you can redistribute it and/or modify it |
193 | - * under the terms of the GNU General Public License version 3, as published |
194 | - * by the Free Software Foundation. |
195 | - * |
196 | - * This program is distributed in the hope that it will be useful, but |
197 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
198 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
199 | - * PURPOSE. See the GNU General Public License for more details. |
200 | - * |
201 | - * You should have received a copy of the GNU General Public License along |
202 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
203 | - * |
204 | - * In addition, as a special exception, the copyright holders give |
205 | - * permission to link the code of portions of this program with the |
206 | - * OpenSSL library under certain conditions as described in each |
207 | - * individual source file, and distribute linked combinations |
208 | - * including the two. |
209 | - * You must obey the GNU General Public License in all respects |
210 | - * for all of the code used other than OpenSSL. If you modify |
211 | - * file(s) with this exception, you may extend this exception to your |
212 | - * version of the file(s), but you are not obligated to do so. If you |
213 | - * do not wish to do so, delete this exception statement from your |
214 | - * version. If you delete this exception statement from all source |
215 | - * files in the program, then also delete it here. |
216 | - */ |
217 | - |
218 | -#include <scopes/QueryBase.h> |
219 | - |
220 | -using namespace std; |
221 | -using namespace unity::api::scopes; |
222 | - |
223 | -class ClickQuery : public QueryBase |
224 | -{ |
225 | -public: |
226 | - ClickQuery(std::string const& query); |
227 | - ~ClickQuery(); |
228 | - virtual void cancelled() override; |
229 | - |
230 | - virtual void run(ReplyProxy const& reply) override; |
231 | - |
232 | -private: |
233 | - std::string query_; |
234 | -}; |
235 | |
236 | === modified file 'scope/clickscope.cpp' |
237 | --- scope/clickscope.cpp 2014-01-13 22:00:30 +0000 |
238 | +++ scope/clickscope.cpp 2014-01-14 21:01:26 +0000 |
239 | @@ -30,8 +30,15 @@ |
240 | #include "clickscope.h" |
241 | #include "clickquery.h" |
242 | |
243 | - |
244 | -int ClickScope::start(std::string const&, unity::api::scopes::RegistryProxy const&) |
245 | +#if UNITY_SCOPES_API_NEW_SHORTER_NAMESPACE |
246 | +using namespace unity::scopes; |
247 | +#else |
248 | +using namespace unity::api::scopes; |
249 | +#endif |
250 | + |
251 | +using namespace std; |
252 | + |
253 | +int ClickScope::start(string const&, RegistryProxy const&) |
254 | { |
255 | return VERSION; |
256 | } |
257 | @@ -40,9 +47,8 @@ |
258 | { |
259 | } |
260 | |
261 | -unity::api::scopes::QueryBase::UPtr create_query(std::string const& q, |
262 | - unity::api::scopes::VariantMap const&) |
263 | +QueryBase::UPtr ClickScope::create_query(string const& q, VariantMap const&) |
264 | { |
265 | - unity::api::scopes::QueryBase::UPtr query(new ClickQuery(q)); |
266 | + QueryBase::UPtr query(new ClickQuery(q)); |
267 | return query; |
268 | } |
269 | |
270 | === added file 'scope/clickscope.h' |
271 | --- scope/clickscope.h 1970-01-01 00:00:00 +0000 |
272 | +++ scope/clickscope.h 2014-01-14 21:01:26 +0000 |
273 | @@ -0,0 +1,61 @@ |
274 | +/* |
275 | + * Copyright (C) 2014 Canonical Ltd. |
276 | + * |
277 | + * This program is free software: you can redistribute it and/or modify it |
278 | + * under the terms of the GNU General Public License version 3, as published |
279 | + * by the Free Software Foundation. |
280 | + * |
281 | + * This program is distributed in the hope that it will be useful, but |
282 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
283 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
284 | + * PURPOSE. See the GNU General Public License for more details. |
285 | + * |
286 | + * You should have received a copy of the GNU General Public License along |
287 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
288 | + * |
289 | + * In addition, as a special exception, the copyright holders give |
290 | + * permission to link the code of portions of this program with the |
291 | + * OpenSSL library under certain conditions as described in each |
292 | + * individual source file, and distribute linked combinations |
293 | + * including the two. |
294 | + * You must obey the GNU General Public License in all respects |
295 | + * for all of the code used other than OpenSSL. If you modify |
296 | + * file(s) with this exception, you may extend this exception to your |
297 | + * version of the file(s), but you are not obligated to do so. If you |
298 | + * do not wish to do so, delete this exception statement from your |
299 | + * version. If you delete this exception statement from all source |
300 | + * files in the program, then also delete it here. |
301 | + */ |
302 | + |
303 | +#ifndef CLICKSCOPE_H |
304 | +#define CLICKSCOPE_H |
305 | + |
306 | +#include <Config.h> |
307 | + |
308 | +#if UNITY_SCOPES_API_HEADERS_NOW_UNDER_UNITY |
309 | +#include <unity/scopes/ScopeBase.h> |
310 | +#include <unity/scopes/QueryBase.h> |
311 | +#else |
312 | +#include <scopes/ScopeBase.h> |
313 | +#include <scopes/QueryBase.h> |
314 | +#endif |
315 | + |
316 | +#if UNITY_SCOPES_API_NEW_SHORTER_NAMESPACE |
317 | +using namespace unity::scopes; |
318 | +#else |
319 | +using namespace unity::api::scopes; |
320 | +#endif |
321 | + |
322 | +using namespace std; |
323 | + |
324 | +class ClickScope : public ScopeBase |
325 | +{ |
326 | +public: |
327 | + virtual int start(string const&, RegistryProxy const&) override; |
328 | + |
329 | + virtual void stop() override; |
330 | + |
331 | + virtual QueryBase::UPtr create_query(string const& q, VariantMap const&) override; |
332 | +}; |
333 | + |
334 | +#endif |
335 | |
336 | === removed file 'scope/clickscope.h' |
337 | --- scope/clickscope.h 2014-01-13 22:00:30 +0000 |
338 | +++ scope/clickscope.h 1970-01-01 00:00:00 +0000 |
339 | @@ -1,47 +0,0 @@ |
340 | -/* |
341 | - * Copyright (C) 2014 Canonical Ltd. |
342 | - * |
343 | - * This program is free software: you can redistribute it and/or modify it |
344 | - * under the terms of the GNU General Public License version 3, as published |
345 | - * by the Free Software Foundation. |
346 | - * |
347 | - * This program is distributed in the hope that it will be useful, but |
348 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
349 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
350 | - * PURPOSE. See the GNU General Public License for more details. |
351 | - * |
352 | - * You should have received a copy of the GNU General Public License along |
353 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
354 | - * |
355 | - * In addition, as a special exception, the copyright holders give |
356 | - * permission to link the code of portions of this program with the |
357 | - * OpenSSL library under certain conditions as described in each |
358 | - * individual source file, and distribute linked combinations |
359 | - * including the two. |
360 | - * You must obey the GNU General Public License in all respects |
361 | - * for all of the code used other than OpenSSL. If you modify |
362 | - * file(s) with this exception, you may extend this exception to your |
363 | - * version of the file(s), but you are not obligated to do so. If you |
364 | - * do not wish to do so, delete this exception statement from your |
365 | - * version. If you delete this exception statement from all source |
366 | - * files in the program, then also delete it here. |
367 | - */ |
368 | - |
369 | -#ifndef CLICKSCOPE_H |
370 | -#define CLICKSCOPE_H |
371 | - |
372 | -#include <scopes/ScopeBase.h> |
373 | -#include <scopes/QueryBase.h> |
374 | - |
375 | -class ClickScope : public unity::api::scopes::ScopeBase |
376 | -{ |
377 | -public: |
378 | - virtual int start(std::string const&, unity::api::scopes::RegistryProxy const&) override; |
379 | - |
380 | - virtual void stop() override; |
381 | - |
382 | - virtual unity::api::scopes::QueryBase::UPtr create_query(std::string const& q, |
383 | - unity::api::scopes::VariantMap const&) override; |
384 | -}; |
385 | - |
386 | -#endif |
387 | |
388 | === added file 'scope/download-manager.h' |
389 | --- scope/download-manager.h 1970-01-01 00:00:00 +0000 |
390 | +++ scope/download-manager.h 2014-01-14 21:01:26 +0000 |
391 | @@ -0,0 +1,81 @@ |
392 | +/* |
393 | + * Copyright (C) 2014 Canonical Ltd. |
394 | + * |
395 | + * This program is free software: you can redistribute it and/or modify it |
396 | + * under the terms of the GNU General Public License version 3, as published |
397 | + * by the Free Software Foundation. |
398 | + * |
399 | + * This program is distributed in the hope that it will be useful, but |
400 | + * WITHOUT ANY WARRANTY; without even the implied warranties of |
401 | + * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
402 | + * PURPOSE. See the GNU General Public License for more details. |
403 | + * |
404 | + * You should have received a copy of the GNU General Public License along |
405 | + * with this program. If not, see <http://www.gnu.org/licenses/>. |
406 | + * |
407 | + * In addition, as a special exception, the copyright holders give |
408 | + * permission to link the code of portions of this program with the |
409 | + * OpenSSL library under certain conditions as described in each |
410 | + * individual source file, and distribute linked combinations |
411 | + * including the two. |
412 | + * You must obey the GNU General Public License in all respects |
413 | + * for all of the code used other than OpenSSL. If you modify |
414 | + * file(s) with this exception, you may extend this exception to your |
415 | + * version of the file(s), but you are not obligated to do so. If you |
416 | + * do not wish to do so, delete this exception statement from your |
417 | + * version. If you delete this exception statement from all source |
418 | + * files in the program, then also delete it here. |
419 | + */ |
420 | + |
421 | +#ifndef _DOWNLOAD_MANAGER_H_ |
422 | +#define _DOWNLOAD_MANAGER_H_ |
423 | + |
424 | +#include <Config.h> |
425 | + |
426 | +#include <QDebug> |
427 | +#include <QNetworkReply> |
428 | +#include <QObject> |
429 | +#include <QString> |
430 | + |
431 | +#include <ssoservice.h> |
432 | +#include <token.h> |
433 | +#include <requests.h> |
434 | +#include <errormessages.h> |
435 | + |
436 | +namespace ClickScope { |
437 | + |
438 | +class DownloadManager : public QObject |
439 | +{ |
440 | + Q_OBJECT |
441 | + |
442 | +public: |
443 | + |
444 | + explicit DownloadManager(QObject *parent = 0); |
445 | + ~DownloadManager(); |
446 | + |
447 | +public slots: |
448 | + |
449 | + void fetchClickToken(QString downloadUrl); |
450 | + |
451 | +signals: |
452 | + |
453 | + void clickTokenFetched(QString clickToken); |
454 | + void clickTokenFetchError(QString errorMessage); |
455 | + |
456 | +private slots: |
457 | + |
458 | + void handleCredentialsFound(UbuntuOne::Token token); |
459 | + void handleCredentialsNotFound(); |
460 | + void handleNetworkFinished(QNetworkReply *reply); |
461 | + |
462 | +private: |
463 | + |
464 | + UbuntuOne::SSOService service; |
465 | + QNetworkAccessManager nam; |
466 | + QString _downloadUrl; |
467 | + |
468 | +}; |
469 | + |
470 | +} // namespace ClickScope |
471 | + |
472 | +#endif /* _DOWNLOAD_MANAGER_H_ */ |
473 | |
474 | === removed file 'scope/download-manager.h' |
475 | --- scope/download-manager.h 2014-01-13 20:00:41 +0000 |
476 | +++ scope/download-manager.h 1970-01-01 00:00:00 +0000 |
477 | @@ -1,79 +0,0 @@ |
478 | -/* |
479 | - * Copyright (C) 2014 Canonical Ltd. |
480 | - * |
481 | - * This program is free software: you can redistribute it and/or modify it |
482 | - * under the terms of the GNU General Public License version 3, as published |
483 | - * by the Free Software Foundation. |
484 | - * |
485 | - * This program is distributed in the hope that it will be useful, but |
486 | - * WITHOUT ANY WARRANTY; without even the implied warranties of |
487 | - * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR |
488 | - * PURPOSE. See the GNU General Public License for more details. |
489 | - * |
490 | - * You should have received a copy of the GNU General Public License along |
491 | - * with this program. If not, see <http://www.gnu.org/licenses/>. |
492 | - * |
493 | - * In addition, as a special exception, the copyright holders give |
494 | - * permission to link the code of portions of this program with the |
495 | - * OpenSSL library under certain conditions as described in each |
496 | - * individual source file, and distribute linked combinations |
497 | - * including the two. |
498 | - * You must obey the GNU General Public License in all respects |
499 | - * for all of the code used other than OpenSSL. If you modify |
500 | - * file(s) with this exception, you may extend this exception to your |
501 | - * version of the file(s), but you are not obligated to do so. If you |
502 | - * do not wish to do so, delete this exception statement from your |
503 | - * version. If you delete this exception statement from all source |
504 | - * files in the program, then also delete it here. |
505 | - */ |
506 | - |
507 | -#ifndef _DOWNLOAD_MANAGER_H_ |
508 | -#define _DOWNLOAD_MANAGER_H_ |
509 | - |
510 | -#include <QDebug> |
511 | -#include <QNetworkReply> |
512 | -#include <QObject> |
513 | -#include <QString> |
514 | - |
515 | -#include "ssoservice.h" |
516 | -#include "token.h" |
517 | -#include "requests.h" |
518 | -#include "errormessages.h" |
519 | - |
520 | -namespace ClickScope { |
521 | - |
522 | -class DownloadManager : public QObject |
523 | -{ |
524 | - Q_OBJECT |
525 | - |
526 | -public: |
527 | - |
528 | - explicit DownloadManager(QObject *parent = 0); |
529 | - ~DownloadManager(); |
530 | - |
531 | -public slots: |
532 | - |
533 | - void fetchClickToken(QString downloadUrl); |
534 | - |
535 | -signals: |
536 | - |
537 | - void clickTokenFetched(QString clickToken); |
538 | - void clickTokenFetchError(QString errorMessage); |
539 | - |
540 | -private slots: |
541 | - |
542 | - void handleCredentialsFound(UbuntuOne::Token token); |
543 | - void handleCredentialsNotFound(); |
544 | - void handleNetworkFinished(QNetworkReply *reply); |
545 | - |
546 | -private: |
547 | - |
548 | - UbuntuOne::SSOService service; |
549 | - QNetworkAccessManager nam; |
550 | - QString _downloadUrl; |
551 | - |
552 | -}; |
553 | - |
554 | -} // namespace ClickScope |
555 | - |
556 | -#endif /* _DOWNLOAD_MANAGER_H_ */ |
557 | |
558 | === modified file 'scope/tests/CMakeLists.txt' |
559 | --- scope/tests/CMakeLists.txt 2014-01-13 20:02:28 +0000 |
560 | +++ scope/tests/CMakeLists.txt 2014-01-14 21:01:26 +0000 |
561 | @@ -5,6 +5,9 @@ |
562 | SET (CMAKE_AUTOMOC ON) |
563 | find_package(Qt5Core REQUIRED) |
564 | |
565 | +include_directories (${CMAKE_SOURCE_DIR}/scope) |
566 | +include_directories (${CMAKE_BINARY_DIR}/scope) |
567 | + |
568 | FILE (GLOB TEST_SOURCES *.cpp) |
569 | FILE (GLOB TEST_HEADERS *.h) |
570 | |
571 | @@ -15,7 +18,6 @@ |
572 | |
573 | qt5_use_modules (${TESTS_TARGET} Core DBus Network Test) |
574 | |
575 | -target_include_directories ( ${TESTS_TARGET} PUBLIC ${CMAKE_SOURCE_DIR}/scope ) |
576 | target_link_libraries ( ${TESTS_TARGET} |
577 | ${UNITY_SCOPES_LDFLAGS} |
578 | ${UBUNTUONE_LDFLAGS} |
576 +include_ directories (${CMAKE_ CURRENT_ SOURCE_ DIR}/.. ) directories (${CMAKE_ CURRENT_ BINARY_ DIR}/.. )
577 +include_
It's generally better to avoid using ".." and use more explicit things, so that when reading the build file you can understand more easily what exactly it's pointing at.
For example, here I think you'd probably want to use ${CMAKE_ SOURCE_ DIR}/scope and similar for BINARY_DIR, instead.