Merge lp:~timeout-scope-team/timeout-scope/timeout_ready_for_publish into lp:timeout

Proposed by Victor Tuson Palau
Status: Needs review
Proposed branch: lp:~timeout-scope-team/timeout-scope/timeout_ready_for_publish
Merge into: lp:timeout
Diff against target: 3215 lines (+3000/-0) (has conflicts)
40 files modified
.bzrignore (+14/-0)
CMakeLists.txt (+48/-0)
COPYING.txt (+674/-0)
NOTICE.txt (+16/-0)
README.org (+65/-0)
apparmor/confined.json (+7/-0)
apparmor/unconfined.json (+4/-0)
data/CMakeLists.txt (+25/-0)
data/renderer/carousel.json (+12/-0)
data/renderer/horizontal-list.json (+12/-0)
data/renderer/large-grid.json (+12/-0)
data/renderer/medium-grid.json (+12/-0)
data/renderer/vjournal.json (+15/-0)
data/renderer/wide-art.json (+13/-0)
data/timeout.ini.in (+13/-0)
manifest.json.in (+15/-0)
push.sh (+8/-0)
run.sh (+24/-0)
security.json (+5/-0)
src/CMakeLists.txt (+22/-0)
src/TimeOut-client.cpp (+372/-0)
src/TimeOut-client.h (+101/-0)
src/TimeOut-preview.cpp (+413/-0)
src/TimeOut-preview.h (+46/-0)
src/TimeOut-query.cpp (+491/-0)
src/TimeOut-query.h (+69/-0)
src/TimeOut-scope.cpp (+62/-0)
src/TimeOut-scope.h (+51/-0)
src/TimeOut-scope.h.autosave (+50/-0)
src/com.canonical.scopes.timeout_timeout.ini (+13/-0)
src/com.canonical.scopes.timeout_timeout_automoc.cpp (+2/-0)
src/config.h.in (+47/-0)
src/timeout.ini (+13/-0)
src/timeout_automoc.cpp (+2/-0)
test/CMakeLists.txt (+24/-0)
test/files/CMakeLists.txt (+1/-0)
test/test-timeout-client.cpp (+16/-0)
timeout-scope.json (+6/-0)
timeout.cbp (+199/-0)
timeout.json (+6/-0)
Conflict adding file src.  Moved existing file to src.moved.
To merge this branch: bzr merge lp:~timeout-scope-team/timeout-scope/timeout_ready_for_publish
Reviewer Review Type Date Requested Status
Michał Karnicki optional Pending
Review via email: mp+235686@code.launchpad.net
To post a comment you must log in.
16. By Victor Tuson Palau

fixed bug with canned queries

Unmerged revisions

16. By Victor Tuson Palau

fixed bug with canned queries

15. By Victor Tuson Palau

changes: multi-city surfacing, location awareness, html formating, preview implementations, and confinment

14. By Michał Karnicki

Comment out main block of TimeOut-client.

13. By Michał Karnicki

Merge refactored Victor's improvements to image sizes.

12. By Michał Karnicki

Bump version to 0.4.1.

11. By Michał Karnicki

Fetch smaller images, 312x208.

10. By Michał Karnicki

Bump version to 0.4

9. By Michał Karnicki

Fetch smaller images for better speed.

8. By Michał Karnicki

Fix background and header foreground colors.

7. By Michał Karnicki

Remove cache directory.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== added file '.bzrignore'
2--- .bzrignore 1970-01-01 00:00:00 +0000
3+++ .bzrignore 2014-09-24 10:37:38 +0000
4@@ -0,0 +1,14 @@
5+build
6+build/*
7+*.click
8+click
9+click/*
10+src/config.h
11+manifest.json
12+CMakeLists.txt.user
13+CMakeCache.txt
14+CMakeFiles
15+Makefile
16+cmake_install.cmake
17+install_manifest.txt
18+ignore
19
20=== added file '.excludes'
21=== added file 'CMakeLists.txt'
22--- CMakeLists.txt 1970-01-01 00:00:00 +0000
23+++ CMakeLists.txt 2014-09-24 10:37:38 +0000
24@@ -0,0 +1,48 @@
25+set(SCOPE_PACKAGE "com.canonical.scopes.timeout")
26+set(SCOPE_TITLE "TimeOut")
27+set(SCOPE_ICON "icon.png")
28+ # FYI SCOPE_LOGO currently doesn't work in unity-scope-tool
29+set(SCOPE_LOGO "logo.png")
30+set(SCOPE_COLOR "color:///#000000")
31+set(BG_COLOR "color:///#000000")
32+set(FG_COLOR "#FFFFFF")
33+set(SCOPE_BG_COLOR "#FFFFFF")
34+set(SCOPE_AUTHOR "Canonical")
35+set(SCOPE_MAINTAINER "Time Out Group Ltd")
36+set(SCOPE_DESC "TimeOut scope")
37+set(SCOPE_NAME "timeout")
38+
39+set(ARCH "armhf")
40+set(FRAMEWORK "ubuntu-sdk-14.10-dev2")
41+
42+# ***
43+
44+# workaround for bug lp:1340135
45+SET(SCOPE_PATH "/opt/click.ubuntu.com/${SCOPE_PACKAGE}/current")
46+
47+project(timeout CXX)
48+cmake_minimum_required(VERSION 2.8.10)
49+
50+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -pedantic -Wall -Wextra")
51+set(UBUNTU_PROJECT_TYPE "Scope" CACHE INTERNAL "Tells QtCreator this is a Scope project")
52+
53+include(GNUInstallDirs)
54+include(FindPkgConfig)
55+pkg_check_modules(UNITY_SCOPES libunity-scopes>=0.4.0 REQUIRED)
56+
57+set(INI_INSTALLDIR "/${SCOPE_NAME}")
58+set(SCOPE_INSTALLDIR "/${SCOPE_NAME}")
59+
60+configure_file(
61+ "${CMAKE_CURRENT_SOURCE_DIR}/manifest.json.in"
62+ "${CMAKE_CURRENT_SOURCE_DIR}/manifest.json"
63+)
64+
65+add_subdirectory(src)
66+add_subdirectory(data)
67+#enable_testing()
68+#add_subdirectory(test)
69+#add_custom_target(check COMMAND ${CMAKE_CTEST_COMMAND} -V --output-on-failure)
70+
71+install(FILES manifest.json DESTINATION "/")
72+install(FILES "security.json" DESTINATION "/")
73
74=== added file 'COPYING.txt'
75--- COPYING.txt 1970-01-01 00:00:00 +0000
76+++ COPYING.txt 2014-09-24 10:37:38 +0000
77@@ -0,0 +1,674 @@
78+ GNU GENERAL PUBLIC LICENSE
79+ Version 3, 29 June 2007
80+
81+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
82+ Everyone is permitted to copy and distribute verbatim copies
83+ of this license document, but changing it is not allowed.
84+
85+ Preamble
86+
87+ The GNU General Public License is a free, copyleft license for
88+software and other kinds of works.
89+
90+ The licenses for most software and other practical works are designed
91+to take away your freedom to share and change the works. By contrast,
92+the GNU General Public License is intended to guarantee your freedom to
93+share and change all versions of a program--to make sure it remains free
94+software for all its users. We, the Free Software Foundation, use the
95+GNU General Public License for most of our software; it applies also to
96+any other work released this way by its authors. You can apply it to
97+your programs, too.
98+
99+ When we speak of free software, we are referring to freedom, not
100+price. Our General Public Licenses are designed to make sure that you
101+have the freedom to distribute copies of free software (and charge for
102+them if you wish), that you receive source code or can get it if you
103+want it, that you can change the software or use pieces of it in new
104+free programs, and that you know you can do these things.
105+
106+ To protect your rights, we need to prevent others from denying you
107+these rights or asking you to surrender the rights. Therefore, you have
108+certain responsibilities if you distribute copies of the software, or if
109+you modify it: responsibilities to respect the freedom of others.
110+
111+ For example, if you distribute copies of such a program, whether
112+gratis or for a fee, you must pass on to the recipients the same
113+freedoms that you received. You must make sure that they, too, receive
114+or can get the source code. And you must show them these terms so they
115+know their rights.
116+
117+ Developers that use the GNU GPL protect your rights with two steps:
118+(1) assert copyright on the software, and (2) offer you this License
119+giving you legal permission to copy, distribute and/or modify it.
120+
121+ For the developers' and authors' protection, the GPL clearly explains
122+that there is no warranty for this free software. For both users' and
123+authors' sake, the GPL requires that modified versions be marked as
124+changed, so that their problems will not be attributed erroneously to
125+authors of previous versions.
126+
127+ Some devices are designed to deny users access to install or run
128+modified versions of the software inside them, although the manufacturer
129+can do so. This is fundamentally incompatible with the aim of
130+protecting users' freedom to change the software. The systematic
131+pattern of such abuse occurs in the area of products for individuals to
132+use, which is precisely where it is most unacceptable. Therefore, we
133+have designed this version of the GPL to prohibit the practice for those
134+products. If such problems arise substantially in other domains, we
135+stand ready to extend this provision to those domains in future versions
136+of the GPL, as needed to protect the freedom of users.
137+
138+ Finally, every program is threatened constantly by software patents.
139+States should not allow patents to restrict development and use of
140+software on general-purpose computers, but in those that do, we wish to
141+avoid the special danger that patents applied to a free program could
142+make it effectively proprietary. To prevent this, the GPL assures that
143+patents cannot be used to render the program non-free.
144+
145+ The precise terms and conditions for copying, distribution and
146+modification follow.
147+
148+ TERMS AND CONDITIONS
149+
150+ 0. Definitions.
151+
152+ "This License" refers to version 3 of the GNU General Public License.
153+
154+ "Copyright" also means copyright-like laws that apply to other kinds of
155+works, such as semiconductor masks.
156+
157+ "The Program" refers to any copyrightable work licensed under this
158+License. Each licensee is addressed as "you". "Licensees" and
159+"recipients" may be individuals or organizations.
160+
161+ To "modify" a work means to copy from or adapt all or part of the work
162+in a fashion requiring copyright permission, other than the making of an
163+exact copy. The resulting work is called a "modified version" of the
164+earlier work or a work "based on" the earlier work.
165+
166+ A "covered work" means either the unmodified Program or a work based
167+on the Program.
168+
169+ To "propagate" a work means to do anything with it that, without
170+permission, would make you directly or secondarily liable for
171+infringement under applicable copyright law, except executing it on a
172+computer or modifying a private copy. Propagation includes copying,
173+distribution (with or without modification), making available to the
174+public, and in some countries other activities as well.
175+
176+ To "convey" a work means any kind of propagation that enables other
177+parties to make or receive copies. Mere interaction with a user through
178+a computer network, with no transfer of a copy, is not conveying.
179+
180+ An interactive user interface displays "Appropriate Legal Notices"
181+to the extent that it includes a convenient and prominently visible
182+feature that (1) displays an appropriate copyright notice, and (2)
183+tells the user that there is no warranty for the work (except to the
184+extent that warranties are provided), that licensees may convey the
185+work under this License, and how to view a copy of this License. If
186+the interface presents a list of user commands or options, such as a
187+menu, a prominent item in the list meets this criterion.
188+
189+ 1. Source Code.
190+
191+ The "source code" for a work means the preferred form of the work
192+for making modifications to it. "Object code" means any non-source
193+form of a work.
194+
195+ A "Standard Interface" means an interface that either is an official
196+standard defined by a recognized standards body, or, in the case of
197+interfaces specified for a particular programming language, one that
198+is widely used among developers working in that language.
199+
200+ The "System Libraries" of an executable work include anything, other
201+than the work as a whole, that (a) is included in the normal form of
202+packaging a Major Component, but which is not part of that Major
203+Component, and (b) serves only to enable use of the work with that
204+Major Component, or to implement a Standard Interface for which an
205+implementation is available to the public in source code form. A
206+"Major Component", in this context, means a major essential component
207+(kernel, window system, and so on) of the specific operating system
208+(if any) on which the executable work runs, or a compiler used to
209+produce the work, or an object code interpreter used to run it.
210+
211+ The "Corresponding Source" for a work in object code form means all
212+the source code needed to generate, install, and (for an executable
213+work) run the object code and to modify the work, including scripts to
214+control those activities. However, it does not include the work's
215+System Libraries, or general-purpose tools or generally available free
216+programs which are used unmodified in performing those activities but
217+which are not part of the work. For example, Corresponding Source
218+includes interface definition files associated with source files for
219+the work, and the source code for shared libraries and dynamically
220+linked subprograms that the work is specifically designed to require,
221+such as by intimate data communication or control flow between those
222+subprograms and other parts of the work.
223+
224+ The Corresponding Source need not include anything that users
225+can regenerate automatically from other parts of the Corresponding
226+Source.
227+
228+ The Corresponding Source for a work in source code form is that
229+same work.
230+
231+ 2. Basic Permissions.
232+
233+ All rights granted under this License are granted for the term of
234+copyright on the Program, and are irrevocable provided the stated
235+conditions are met. This License explicitly affirms your unlimited
236+permission to run the unmodified Program. The output from running a
237+covered work is covered by this License only if the output, given its
238+content, constitutes a covered work. This License acknowledges your
239+rights of fair use or other equivalent, as provided by copyright law.
240+
241+ You may make, run and propagate covered works that you do not
242+convey, without conditions so long as your license otherwise remains
243+in force. You may convey covered works to others for the sole purpose
244+of having them make modifications exclusively for you, or provide you
245+with facilities for running those works, provided that you comply with
246+the terms of this License in conveying all material for which you do
247+not control copyright. Those thus making or running the covered works
248+for you must do so exclusively on your behalf, under your direction
249+and control, on terms that prohibit them from making any copies of
250+your copyrighted material outside their relationship with you.
251+
252+ Conveying under any other circumstances is permitted solely under
253+the conditions stated below. Sublicensing is not allowed; section 10
254+makes it unnecessary.
255+
256+ 3. Protecting Users' Legal Rights From Anti-Circumvention Law.
257+
258+ No covered work shall be deemed part of an effective technological
259+measure under any applicable law fulfilling obligations under article
260+11 of the WIPO copyright treaty adopted on 20 December 1996, or
261+similar laws prohibiting or restricting circumvention of such
262+measures.
263+
264+ When you convey a covered work, you waive any legal power to forbid
265+circumvention of technological measures to the extent such circumvention
266+is effected by exercising rights under this License with respect to
267+the covered work, and you disclaim any intention to limit operation or
268+modification of the work as a means of enforcing, against the work's
269+users, your or third parties' legal rights to forbid circumvention of
270+technological measures.
271+
272+ 4. Conveying Verbatim Copies.
273+
274+ You may convey verbatim copies of the Program's source code as you
275+receive it, in any medium, provided that you conspicuously and
276+appropriately publish on each copy an appropriate copyright notice;
277+keep intact all notices stating that this License and any
278+non-permissive terms added in accord with section 7 apply to the code;
279+keep intact all notices of the absence of any warranty; and give all
280+recipients a copy of this License along with the Program.
281+
282+ You may charge any price or no price for each copy that you convey,
283+and you may offer support or warranty protection for a fee.
284+
285+ 5. Conveying Modified Source Versions.
286+
287+ You may convey a work based on the Program, or the modifications to
288+produce it from the Program, in the form of source code under the
289+terms of section 4, provided that you also meet all of these conditions:
290+
291+ a) The work must carry prominent notices stating that you modified
292+ it, and giving a relevant date.
293+
294+ b) The work must carry prominent notices stating that it is
295+ released under this License and any conditions added under section
296+ 7. This requirement modifies the requirement in section 4 to
297+ "keep intact all notices".
298+
299+ c) You must license the entire work, as a whole, under this
300+ License to anyone who comes into possession of a copy. This
301+ License will therefore apply, along with any applicable section 7
302+ additional terms, to the whole of the work, and all its parts,
303+ regardless of how they are packaged. This License gives no
304+ permission to license the work in any other way, but it does not
305+ invalidate such permission if you have separately received it.
306+
307+ d) If the work has interactive user interfaces, each must display
308+ Appropriate Legal Notices; however, if the Program has interactive
309+ interfaces that do not display Appropriate Legal Notices, your
310+ work need not make them do so.
311+
312+ A compilation of a covered work with other separate and independent
313+works, which are not by their nature extensions of the covered work,
314+and which are not combined with it such as to form a larger program,
315+in or on a volume of a storage or distribution medium, is called an
316+"aggregate" if the compilation and its resulting copyright are not
317+used to limit the access or legal rights of the compilation's users
318+beyond what the individual works permit. Inclusion of a covered work
319+in an aggregate does not cause this License to apply to the other
320+parts of the aggregate.
321+
322+ 6. Conveying Non-Source Forms.
323+
324+ You may convey a covered work in object code form under the terms
325+of sections 4 and 5, provided that you also convey the
326+machine-readable Corresponding Source under the terms of this License,
327+in one of these ways:
328+
329+ a) Convey the object code in, or embodied in, a physical product
330+ (including a physical distribution medium), accompanied by the
331+ Corresponding Source fixed on a durable physical medium
332+ customarily used for software interchange.
333+
334+ b) Convey the object code in, or embodied in, a physical product
335+ (including a physical distribution medium), accompanied by a
336+ written offer, valid for at least three years and valid for as
337+ long as you offer spare parts or customer support for that product
338+ model, to give anyone who possesses the object code either (1) a
339+ copy of the Corresponding Source for all the software in the
340+ product that is covered by this License, on a durable physical
341+ medium customarily used for software interchange, for a price no
342+ more than your reasonable cost of physically performing this
343+ conveying of source, or (2) access to copy the
344+ Corresponding Source from a network server at no charge.
345+
346+ c) Convey individual copies of the object code with a copy of the
347+ written offer to provide the Corresponding Source. This
348+ alternative is allowed only occasionally and noncommercially, and
349+ only if you received the object code with such an offer, in accord
350+ with subsection 6b.
351+
352+ d) Convey the object code by offering access from a designated
353+ place (gratis or for a charge), and offer equivalent access to the
354+ Corresponding Source in the same way through the same place at no
355+ further charge. You need not require recipients to copy the
356+ Corresponding Source along with the object code. If the place to
357+ copy the object code is a network server, the Corresponding Source
358+ may be on a different server (operated by you or a third party)
359+ that supports equivalent copying facilities, provided you maintain
360+ clear directions next to the object code saying where to find the
361+ Corresponding Source. Regardless of what server hosts the
362+ Corresponding Source, you remain obligated to ensure that it is
363+ available for as long as needed to satisfy these requirements.
364+
365+ e) Convey the object code using peer-to-peer transmission, provided
366+ you inform other peers where the object code and Corresponding
367+ Source of the work are being offered to the general public at no
368+ charge under subsection 6d.
369+
370+ A separable portion of the object code, whose source code is excluded
371+from the Corresponding Source as a System Library, need not be
372+included in conveying the object code work.
373+
374+ A "User Product" is either (1) a "consumer product", which means any
375+tangible personal property which is normally used for personal, family,
376+or household purposes, or (2) anything designed or sold for incorporation
377+into a dwelling. In determining whether a product is a consumer product,
378+doubtful cases shall be resolved in favor of coverage. For a particular
379+product received by a particular user, "normally used" refers to a
380+typical or common use of that class of product, regardless of the status
381+of the particular user or of the way in which the particular user
382+actually uses, or expects or is expected to use, the product. A product
383+is a consumer product regardless of whether the product has substantial
384+commercial, industrial or non-consumer uses, unless such uses represent
385+the only significant mode of use of the product.
386+
387+ "Installation Information" for a User Product means any methods,
388+procedures, authorization keys, or other information required to install
389+and execute modified versions of a covered work in that User Product from
390+a modified version of its Corresponding Source. The information must
391+suffice to ensure that the continued functioning of the modified object
392+code is in no case prevented or interfered with solely because
393+modification has been made.
394+
395+ If you convey an object code work under this section in, or with, or
396+specifically for use in, a User Product, and the conveying occurs as
397+part of a transaction in which the right of possession and use of the
398+User Product is transferred to the recipient in perpetuity or for a
399+fixed term (regardless of how the transaction is characterized), the
400+Corresponding Source conveyed under this section must be accompanied
401+by the Installation Information. But this requirement does not apply
402+if neither you nor any third party retains the ability to install
403+modified object code on the User Product (for example, the work has
404+been installed in ROM).
405+
406+ The requirement to provide Installation Information does not include a
407+requirement to continue to provide support service, warranty, or updates
408+for a work that has been modified or installed by the recipient, or for
409+the User Product in which it has been modified or installed. Access to a
410+network may be denied when the modification itself materially and
411+adversely affects the operation of the network or violates the rules and
412+protocols for communication across the network.
413+
414+ Corresponding Source conveyed, and Installation Information provided,
415+in accord with this section must be in a format that is publicly
416+documented (and with an implementation available to the public in
417+source code form), and must require no special password or key for
418+unpacking, reading or copying.
419+
420+ 7. Additional Terms.
421+
422+ "Additional permissions" are terms that supplement the terms of this
423+License by making exceptions from one or more of its conditions.
424+Additional permissions that are applicable to the entire Program shall
425+be treated as though they were included in this License, to the extent
426+that they are valid under applicable law. If additional permissions
427+apply only to part of the Program, that part may be used separately
428+under those permissions, but the entire Program remains governed by
429+this License without regard to the additional permissions.
430+
431+ When you convey a copy of a covered work, you may at your option
432+remove any additional permissions from that copy, or from any part of
433+it. (Additional permissions may be written to require their own
434+removal in certain cases when you modify the work.) You may place
435+additional permissions on material, added by you to a covered work,
436+for which you have or can give appropriate copyright permission.
437+
438+ Notwithstanding any other provision of this License, for material you
439+add to a covered work, you may (if authorized by the copyright holders of
440+that material) supplement the terms of this License with terms:
441+
442+ a) Disclaiming warranty or limiting liability differently from the
443+ terms of sections 15 and 16 of this License; or
444+
445+ b) Requiring preservation of specified reasonable legal notices or
446+ author attributions in that material or in the Appropriate Legal
447+ Notices displayed by works containing it; or
448+
449+ c) Prohibiting misrepresentation of the origin of that material, or
450+ requiring that modified versions of such material be marked in
451+ reasonable ways as different from the original version; or
452+
453+ d) Limiting the use for publicity purposes of names of licensors or
454+ authors of the material; or
455+
456+ e) Declining to grant rights under trademark law for use of some
457+ trade names, trademarks, or service marks; or
458+
459+ f) Requiring indemnification of licensors and authors of that
460+ material by anyone who conveys the material (or modified versions of
461+ it) with contractual assumptions of liability to the recipient, for
462+ any liability that these contractual assumptions directly impose on
463+ those licensors and authors.
464+
465+ All other non-permissive additional terms are considered "further
466+restrictions" within the meaning of section 10. If the Program as you
467+received it, or any part of it, contains a notice stating that it is
468+governed by this License along with a term that is a further
469+restriction, you may remove that term. If a license document contains
470+a further restriction but permits relicensing or conveying under this
471+License, you may add to a covered work material governed by the terms
472+of that license document, provided that the further restriction does
473+not survive such relicensing or conveying.
474+
475+ If you add terms to a covered work in accord with this section, you
476+must place, in the relevant source files, a statement of the
477+additional terms that apply to those files, or a notice indicating
478+where to find the applicable terms.
479+
480+ Additional terms, permissive or non-permissive, may be stated in the
481+form of a separately written license, or stated as exceptions;
482+the above requirements apply either way.
483+
484+ 8. Termination.
485+
486+ You may not propagate or modify a covered work except as expressly
487+provided under this License. Any attempt otherwise to propagate or
488+modify it is void, and will automatically terminate your rights under
489+this License (including any patent licenses granted under the third
490+paragraph of section 11).
491+
492+ However, if you cease all violation of this License, then your
493+license from a particular copyright holder is reinstated (a)
494+provisionally, unless and until the copyright holder explicitly and
495+finally terminates your license, and (b) permanently, if the copyright
496+holder fails to notify you of the violation by some reasonable means
497+prior to 60 days after the cessation.
498+
499+ Moreover, your license from a particular copyright holder is
500+reinstated permanently if the copyright holder notifies you of the
501+violation by some reasonable means, this is the first time you have
502+received notice of violation of this License (for any work) from that
503+copyright holder, and you cure the violation prior to 30 days after
504+your receipt of the notice.
505+
506+ Termination of your rights under this section does not terminate the
507+licenses of parties who have received copies or rights from you under
508+this License. If your rights have been terminated and not permanently
509+reinstated, you do not qualify to receive new licenses for the same
510+material under section 10.
511+
512+ 9. Acceptance Not Required for Having Copies.
513+
514+ You are not required to accept this License in order to receive or
515+run a copy of the Program. Ancillary propagation of a covered work
516+occurring solely as a consequence of using peer-to-peer transmission
517+to receive a copy likewise does not require acceptance. However,
518+nothing other than this License grants you permission to propagate or
519+modify any covered work. These actions infringe copyright if you do
520+not accept this License. Therefore, by modifying or propagating a
521+covered work, you indicate your acceptance of this License to do so.
522+
523+ 10. Automatic Licensing of Downstream Recipients.
524+
525+ Each time you convey a covered work, the recipient automatically
526+receives a license from the original licensors, to run, modify and
527+propagate that work, subject to this License. You are not responsible
528+for enforcing compliance by third parties with this License.
529+
530+ An "entity transaction" is a transaction transferring control of an
531+organization, or substantially all assets of one, or subdividing an
532+organization, or merging organizations. If propagation of a covered
533+work results from an entity transaction, each party to that
534+transaction who receives a copy of the work also receives whatever
535+licenses to the work the party's predecessor in interest had or could
536+give under the previous paragraph, plus a right to possession of the
537+Corresponding Source of the work from the predecessor in interest, if
538+the predecessor has it or can get it with reasonable efforts.
539+
540+ You may not impose any further restrictions on the exercise of the
541+rights granted or affirmed under this License. For example, you may
542+not impose a license fee, royalty, or other charge for exercise of
543+rights granted under this License, and you may not initiate litigation
544+(including a cross-claim or counterclaim in a lawsuit) alleging that
545+any patent claim is infringed by making, using, selling, offering for
546+sale, or importing the Program or any portion of it.
547+
548+ 11. Patents.
549+
550+ A "contributor" is a copyright holder who authorizes use under this
551+License of the Program or a work on which the Program is based. The
552+work thus licensed is called the contributor's "contributor version".
553+
554+ A contributor's "essential patent claims" are all patent claims
555+owned or controlled by the contributor, whether already acquired or
556+hereafter acquired, that would be infringed by some manner, permitted
557+by this License, of making, using, or selling its contributor version,
558+but do not include claims that would be infringed only as a
559+consequence of further modification of the contributor version. For
560+purposes of this definition, "control" includes the right to grant
561+patent sublicenses in a manner consistent with the requirements of
562+this License.
563+
564+ Each contributor grants you a non-exclusive, worldwide, royalty-free
565+patent license under the contributor's essential patent claims, to
566+make, use, sell, offer for sale, import and otherwise run, modify and
567+propagate the contents of its contributor version.
568+
569+ In the following three paragraphs, a "patent license" is any express
570+agreement or commitment, however denominated, not to enforce a patent
571+(such as an express permission to practice a patent or covenant not to
572+sue for patent infringement). To "grant" such a patent license to a
573+party means to make such an agreement or commitment not to enforce a
574+patent against the party.
575+
576+ If you convey a covered work, knowingly relying on a patent license,
577+and the Corresponding Source of the work is not available for anyone
578+to copy, free of charge and under the terms of this License, through a
579+publicly available network server or other readily accessible means,
580+then you must either (1) cause the Corresponding Source to be so
581+available, or (2) arrange to deprive yourself of the benefit of the
582+patent license for this particular work, or (3) arrange, in a manner
583+consistent with the requirements of this License, to extend the patent
584+license to downstream recipients. "Knowingly relying" means you have
585+actual knowledge that, but for the patent license, your conveying the
586+covered work in a country, or your recipient's use of the covered work
587+in a country, would infringe one or more identifiable patents in that
588+country that you have reason to believe are valid.
589+
590+ If, pursuant to or in connection with a single transaction or
591+arrangement, you convey, or propagate by procuring conveyance of, a
592+covered work, and grant a patent license to some of the parties
593+receiving the covered work authorizing them to use, propagate, modify
594+or convey a specific copy of the covered work, then the patent license
595+you grant is automatically extended to all recipients of the covered
596+work and works based on it.
597+
598+ A patent license is "discriminatory" if it does not include within
599+the scope of its coverage, prohibits the exercise of, or is
600+conditioned on the non-exercise of one or more of the rights that are
601+specifically granted under this License. You may not convey a covered
602+work if you are a party to an arrangement with a third party that is
603+in the business of distributing software, under which you make payment
604+to the third party based on the extent of your activity of conveying
605+the work, and under which the third party grants, to any of the
606+parties who would receive the covered work from you, a discriminatory
607+patent license (a) in connection with copies of the covered work
608+conveyed by you (or copies made from those copies), or (b) primarily
609+for and in connection with specific products or compilations that
610+contain the covered work, unless you entered into that arrangement,
611+or that patent license was granted, prior to 28 March 2007.
612+
613+ Nothing in this License shall be construed as excluding or limiting
614+any implied license or other defenses to infringement that may
615+otherwise be available to you under applicable patent law.
616+
617+ 12. No Surrender of Others' Freedom.
618+
619+ If conditions are imposed on you (whether by court order, agreement or
620+otherwise) that contradict the conditions of this License, they do not
621+excuse you from the conditions of this License. If you cannot convey a
622+covered work so as to satisfy simultaneously your obligations under this
623+License and any other pertinent obligations, then as a consequence you may
624+not convey it at all. For example, if you agree to terms that obligate you
625+to collect a royalty for further conveying from those to whom you convey
626+the Program, the only way you could satisfy both those terms and this
627+License would be to refrain entirely from conveying the Program.
628+
629+ 13. Use with the GNU Affero General Public License.
630+
631+ Notwithstanding any other provision of this License, you have
632+permission to link or combine any covered work with a work licensed
633+under version 3 of the GNU Affero General Public License into a single
634+combined work, and to convey the resulting work. The terms of this
635+License will continue to apply to the part which is the covered work,
636+but the special requirements of the GNU Affero General Public License,
637+section 13, concerning interaction through a network will apply to the
638+combination as such.
639+
640+ 14. Revised Versions of this License.
641+
642+ The Free Software Foundation may publish revised and/or new versions of
643+the GNU General Public License from time to time. Such new versions will
644+be similar in spirit to the present version, but may differ in detail to
645+address new problems or concerns.
646+
647+ Each version is given a distinguishing version number. If the
648+Program specifies that a certain numbered version of the GNU General
649+Public License "or any later version" applies to it, you have the
650+option of following the terms and conditions either of that numbered
651+version or of any later version published by the Free Software
652+Foundation. If the Program does not specify a version number of the
653+GNU General Public License, you may choose any version ever published
654+by the Free Software Foundation.
655+
656+ If the Program specifies that a proxy can decide which future
657+versions of the GNU General Public License can be used, that proxy's
658+public statement of acceptance of a version permanently authorizes you
659+to choose that version for the Program.
660+
661+ Later license versions may give you additional or different
662+permissions. However, no additional obligations are imposed on any
663+author or copyright holder as a result of your choosing to follow a
664+later version.
665+
666+ 15. Disclaimer of Warranty.
667+
668+ THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
669+APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
670+HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
671+OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
672+THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
673+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
674+IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
675+ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
676+
677+ 16. Limitation of Liability.
678+
679+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
680+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
681+THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
682+GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
683+USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
684+DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
685+PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
686+EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
687+SUCH DAMAGES.
688+
689+ 17. Interpretation of Sections 15 and 16.
690+
691+ If the disclaimer of warranty and limitation of liability provided
692+above cannot be given local legal effect according to their terms,
693+reviewing courts shall apply local law that most closely approximates
694+an absolute waiver of all civil liability in connection with the
695+Program, unless a warranty or assumption of liability accompanies a
696+copy of the Program in return for a fee.
697+
698+ END OF TERMS AND CONDITIONS
699+
700+ How to Apply These Terms to Your New Programs
701+
702+ If you develop a new program, and you want it to be of the greatest
703+possible use to the public, the best way to achieve this is to make it
704+free software which everyone can redistribute and change under these terms.
705+
706+ To do so, attach the following notices to the program. It is safest
707+to attach them to the start of each source file to most effectively
708+state the exclusion of warranty; and each file should have at least
709+the "copyright" line and a pointer to where the full notice is found.
710+
711+ <one line to give the program's name and a brief idea of what it does.>
712+ Copyright (C) <year> <name of author>
713+
714+ This program is free software: you can redistribute it and/or modify
715+ it under the terms of the GNU General Public License as published by
716+ the Free Software Foundation, either version 3 of the License, or
717+ (at your option) any later version.
718+
719+ This program is distributed in the hope that it will be useful,
720+ but WITHOUT ANY WARRANTY; without even the implied warranty of
721+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
722+ GNU General Public License for more details.
723+
724+ You should have received a copy of the GNU General Public License
725+ along with this program. If not, see <http://www.gnu.org/licenses/>.
726+
727+Also add information on how to contact you by electronic and paper mail.
728+
729+ If the program does terminal interaction, make it output a short
730+notice like this when it starts in an interactive mode:
731+
732+ <program> Copyright (C) <year> <name of author>
733+ This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
734+ This is free software, and you are welcome to redistribute it
735+ under certain conditions; type `show c' for details.
736+
737+The hypothetical commands `show w' and `show c' should show the appropriate
738+parts of the General Public License. Of course, your program's commands
739+might be different; for a GUI interface, you would use an "about box".
740+
741+ You should also get your employer (if you work as a programmer) or school,
742+if any, to sign a "copyright disclaimer" for the program, if necessary.
743+For more information on this, and how to apply and follow the GNU GPL, see
744+<http://www.gnu.org/licenses/>.
745+
746+ The GNU General Public License does not permit incorporating your program
747+into proprietary programs. If your program is a subroutine library, you
748+may consider it more useful to permit linking proprietary applications with
749+the library. If this is what you want to do, use the GNU Lesser General
750+Public License instead of this License. But first, please read
751+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
752
753=== added file 'NOTICE.txt'
754--- NOTICE.txt 1970-01-01 00:00:00 +0000
755+++ NOTICE.txt 2014-09-24 10:37:38 +0000
756@@ -0,0 +1,16 @@
757+/*
758+ * This file is part of Ubuntu TimeOut Scope.
759+ * Copyright 2014 Canonical Ltd.
760+ *
761+ * TimeOut Scope is free software: you can redistribute it and/or modify it
762+ * under the terms of the GNU General Public License as published by
763+ * the Free Software Foundation.
764+ *
765+ * TimeOut Scope is distributed in the hope that it will be useful,
766+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
767+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
768+ * See the GNU General Public License for more details.
769+ *
770+ * You should have received a copy of the GNU General Public License
771+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
772+ */
773
774=== added file 'README.org'
775--- README.org 1970-01-01 00:00:00 +0000
776+++ README.org 2014-09-24 10:37:38 +0000
777@@ -0,0 +1,65 @@
778+TimeOut scope prototype.
779+
780+ * Contact
781+
782+ Michał Karnicki <michal.karnicki@canonical.com>
783+
784+ * Running on desktop
785+
786+ $ ./build.sh
787+ $ ./run.sh
788+
789+ * Building on the device
790+
791+ $ ./drop.sh
792+ adb# su - phablet
793+ adb$ cd $SCOPE_NAME
794+ adb$ ./build.sh
795+ adb$ ./click.sh
796+
797+ * Tools
798+
799+ A bunch of scripts that should make your life easier!
800+
801+ ** ./build.sh
802+ Builds the scope locally.
803+
804+ If you want to clean then build, run:
805+ $ ./build.sh .
806+
807+ If you are building for the first time, you'll need to install dependencies:
808+ sudo ./deps.sh
809+ If you're doing that on the phone, you'll first need to:
810+ # note this will make your system not delta-upgradeable!
811+ $ sudo mount -o rw,remount /
812+ $ sudo apt-get update
813+ $ sudo ./deps.sh
814+ Note that mounting your file system writable will prevent from delta-upgrading your system. That means, you'll need to later flash your phone with up-to-date Ubuntu if you want to receive delta-updates. However, if you're a developer, no need to worry, you probably already use ubuntu-device-flash to often update your device manually.
815+
816+** ./run.sh
817+ Runs the scope with unity-scope-tool.
818+ $ sudo apt-get install unity-scope-tool
819+
820+ To set up run.sh, run this once:
821+ $ sudo ./run.sh .
822+ This requires sudo, because it tricks a click installation on your desktop.
823+ In case you update renderer/* files, re-run this setup command.
824+
825+** ./drop.sh
826+ Pushes current directory to the device, excluding .bzr, drops into adb shell.
827+
828+** ./click.sh
829+ Creates and installs the click package on the device, after you have successfully ran build.sh. If on desktop, this will only attempt to build the click package (host architecture package). To workaround temporary issue, please run in adb shell:
830+ $ sudo chmod o+w /opt/click.ubuntu.com/$SCOPE_PACKAGE/current/cache
831+ sudo password is: phablet
832+
833+** ./clean.sh
834+ Removes build and click directories and cmake configured files.
835+
836+
837+
838+* Project tasks:
839+** TODO i18n
840+** TODO location (geoip, AGPS)
841+** TODO make scope confined (mv apparmor/confined.json security.json)
842+** TODO resolve the scope writable directory matter; update SCOPE_PATH in config.h.in
843
844=== added directory 'apparmor'
845=== added file 'apparmor/confined.json'
846--- apparmor/confined.json 1970-01-01 00:00:00 +0000
847+++ apparmor/confined.json 2014-09-24 10:37:38 +0000
848@@ -0,0 +1,7 @@
849+{
850+ "template": "ubuntu-scope-network",
851+ "policy_groups": [
852+ "networking"
853+ ],
854+ "policy_version": 1.2
855+}
856
857=== added file 'apparmor/unconfined.json'
858--- apparmor/unconfined.json 1970-01-01 00:00:00 +0000
859+++ apparmor/unconfined.json 2014-09-24 10:37:38 +0000
860@@ -0,0 +1,4 @@
861+{
862+ "template": "unconfined",
863+ "policy_version": 1.2
864+}
865
866=== added directory 'data'
867=== added file 'data/CMakeLists.txt'
868--- data/CMakeLists.txt 1970-01-01 00:00:00 +0000
869+++ data/CMakeLists.txt 2014-09-24 10:37:38 +0000
870@@ -0,0 +1,25 @@
871+# Put the ini file in the build directory next to the scope
872+# .so file so test tools can find both easily.
873+configure_file(
874+ timeout.ini.in
875+ ${CMAKE_BINARY_DIR}/src/${SCOPE_PACKAGE}_${SCOPE_NAME}.ini)
876+
877+INSTALL(
878+ FILES ${CMAKE_BINARY_DIR}/src/${SCOPE_PACKAGE}_${SCOPE_NAME}.ini
879+ DESTINATION ${INI_INSTALLDIR}
880+)
881+
882+INSTALL(
883+ DIRECTORY "renderer"
884+ DESTINATION "${INI_INSTALLDIR}"
885+)
886+
887+INSTALL(
888+ FILES "icon.png"
889+ DESTINATION "${INI_INSTALLDIR}"
890+)
891+
892+INSTALL(
893+ FILES "./images/logo.png"
894+ DESTINATION "${INI_INSTALLDIR}"
895+)
896
897=== added file 'data/icon.png'
898Binary files data/icon.png 1970-01-01 00:00:00 +0000 and data/icon.png 2014-09-24 10:37:38 +0000 differ
899=== added directory 'data/images'
900=== added file 'data/images/logo.png'
901Binary files data/images/logo.png 1970-01-01 00:00:00 +0000 and data/images/logo.png 2014-09-24 10:37:38 +0000 differ
902=== added directory 'data/renderer'
903=== added file 'data/renderer/carousel.json'
904--- data/renderer/carousel.json 1970-01-01 00:00:00 +0000
905+++ data/renderer/carousel.json 2014-09-24 10:37:38 +0000
906@@ -0,0 +1,12 @@
907+{
908+ "schema-version": 1,
909+ "template": {
910+ "category-layout": "carousel",
911+ "card-size": "medium",
912+ "overlay": true
913+ },
914+ "components": {
915+ "title": "title",
916+ "art": "image"
917+ }
918+}
919
920=== added file 'data/renderer/horizontal-list.json'
921--- data/renderer/horizontal-list.json 1970-01-01 00:00:00 +0000
922+++ data/renderer/horizontal-list.json 2014-09-24 10:37:38 +0000
923@@ -0,0 +1,12 @@
924+{
925+ "schema-version": 1,
926+ "template": {
927+ "category-layout": "horizontal-list",
928+ "card-size": "medium",
929+ "overlay": true
930+ },
931+ "components": {
932+ "title": "title",
933+ "art": "image"
934+ }
935+}
936
937=== added file 'data/renderer/large-grid.json'
938--- data/renderer/large-grid.json 1970-01-01 00:00:00 +0000
939+++ data/renderer/large-grid.json 2014-09-24 10:37:38 +0000
940@@ -0,0 +1,12 @@
941+{
942+ "schema-version": 1,
943+ "template": {
944+ "category-layout": "grid",
945+ "card-size": "large",
946+ "collapsed-rows": 1
947+ },
948+ "components": {
949+ "art": "image-large",
950+ "title": "title"
951+ }
952+}
953
954=== added file 'data/renderer/medium-grid.json'
955--- data/renderer/medium-grid.json 1970-01-01 00:00:00 +0000
956+++ data/renderer/medium-grid.json 2014-09-24 10:37:38 +0000
957@@ -0,0 +1,12 @@
958+{
959+ "schema-version": 1,
960+ "template": {
961+ "category-layout": "grid",
962+ "card-size": "small",
963+ "collapsed-rows": 1
964+ },
965+ "components": {
966+ "art": { "field": "image", "aspect-ratio": 1 },
967+ "title": "title"
968+ }
969+}
970
971=== added file 'data/renderer/vjournal.json'
972--- data/renderer/vjournal.json 1970-01-01 00:00:00 +0000
973+++ data/renderer/vjournal.json 2014-09-24 10:37:38 +0000
974@@ -0,0 +1,15 @@
975+{
976+ "schema-version": 1,
977+ "template": {
978+ "category-layout": "vertical-journal",
979+ "card-layout": "horizontal",
980+ "card-size": "medium",
981+ "collapsed-rows": 1
982+ },
983+ "components": {
984+ "mascot": "image-small",
985+ "title": "title",
986+ "subtitle": "subtitle",
987+ "summary": "summary"
988+ }
989+}
990
991=== added file 'data/renderer/wide-art.json'
992--- data/renderer/wide-art.json 1970-01-01 00:00:00 +0000
993+++ data/renderer/wide-art.json 2014-09-24 10:37:38 +0000
994@@ -0,0 +1,13 @@
995+{
996+ "schema-version": 1,
997+ "template": {
998+ "category-layout": "grid",
999+ "card-size": "large",
1000+ "overlay": true,
1001+ "collapsed-rows": 0
1002+ },
1003+ "components": {
1004+ "title": "title",
1005+ "art": { "field": "image", "aspect-ratio": 2.5 }
1006+ }
1007+}
1008
1009=== added file 'data/timeout.ini.in'
1010--- data/timeout.ini.in 1970-01-01 00:00:00 +0000
1011+++ data/timeout.ini.in 2014-09-24 10:37:38 +0000
1012@@ -0,0 +1,13 @@
1013+[ScopeConfig]
1014+DisplayName = TimeOut
1015+Description = This is an Ubuntu search plugin that enables information from TimeOut to be searched and displayed in the Dash. If you do not wish to search this content source, you can disable this search plugin.
1016+Icon = @SCOPE_ICON@
1017+Author = Canonical Ltd.
1018+SearchHint = Search TimeOut
1019+LocationDataNeeded=true
1020+[Appearance]
1021+Background = @SCOPE_COLOR@
1022+PageHeader.Logo = @SCOPE_LOGO@
1023+PageHeader.Background = @BG_COLOR@
1024+PageHeader.ForegroundColor = @FG_COLOR@
1025+BackgroundColor = @SCOPE_BG_COLOR@
1026
1027=== added file 'manifest.json.in'
1028--- manifest.json.in 1970-01-01 00:00:00 +0000
1029+++ manifest.json.in 2014-09-24 10:37:38 +0000
1030@@ -0,0 +1,15 @@
1031+{
1032+ "name": "@SCOPE_PACKAGE@",
1033+ "description": "@SCOPE_DESC@",
1034+ "framework": "@FRAMEWORK@",
1035+ "architecture": "@ARCH@",
1036+ "title": "@SCOPE_TITLE@",
1037+ "hooks": {
1038+ "@SCOPE_NAME@": {
1039+ "scope": "@SCOPE_NAME@",
1040+ "apparmor": "security.json"
1041+ }
1042+ },
1043+ "version": "0.4.9",
1044+ "maintainer": "@SCOPE_MAINTAINER@"
1045+}
1046
1047=== added file 'push.sh'
1048--- push.sh 1970-01-01 00:00:00 +0000
1049+++ push.sh 2014-09-24 10:37:38 +0000
1050@@ -0,0 +1,8 @@
1051+#!/bin/bash
1052+
1053+for click in `ls *.click`;do
1054+ adb push $click /home/phablet
1055+done
1056+
1057+adb shell "find /home/phablet/ -name *.click -exec pkcon --allow-untrusted install-local {} \;"
1058+adb shell "rm /home/phablet/*.click"
1059
1060=== added file 'run.sh'
1061--- run.sh 1970-01-01 00:00:00 +0000
1062+++ run.sh 2014-09-24 10:37:38 +0000
1063@@ -0,0 +1,24 @@
1064+#!/bin/bash
1065+
1066+if [ $# -eq 1 ]; then
1067+ OWNER=$SUDO_USER
1068+ if [ "$OWNER" = "" ]; then
1069+ OWNER=$USER
1070+ fi
1071+ PACKAGE=`head CMakeLists.txt |grep SCOPE_PACKAGE|cut -d" " -f 2|tr -d "\")"`
1072+ DEST="/opt/click.ubuntu.com/$PACKAGE/current"
1073+
1074+ sudo mkdir -p $DEST
1075+# sudo cp -r data/departments.json $DEST/
1076+ sudo cp -r data/renderer $DEST/
1077+# sudo cp -r data/images $DEST/
1078+ sudo cp -r data/cache $DEST/
1079+
1080+ sudo chown $OWNER:$OWNER $DEST/cache
1081+ echo "Setup complete."
1082+ exit 0;
1083+fi
1084+
1085+cd build/src
1086+path=`pwd`
1087+unity-scope-tool $path/*.ini
1088
1089=== added file 'security.json'
1090--- security.json 1970-01-01 00:00:00 +0000
1091+++ security.json 2014-09-24 10:37:38 +0000
1092@@ -0,0 +1,5 @@
1093+{
1094+ "template": "ubuntu-scope-network",
1095+ "policy_groups": [],
1096+ "policy_version": 1.2
1097+}
1098
1099=== added directory 'src'
1100=== renamed directory 'src' => 'src.moved'
1101=== added file 'src/CMakeLists.txt'
1102--- src/CMakeLists.txt 1970-01-01 00:00:00 +0000
1103+++ src/CMakeLists.txt 2014-09-24 10:37:38 +0000
1104@@ -0,0 +1,22 @@
1105+add_definitions(-DQT_NO_KEYWORDS)
1106+
1107+find_package(Qt5Network REQUIRED)
1108+set(CMAKE_AUTOMOC ON)
1109+
1110+add_library(${SCOPE_PACKAGE}_${SCOPE_NAME} SHARED TimeOut-preview.cpp TimeOut-query.cpp TimeOut-scope.cpp TimeOut-client.cpp)
1111+
1112+target_link_libraries(${SCOPE_PACKAGE}_${SCOPE_NAME} ${UNITY_SCOPES_LDFLAGS})
1113+set_property(TARGET ${SCOPE_PACKAGE}_${SCOPE_NAME} PROPERTY COMPILE_FLAGS ${UNITY_SCOPES_CFLAGS})
1114+
1115+qt5_use_modules(${SCOPE_PACKAGE}_${SCOPE_NAME} Network)
1116+qt5_use_modules(${SCOPE_PACKAGE}_${SCOPE_NAME} Gui)
1117+
1118+CONFIGURE_FILE(
1119+ "${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
1120+ "${CMAKE_CURRENT_SOURCE_DIR}/config.h"
1121+)
1122+
1123+install(
1124+ TARGETS ${SCOPE_PACKAGE}_${SCOPE_NAME}
1125+ LIBRARY DESTINATION ${SCOPE_INSTALLDIR}
1126+)
1127
1128=== added file 'src/TimeOut-client.cpp'
1129--- src/TimeOut-client.cpp 1970-01-01 00:00:00 +0000
1130+++ src/TimeOut-client.cpp 2014-09-24 10:37:38 +0000
1131@@ -0,0 +1,372 @@
1132+/*
1133+ * This file is part of Ubuntu TimeOut Scope.
1134+ * Copyright 2014 Canonical Ltd.
1135+ *
1136+ * TimeOut Scope is free software: you can redistribute it and/or modify it
1137+ * under the terms of the GNU General Public License as published by
1138+ * the Free Software Foundation.
1139+ *
1140+ * TimeOut Scope is distributed in the hope that it will be useful,
1141+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1142+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
1143+ * See the GNU General Public License for more details.
1144+ *
1145+ * You should have received a copy of the GNU General Public License
1146+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
1147+ */
1148+
1149+#include "TimeOut-client.h"
1150+
1151+#include <chrono>
1152+#include <utility>
1153+
1154+#include <QCoreApplication>
1155+#include <QNetworkDiskCache>
1156+
1157+#define VERBOSE
1158+
1159+#define TIMING
1160+
1161+#ifdef TIMING
1162+#define INIT_TIMER auto start = std::chrono::high_resolution_clock::now();
1163+#define START_TIMER start = std::chrono::high_resolution_clock::now();
1164+#define STOP_TIMER(name) qDebug() << "RUNTIME of " << name << ": " << \
1165+ std::chrono::duration_cast<std::chrono::milliseconds>( \
1166+ std::chrono::high_resolution_clock::now()-start \
1167+ ).count() << " ms ";
1168+#else
1169+#define INIT_TIMER
1170+#define START_TIMER
1171+#define STOP_TIMER(name)
1172+#endif
1173+
1174+#define FOREACH_JSON(it, results) for (QJsonArray::iterator it = results.begin(); it != results.end(); ++it)
1175+
1176+const QString USER_AGENT = "TimeOut Scope (Ubuntu)";
1177+const QString GEO_LOOKUP = "http://geoip.ubuntu.com/lookup";
1178+const QString URL = "http://graffiti.timeout.com/v1";
1179+const QString KEY = "key-goes-here";
1180+
1181+const QString AUTH_HEADER = "Bearer %1";
1182+
1183+using namespace Qt;
1184+
1185+TimeOut::TimeOut() {
1186+ useAltCity = false;
1187+}
1188+
1189+void print(QMap<QString, QString> map) {
1190+ QMap<QString, QString>::iterator it;
1191+ for (it = map.begin(); it != map.end(); ++it)
1192+ qDebug() << it.key() << ": " << it.value();
1193+}
1194+QMap<QString,QString> TimeOut::getCityLogos() {
1195+ QMap<QString,QString> myMap;
1196+ myMap["Accra"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/accra.png";
1197+ myMap["Amsterdam"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/amsterdam.png";
1198+ myMap["Barcelona"]="http://www.timeout.cat/bundles/timeoutfrontend/images/logos/bcn.png";
1199+ myMap["Berlin"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/berlin.png";
1200+ myMap["Boston"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/boston.png";
1201+ myMap["Chicago"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/chicago.png";
1202+ myMap["Kuala Lumpur"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/kualalumpur.png";
1203+ myMap["Las Vegas"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/lasvegas.png";
1204+ myMap["London"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/london.png";
1205+ myMap["Los Angeles"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/la.png";
1206+ myMap["Madrid"]="http://www.timeout.es/bundles/timeoutfrontend/images/logos/madrid.png";
1207+ myMap["Miami"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/miami.png";
1208+ myMap["México, DF"]="http://www.timeoutmexico.mx/bundles/timeoutfrontend/images/logos/mex.png";
1209+ myMap["New York"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/ny.png";
1210+ myMap["Paris"]="http://www.timeout.fr/bundles/timeoutfrontend/images/logos/paris.png";
1211+ myMap["Washington, DC"]="http://www.timeout.com/bundles/timeoutfrontend/images/logos/washingtondc.png";
1212+ myMap["unknown"]="http://www.timeout.com/wp-content/uploads/2014/06/TO-web-logo-global.png";
1213+ return myMap;
1214+}
1215+
1216+void TimeOut::setCacheDirectory(std::string const &cacheDirectory) {
1217+ scopeCache = QString::fromStdString(cacheDirectory);
1218+}
1219+
1220+bool inBox(locBox box, coordinates point){
1221+ double big,small;
1222+ if(box.bottom > box.top){
1223+ big=box.bottom;
1224+ small=box.top;
1225+ } else {
1226+ big=box.top;
1227+ small=box.bottom;
1228+ }
1229+ if (!(point.lat<big && point.lat > small))
1230+ return false;
1231+
1232+ if(box.left > box.right){
1233+ big=box.left;
1234+ small=box.right;
1235+ } else {
1236+ big=box.right;
1237+ small=box.left;
1238+ }
1239+ if (!(point.lon<big && point.lon > small))
1240+ return false;
1241+
1242+ return true;
1243+
1244+}
1245+
1246+bool TimeOut::setupCity() {
1247+ coordinates city = getCurrentCity();
1248+ std::vector<CityType> cities = fetchSupportedCities();
1249+ for (unsigned int i = 0 ; i < cities.size(); i++){
1250+ if (inBox(cities[i].box,city)) {
1251+ this->city = cities[i].name;
1252+ this->url = QUrl(cities[i].url);
1253+ qDebug() << "City set to: " << this->city;
1254+ useCurrentCity();
1255+ return true;
1256+ }
1257+ }
1258+ qDebug() << "Unsupported location " << city.lat <<" : " <<city.lon;
1259+ this->city = "";
1260+ this->url = "";
1261+ return false;
1262+}
1263+
1264+QString TimeOut::getCityFromUrl(QString url) {
1265+
1266+ auto iCity = url.right(url.size() - url.indexOf("mobile") - 7);
1267+ iCity = iCity.left(iCity.indexOf("/"));
1268+ qDebug() << "city from url is " <<iCity << " for " << url;
1269+ auto cities = getSupportedCities();
1270+ for (unsigned int i = 0 ; i < cities.size(); i++){
1271+ if(cities[i].url.contains(iCity))
1272+ return cities[i].url;
1273+ }
1274+ return "";
1275+}
1276+
1277+QByteArray TimeOut::makeRequest(QNetworkRequest &request) const {
1278+ int argc = 1;
1279+ char *argv = const_cast<char*>("timeout-scope");
1280+ QCoreApplication *app = new QCoreApplication(argc, &argv);
1281+ QNetworkAccessManager manager;
1282+ QByteArray reply;
1283+ QNetworkDiskCache *cache = new QNetworkDiskCache();
1284+ cache->setCacheDirectory(scopeCache);
1285+
1286+ QString authorizationHeader = AUTH_HEADER.arg(KEY);
1287+ request.setRawHeader("Authorization", authorizationHeader.toStdString().c_str());
1288+ request.setRawHeader("User-Agent", USER_AGENT.toStdString().c_str());
1289+ request.setRawHeader("Content-Type", "application/json");
1290+ request.setAttribute(QNetworkRequest::CacheLoadControlAttribute, QNetworkRequest::PreferCache);
1291+
1292+ QObject::connect(&manager, SIGNAL(finished(QNetworkReply*)), app, SLOT(quit()));
1293+ QObject::connect(&manager, &QNetworkAccessManager::finished,
1294+ [&reply](QNetworkReply *msg) {
1295+ reply = msg->readAll();
1296+ msg->deleteLater();
1297+ });
1298+
1299+ manager.setCache(cache);
1300+ manager.get(request);
1301+ app->exec();
1302+
1303+ delete cache;
1304+ return reply;
1305+}
1306+
1307+QJsonValuePair TimeOut::get(QUrl url, int = 1) const {
1308+ INIT_TIMER
1309+ START_TIMER
1310+ QNetworkRequest request(url); // Add paging when we support it.
1311+ QByteArray data = makeRequest(request);
1312+ STOP_TIMER(QString("GET ").append(url.path()));
1313+
1314+ QJsonParseError e;
1315+ QJsonDocument document = QJsonDocument::fromJson(data, &e);
1316+ if (e.error != QJsonParseError::NoError) {
1317+ qCritical() << "failed to parse response " << e.errorString() << "\n" << QString(data);
1318+ throw QString("Failed to parse response: %1").arg(e.errorString());
1319+ }
1320+
1321+ if(!document.isObject()) {
1322+ throw QString("json is not an object");
1323+ }
1324+ QJsonObject object = document.object();
1325+ if (object.contains("meta")) {
1326+ QJsonValue meta = object.value("meta");
1327+ QJsonValue body = object.value("body");
1328+
1329+ return RESPONSE(meta, body);
1330+ } else {
1331+ // XXX workaround for inconsistent "curateds" API endpoint format
1332+ qCritical() << "No 'meta' tag present!";
1333+ QJsonValue meta, body;
1334+ if (document.isArray()) {
1335+ body = document.array();
1336+ }
1337+ return RESPONSE(meta, body);
1338+ }
1339+}
1340+
1341+coordinates TimeOut::getCurrentCity() {
1342+ //Insert coordinates here for test
1343+ //mycoordinates.lat= 41.4583; mycoordinates.lon= 2.0625; //Barcelona
1344+ //mycoordinates.lat= 41.1583; mycoordinates.lon= -3.6625; //Madrid
1345+ //mycoordinates.lat= 0; mycoordinates.lon= 0; //nowhere
1346+
1347+
1348+ qDebug()<< "lat is " << mycoordinates.lat << " , long is " <<mycoordinates.lon;
1349+
1350+ return mycoordinates;
1351+}
1352+
1353+std::vector<CityType> TimeOut::fetchSupportedCities() {
1354+ QUrl url(URL + "/mobile");
1355+ auto response = get(url);
1356+ supportedCities.clear();
1357+
1358+ qDebug() <<"my locale is" << locale_;
1359+ QJsonValue body = response.second;
1360+ QJsonArray results = body.toArray();
1361+ QJsonArray::iterator it;
1362+ for (it = results.begin(); it != results.end(); ++it) {
1363+ CityType iCity;
1364+ QJsonObject o = (*it).toObject();
1365+
1366+ //get coordinates for the city
1367+ QJsonObject boundingBox = o.value("bounding_box").toObject();
1368+ iCity.box.top=boundingBox.value("top").toDouble();
1369+ iCity.box.bottom=boundingBox.value("bottom").toDouble();
1370+ iCity.box.right=boundingBox.value("right").toDouble();
1371+ iCity.box.left=boundingBox.value("left").toDouble();
1372+ QJsonObject defaultLocale = o.value("default_locale").toObject();
1373+ iCity.name = defaultLocale.value("name").toString();
1374+ //blacklist accra as seems broken
1375+ if (iCity.name == "Accra")
1376+ continue;
1377+ iCity.url = defaultLocale.value("url").toString();
1378+ QJsonArray locales = o.value("locales").toArray();
1379+
1380+ bool locale_found=false;
1381+ bool en_found=false;
1382+ QString en_url="";
1383+
1384+ //check if my locale is supported
1385+ FOREACH_JSON(alocal,locales) {
1386+ QJsonObject o = (*alocal).toObject();
1387+ auto loc_lang = o.value("id").toString();
1388+ qDebug()<<"city supports:" <<loc_lang << "checking against" <<locale_;
1389+ if (loc_lang.contains(locale_)) {
1390+ iCity.url = o.value("url").toString();
1391+ locale_found =true;
1392+ }
1393+ if (loc_lang.contains("en")) {
1394+ en_url = o.value("url").toString();
1395+ en_found =true;
1396+ }
1397+ }
1398+ //if my locale is not found, then try english, if not default
1399+ if (!locale_found && en_found) iCity.url = en_url;
1400+
1401+#ifdef VERBOSE
1402+ qDebug() << iCity.name << " url :" << iCity.url << "\nbox :\nbottom " << iCity.box.bottom
1403+ <<"left "<< iCity.box.left
1404+ << "top "<< iCity.box.top
1405+ << "right " <<iCity.box.right;
1406+#endif
1407+ supportedCities.push_back(iCity);
1408+ }
1409+ return supportedCities;
1410+}
1411+
1412+void TimeOut::getCityEndpoints() {
1413+ site.clear();
1414+ auto response = get(useAltCity?this->alternateUrl:this->url, 1);
1415+
1416+ QJsonValue body = response.second;
1417+ QJsonArray results = body.toArray();
1418+ QJsonArray::iterator it;
1419+ for (it = results.begin(); it != results.end(); ++it) {
1420+ QJsonObject endpoint = (*it).toObject();
1421+ QString id = endpoint.value("id").toString();
1422+ QString url = endpoint.value("url").toString();
1423+#ifdef VERBOSE
1424+ qDebug() << id;
1425+#endif
1426+ site[id] = QUrl(url);
1427+ }
1428+}
1429+
1430+QJsonValuePair TimeOut::getEndpoint(QString endpoint, int page) const {
1431+ /*
1432+ "booking-providers"
1433+ "canned-queries"
1434+ "curateds"
1435+ "editor-lists"
1436+ "editor-picks"
1437+ "facet-groups"
1438+ "page-types"
1439+ "pages"
1440+ "search"
1441+ "windows"
1442+ */
1443+ return this->get(this->site[endpoint], page);
1444+}
1445+
1446+QJsonArray TimeOut::getCannedQueries(int page = 1) const {
1447+ QJsonValuePair response = getEndpoint(QString("canned-queries"), page);
1448+ return BODY(response);
1449+}
1450+
1451+QJsonArray TimeOut::getCurated(int page = 1) const {
1452+ auto response = getEndpoint(QString("curateds"), page);
1453+ return BODY(response);
1454+}
1455+
1456+QJsonArray TimeOut::getEditorLists(int page = 1) const {
1457+ auto response = getEndpoint(QString("editor-lists"), page);
1458+ return BODY(response);
1459+}
1460+
1461+QJsonArray TimeOut::getEditorPicks(int page = 1) const {
1462+ auto response = getEndpoint(QString("editor-picks"), page);
1463+ return BODY(response);
1464+}
1465+
1466+QJsonArray TimeOut::getFacetGroups(int page = 1) const {
1467+ auto response = getEndpoint(QString("facet-groups"), page);
1468+ return BODY(response);
1469+}
1470+
1471+QJsonArray TimeOut::search(QString query, int page = 1) const {
1472+ QString lat= QString::number(mycoordinates.lat);
1473+ QString lng= QString::number(mycoordinates.lon);;
1474+ QString radius("2");
1475+
1476+ QString location = QString("&latitude=%1&longitude=%2&radius=%3")
1477+ .arg(lat).arg(lng).arg(radius);
1478+ QString s = this->site["search"].toString() + QString("&q=%1").arg(query) + location;
1479+ auto response = this->get(QUrl(s), page);
1480+ return BODY(response);
1481+}
1482+/*
1483+ // This is left here for standalone test runs.
1484+int main(int argc, char **argv) {
1485+ TimeOut timeout;
1486+ timeout.setupCity();
1487+
1488+ QJsonArray curated = timeout.getCurated();
1489+ if (curated.empty()) {
1490+ qWarning() << "no curated results!";
1491+ }
1492+#ifdef VERBOSE
1493+ QJsonArray::iterator it;
1494+ for (it = curated.begin(); it != curated.end(); ++it) {
1495+ QJsonObject item = (*it).toObject();
1496+ QString name = item.value("name").toString();
1497+ QString url = item.value("url").toString();
1498+ qDebug() << name << ": " << url;
1499+ }
1500+#endif
1501+ return 0;
1502+}
1503+*/
1504
1505=== added file 'src/TimeOut-client.h'
1506--- src/TimeOut-client.h 1970-01-01 00:00:00 +0000
1507+++ src/TimeOut-client.h 2014-09-24 10:37:38 +0000
1508@@ -0,0 +1,101 @@
1509+/*
1510+ * This file is part of Ubuntu TimeOut Scope.
1511+ * Copyright 2014 Canonical Ltd.
1512+ *
1513+ * TimeOut Scope is free software: you can redistribute it and/or modify it
1514+ * under the terms of the GNU General Public License as published by
1515+ * the Free Software Foundation.
1516+ *
1517+ * TimeOut Scope is distributed in the hope that it will be useful,
1518+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1519+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
1520+ * See the GNU General Public License for more details.
1521+ *
1522+ * You should have received a copy of the GNU General Public License
1523+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
1524+ */
1525+
1526+#ifndef TIMEOUT_CLIENT_H
1527+#define TIMEOUT_CLIENT_H
1528+
1529+#include "config.h"
1530+
1531+#include <QNetworkAccessManager>
1532+#include <QNetworkReply>
1533+#include <QNetworkRequest>
1534+
1535+#include <QJsonArray>
1536+#include <QJsonDocument>
1537+#include <QJsonObject>
1538+
1539+#define RESPONSE(meta, body) std::make_pair(meta, body)
1540+#define META(response) response.first
1541+#define BODY(response) response.second.toArray()
1542+#define COORDINATES(cor,lon, lat) cor.lon=lon;\cor.lat=lat
1543+
1544+typedef std::pair<QJsonValue, QJsonValue> QJsonValuePair;
1545+
1546+//city location
1547+struct coordinates {
1548+ double lon;
1549+ double lat;
1550+};
1551+
1552+struct locBox {
1553+ double top;
1554+ double bottom;
1555+ double left;
1556+ double right;
1557+};
1558+struct CityType {
1559+ QString name;
1560+ QString url;
1561+ locBox box;
1562+};
1563+
1564+class TimeOut
1565+{
1566+
1567+public:
1568+ TimeOut();
1569+ QJsonValuePair get(QUrl, int) const;
1570+
1571+ void setCacheDirectory(std::string const&);
1572+ bool setupCity();
1573+ void setLocale(QString const& locale) { locale_ = locale; }
1574+ void setLocation(double lat, double lon) { mycoordinates.lat=lat;mycoordinates.lon =lon; }
1575+ coordinates getCurrentCity();
1576+ QString getCityName() {return city;}
1577+ QString getCityUrl(){ return url.toString();}
1578+ QString getCityFromUrl(QString url);
1579+ std::vector<CityType> fetchSupportedCities();
1580+ std::vector<CityType> getSupportedCities() {return supportedCities;}
1581+ QMap<QString,QString> getCityLogos();
1582+ void getCityEndpoints();
1583+ QJsonValuePair getEndpoint(QString, int) const;
1584+ QJsonArray getCannedQueries(int) const;
1585+ QJsonArray getCurated(int) const;
1586+ QJsonArray getEditorLists(int) const;
1587+ QJsonArray getEditorPicks(int) const;
1588+ QJsonArray getFacetGroups(int) const;
1589+ QJsonArray search(QString query, int) const;
1590+ void useAlternateCity(const QString& url) { useAltCity =true; alternateUrl =QUrl(url); getCityEndpoints();}
1591+ void useCurrentCity() {useAltCity=false;getCityEndpoints();}
1592+protected:
1593+ QByteArray makeRequest(QNetworkRequest &) const;
1594+
1595+private:
1596+ QString scopeCache;
1597+ QString city;
1598+ QUrl url;
1599+ QUrl alternateUrl;
1600+ bool useAltCity;
1601+ QMap<QString, QUrl> site;
1602+ coordinates mycoordinates;
1603+ QString locale_;
1604+ std::vector<CityType> supportedCities;
1605+
1606+
1607+};
1608+
1609+#endif
1610
1611=== added file 'src/TimeOut-preview.cpp'
1612--- src/TimeOut-preview.cpp 1970-01-01 00:00:00 +0000
1613+++ src/TimeOut-preview.cpp 2014-09-24 10:37:38 +0000
1614@@ -0,0 +1,413 @@
1615+/*
1616+ * This file is part of Ubuntu TimeOut Scope.
1617+ * Copyright 2014 Canonical Ltd.
1618+ *
1619+ * TimeOut Scope is free software: you can redistribute it and/or modify it
1620+ * under the terms of the GNU General Public License as published by
1621+ * the Free Software Foundation.
1622+ *
1623+ * TimeOut Scope is distributed in the hope that it will be useful,
1624+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
1625+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
1626+ * See the GNU General Public License for more details.
1627+ *
1628+ * You should have received a copy of the GNU General Public License
1629+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
1630+ */
1631+
1632+#include "TimeOut-preview.h"
1633+
1634+#include <unity/scopes/PreviewWidget.h>
1635+#include <unity/scopes/ColumnLayout.h>
1636+#include <unity/scopes/PreviewReply.h>
1637+#include <unity/scopes/VariantBuilder.h>
1638+
1639+#include <QDebug>
1640+#include <QString>
1641+
1642+using namespace unity::scopes;
1643+
1644+TimeoutPreview::TimeoutPreview(Result const& result, ActionMetadata const& metadata, TimeOut const& timeout)
1645+ : PreviewQueryBase(result, metadata), timeout(timeout) {
1646+}
1647+
1648+TimeoutPreview::~TimeoutPreview() {
1649+}
1650+
1651+void TimeoutPreview::cancelled() {
1652+}
1653+
1654+#define VARIANT_STR(s) Variant(s.toStdString().c_str())
1655+
1656+void TimeoutPreview::getVenueDetails(PreviewReplyProxy const& reply) {
1657+ Result result = PreviewQueryBase::result();
1658+ QString urlString(result["uri"].get_string().c_str());
1659+ qDebug() << "[Details] GET " << urlString;
1660+ QUrl url = QUrl(urlString);
1661+
1662+ QJsonValuePair response = timeout.get(url, 1);
1663+ QJsonObject o = response.second.toObject();
1664+
1665+ QString phone = o.value("phone").toString();
1666+ QString website = o.value("to_website").toString();
1667+ QString address = o.value("address1").toString();
1668+ QString postcode = o.value("postcode").toString();
1669+ QString city = o.value("city").toString();
1670+ QString transport = o.value("transport").toString();
1671+// QString lat = o.value("latitude").toString();
1672+// QString lon = o.value("longitude").toString();
1673+
1674+ PreviewWidget addressLabel("addressLabel", "text");
1675+ QString fullAddress = QString("%1 %2").arg(address).arg(postcode);
1676+ addressLabel.add_attribute_value("text", VARIANT_STR(fullAddress));
1677+
1678+ PreviewWidget contactButtons("contactButtons", "actions");
1679+ VariantBuilder contact;
1680+ QString fullPhone = QString("tel:///%1").arg(phone);
1681+
1682+ contact.add_tuple({
1683+ {"id", Variant("map")},
1684+ {"label", Variant("Map")},
1685+ {"uri", Variant(QString("http://m.here.com/#action=search&params={\"query\":\"%1,%2 %3\"}")
1686+ .arg(address).arg(city).arg(postcode).toStdString().c_str())}
1687+ });
1688+ contact.add_tuple({
1689+ {"id", Variant("call")},
1690+ {"label", Variant("Call")},
1691+ {"uri", VARIANT_STR(fullPhone)}
1692+ });
1693+ contact.add_tuple({
1694+ {"id", Variant("web")},
1695+ {"label", Variant("Website")},
1696+ {"uri", VARIANT_STR(website)}
1697+ });
1698+ contactButtons.add_attribute_value("actions", contact.end());
1699+
1700+ PreviewWidget details("details", "text");
1701+ details.add_attribute_value("title", Variant("Details"));
1702+ if (!transport.isEmpty()) {
1703+ QString detailsText;
1704+ detailsText.append(QString("<strong>Transport</strong><br />%1").arg(transport));
1705+ details.add_attribute_value("text", VARIANT_STR(detailsText));
1706+ }
1707+
1708+ PreviewWidget actionButtons("actionButtons", "actions");
1709+ VariantBuilder actionsBuilder;
1710+ actionsBuilder.add_tuple({
1711+ {"id", Variant("nearby")},
1712+ {"label", Variant("Nearby venues")}
1713+ });
1714+ actionsBuilder.add_tuple({
1715+ {"id", Variant("share")},
1716+ {"label", Variant("Share")}
1717+ });
1718+ actionButtons.add_attribute_value("actions", actionsBuilder.end());
1719+
1720+ // reply->push({addressLabel, contactButtons, details/*transportText*/, actionButtons});
1721+
1722+ //action buttons currently not supported
1723+ reply->push({addressLabel, contactButtons, details/*transportText*/});
1724+}
1725+
1726+void TimeoutPreview::previewVenue(PreviewReplyProxy const& reply) {
1727+ Result result = PreviewQueryBase::result();
1728+ ColumnLayout one(1);
1729+ one.add_column({"header", "ratings", "art",
1730+ "addressLabel", "contactButtons",
1731+ "timeoutsays", "details"/*"transport"*/, "actionButtons"});
1732+ ColumnLayout two(2);
1733+ two.add_column({"header", "ratings", "art"});
1734+ two.add_column({"addressLabel", "contactButtons", "timeoutsays", "details", "actionButtons"});
1735+ ColumnLayout three(3);
1736+ three.add_column({"header", "ratings", "art"});
1737+ three.add_column({"contactButtons", "addressLabel", "timeoutsays"});
1738+ three.add_column({"actionButtons", "details"});
1739+
1740+ reply->register_layout({one, two, three});
1741+
1742+ PreviewWidget header("header", "header");
1743+ header.add_attribute_mapping("title", "title");
1744+ header.add_attribute_mapping("subtitle", "subcategory_representation");
1745+
1746+
1747+ auto hasRating = this->result().contains("average");
1748+ auto hasTORating = this->result().contains("editorial_rating");
1749+ if (hasRating || hasTORating) {
1750+ PreviewWidget ratings("ratings", "reviews");
1751+ VariantBuilder ratingsBuilder;
1752+ if (hasTORating) {
1753+ ratingsBuilder.add_tuple({
1754+ {"author", Variant("TimeOut")},
1755+ {"rating", result["editorial_rating"]}
1756+ });
1757+ }
1758+ if (hasRating){
1759+ ratingsBuilder.add_tuple({
1760+ {"author", Variant("Users")},
1761+ {"rating", result["average"]}
1762+ });
1763+ }
1764+ ratings.add_attribute_value("reviews", ratingsBuilder.end());
1765+ reply->push({ratings});
1766+ }
1767+ PreviewWidget art("art", "image"); // id, widget type
1768+ art.add_attribute_mapping("source", "image"); // widget key, result key
1769+
1770+ reply->push({header, art});
1771+
1772+ if (!result["description"].get_string().empty()) {
1773+ PreviewWidget timeoutsays("timeoutsays", "text");
1774+ timeoutsays.add_attribute_value("title", Variant("TimeOut says"));
1775+ timeoutsays.add_attribute_mapping("text", "description");
1776+ reply->push({timeoutsays});
1777+ }
1778+
1779+ getVenueDetails(reply);
1780+}
1781+
1782+void TimeoutPreview::getEventDetails(PreviewReplyProxy const& reply) {
1783+ Result result = PreviewQueryBase::result();
1784+ QString urlString(result["uri"].get_string().c_str());
1785+ qDebug() << "[Details] GET " << urlString;
1786+ QUrl url = QUrl(urlString);
1787+
1788+ QJsonValuePair response = timeout.get(url, 1);
1789+ QJsonObject o = response.second.toObject();
1790+
1791+ QString phone = o.value("phone").toString();
1792+ QString website = o.value("to_website").toString();
1793+ QString venueUrl = o.value("venue_urls").toArray()[0].toString();
1794+ QString startDate = o.value("start_date").toString();
1795+ QString endDate = o.value("end_date").toString();
1796+ QString price = o.value("price").toString();
1797+ QString related = o.value("related_items_url").toString();
1798+ QString affinitiesUrl = o.value("affinities_url").toString();
1799+ QString occurrencesUrl = o.value("occurrences_url").toString();
1800+ // occurrence_periods_url
1801+ //QString bookingWeb = o.value("booking_website").toString();
1802+ // posted_at_date
1803+ // annotatino (same as description?)
1804+
1805+ if (o.contains("to_opinion")) {
1806+ if (o.value("to_opinion").toString() == "critics_choice") {
1807+ PreviewWidget opinion("opinion", "text");
1808+ opinion.add_attribute_value("text", Variant("✔ Critics choice"));
1809+
1810+ reply->push({opinion});
1811+ }
1812+ }
1813+
1814+ qDebug() << "[Event venue] GET " << urlString;
1815+ response = timeout.get(QUrl(venueUrl), 1);
1816+ o = response.second.toObject();
1817+
1818+ QString venueName = o.value("name").toString();
1819+ QString address = o.value("address1").toString();
1820+ QString postcode = o.value("postcode").toString();
1821+ QString city = o.value("city").toString();
1822+ QString transport = o.value("transport").toString();
1823+
1824+ PreviewWidget addressLabel("addressLabel", "text");
1825+ addressLabel.add_attribute_value("title", VARIANT_STR(venueName));
1826+ QString fullAddress = QString("%1 %2").arg(address).arg(postcode);
1827+ addressLabel.add_attribute_value("text", VARIANT_STR(fullAddress));
1828+
1829+ // get occurrencesUrl here
1830+ QString showtimes = "TBD";
1831+
1832+ PreviewWidget contactButtons("contactButtons", "actions");
1833+ VariantBuilder contact;
1834+ QString fullPhone = QString("tel:///%1").arg(phone);
1835+ contact.add_tuple({
1836+ {"id", Variant("call")},
1837+ {"label", Variant("Call")},
1838+ {"uri", VARIANT_STR(fullPhone)}
1839+ });
1840+ contact.add_tuple({
1841+ {"id", Variant("map")},
1842+ {"label", Variant("Map")},
1843+ {"uri", Variant(QString("http://m.here.com/#action=search&params={\"query\":\"%1,%2 %3\"}")
1844+ .arg(address).arg(city).arg(postcode).toStdString().c_str())}
1845+ });
1846+ contact.add_tuple({
1847+ {"id", Variant("web")},
1848+ {"label", Variant("Website")},
1849+ {"uri", VARIANT_STR(website)}
1850+ });
1851+ contactButtons.add_attribute_value("actions", contact.end());
1852+
1853+ PreviewWidget details("details", "text");
1854+ details.add_attribute_value("title", Variant("Details"));
1855+ QString detailsText;
1856+// detailsText.append(QString("<strong>Showtimes</strong><br />%1<br />").arg(showtimes));
1857+ if (!price.isEmpty())
1858+ detailsText.append(QString("<strong>Price</strong><br />%1<br />").arg(price));
1859+ if (!transport.isEmpty())
1860+ detailsText.append(QString("<strong>Transport</strong><br />%1").arg(transport));
1861+ details.add_attribute_value("text", VARIANT_STR(detailsText));
1862+
1863+ PreviewWidget actionButtons("actionButtons", "actions");
1864+ VariantBuilder actionsBuilder;
1865+ actionsBuilder.add_tuple({
1866+ {"id", Variant("nearby")},
1867+ {"label", Variant("Nearby venues")}
1868+ });
1869+ actionsBuilder.add_tuple({
1870+ {"id", Variant("share")},
1871+ {"label", Variant("Share")}
1872+ });
1873+ actionButtons.add_attribute_value("actions", actionsBuilder.end());
1874+
1875+ //reply->push({addressLabel, contactButtons, details, actionButtons});
1876+ reply->push({addressLabel, contactButtons, details});
1877+}
1878+
1879+void TimeoutPreview::previewEvent(PreviewReplyProxy const& reply) {
1880+ Result result = PreviewQueryBase::result();
1881+ ColumnLayout one(1);
1882+ one.add_column({"header", "ratings", "art",
1883+ "addressLabel", "contactButtons",
1884+ "timeoutsays", "details", "actionButtons"});
1885+
1886+ ColumnLayout two(2);
1887+ two.add_column({"header", "ratings", "art",
1888+ "addressLabel"});
1889+ two.add_column({"contactButtons",
1890+ "timeoutsays", "details", "actionButtons"});
1891+
1892+
1893+ ColumnLayout three(3);
1894+ three.add_column({"header", "ratings", "art"});
1895+ three.add_column({"addressLabel", "contactButtons",
1896+ "timeoutsays"});
1897+ three.add_column({"details", "actionButtons"});
1898+ reply->register_layout({one, two, three});
1899+
1900+ PreviewWidget header("header", "header");
1901+ header.add_attribute_mapping("title", "title");
1902+ header.add_attribute_mapping("subtitle", "category_representation");
1903+
1904+ auto hasRating = this->result().contains("average");
1905+ auto hasTORating = this->result().contains("editorial_rating");
1906+ if (hasRating || hasTORating) {
1907+ PreviewWidget ratings("ratings", "reviews");
1908+ VariantBuilder ratingsBuilder;
1909+ if (hasTORating) {
1910+ ratingsBuilder.add_tuple({
1911+ {"author", Variant("TimeOut")},
1912+ {"rating", result["editorial_rating"]}
1913+ });
1914+ }
1915+ if (hasRating){
1916+ ratingsBuilder.add_tuple({
1917+ {"author", Variant("Users")},
1918+ {"rating", result["average"]}
1919+ });
1920+ }
1921+ ratings.add_attribute_value("reviews", ratingsBuilder.end());
1922+ reply->push({ratings});
1923+ }
1924+ PreviewWidget art("art", "image");
1925+ art.add_attribute_mapping("source", "image");
1926+
1927+ reply->push({header, art});
1928+
1929+ if (!result["description"].get_string().empty()) {
1930+ PreviewWidget timeoutsays("timeoutsays", "text");
1931+ timeoutsays.add_attribute_value("title", Variant("TimeOut says"));
1932+ timeoutsays.add_attribute_mapping("text", "description");
1933+ reply->push({timeoutsays});
1934+ }
1935+
1936+ getEventDetails(reply);
1937+}
1938+
1939+void TimeoutPreview::previewFilm(PreviewReplyProxy const& reply) {
1940+ Result result = PreviewQueryBase::result();
1941+
1942+ ColumnLayout one(1);
1943+ one.add_column({"header", "ratings", "art","FilmButtons", "timeoutsays", "timeoutsays"});
1944+
1945+ ColumnLayout two(2);
1946+ two.add_column({"header", "ratings", "art"});
1947+ two.add_column({"FilmButtons", "timeoutsays"});
1948+
1949+ ColumnLayout three(3);
1950+ three.add_column({"art","FilmButtons"});
1951+ three.add_column({"header", "ratings"});
1952+ three.add_column({"timeoutsays", "timeoutsays"});
1953+
1954+ reply->register_layout({one, two, three});
1955+
1956+ PreviewWidget header("header", "header");
1957+ header.add_attribute_mapping("title", "title");
1958+ header.add_attribute_mapping("subtitle", "category_representation");
1959+
1960+ auto hasRating = this->result().contains("average");
1961+ auto hasTORating = this->result().contains("editorial_rating");
1962+
1963+ if (hasRating || hasTORating) {
1964+ PreviewWidget ratings("ratings", "reviews");
1965+ VariantBuilder ratingsBuilder;
1966+ if (hasTORating) {
1967+ ratingsBuilder.add_tuple({
1968+ {"author", Variant("TimeOut")},
1969+ {"rating", result["editorial_rating"]}
1970+ });
1971+ }
1972+ if (hasRating){
1973+ ratingsBuilder.add_tuple({
1974+ {"author", Variant("Users")},
1975+ {"rating", result["average"]}
1976+ });
1977+ }
1978+ ratings.add_attribute_value("reviews", ratingsBuilder.end());
1979+ reply->push({ratings});
1980+ }
1981+
1982+ PreviewWidget art("art", "image");
1983+ art.add_attribute_mapping("source", "image");
1984+
1985+ reply->push({header, art});
1986+
1987+ if (!result["description"].get_string().empty()) {
1988+ PreviewWidget timeoutsays("timeoutsays", "text");
1989+ timeoutsays.add_attribute_value("title", Variant("TimeOut says"));
1990+ timeoutsays.add_attribute_mapping("text", "description");
1991+ reply->push({timeoutsays});
1992+ }
1993+
1994+ QString urlString(result["uri"].get_string().c_str());
1995+ qDebug() << "[Details] GET " << urlString;
1996+ QUrl url = QUrl(urlString);
1997+
1998+ QJsonValuePair response = timeout.get(url, 1);
1999+ QJsonObject o = response.second.toObject();
2000+
2001+ QString website = o.value("to_website").toString();
2002+ if (!website.isEmpty()){
2003+ PreviewWidget filmButtons("FilmButtons", "actions");
2004+ VariantBuilder filmAction;
2005+ filmAction.add_tuple({
2006+ {"id", Variant("web")},
2007+ {"label", Variant("More")},
2008+ {"uri", VARIANT_STR(website)}
2009+ });
2010+ filmButtons.add_attribute_value("actions", filmAction.end());
2011+ reply->push({filmButtons});
2012+ }
2013+
2014+}
2015+
2016+void TimeoutPreview::run(PreviewReplyProxy const& reply) {
2017+ Result result = PreviewQueryBase::result();
2018+ std::string type = result["type"].get_string();
2019+ qDebug() << "Previewing: " << QString(type.c_str());
2020+ if (type == "venue") {
2021+ previewVenue(reply);
2022+ } else if (type == "event") {
2023+ previewEvent(reply);
2024+ } else if (type == "film") {
2025+ previewFilm(reply);
2026+ }
2027+}
2028
2029=== added file 'src/TimeOut-preview.h'
2030--- src/TimeOut-preview.h 1970-01-01 00:00:00 +0000
2031+++ src/TimeOut-preview.h 2014-09-24 10:37:38 +0000
2032@@ -0,0 +1,46 @@
2033+/*
2034+ * This file is part of Ubuntu TimeOut Scope.
2035+ * Copyright 2014 Canonical Ltd.
2036+ *
2037+ * TimeOut Scope is free software: you can redistribute it and/or modify it
2038+ * under the terms of the GNU General Public License as published by
2039+ * the Free Software Foundation.
2040+ *
2041+ * TimeOut Scope is distributed in the hope that it will be useful,
2042+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2043+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
2044+ * See the GNU General Public License for more details.
2045+ *
2046+ * You should have received a copy of the GNU General Public License
2047+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
2048+ */
2049+
2050+#ifndef TIMEOUT_PREVIEW_H
2051+#define TIMEOUT_PREVIEW_H
2052+
2053+#include "TimeOut-client.h"
2054+
2055+#include <unity/scopes/PreviewQueryBase.h>
2056+#include <unity/scopes/Result.h>
2057+
2058+using namespace unity::scopes;
2059+
2060+class TimeoutPreview : public PreviewQueryBase
2061+{
2062+public:
2063+ TimeoutPreview(Result const&, ActionMetadata const&, TimeOut const&);
2064+ ~TimeoutPreview();
2065+
2066+ virtual void cancelled() override;
2067+ virtual void run(PreviewReplyProxy const& reply) override;
2068+ void getVenueDetails(PreviewReplyProxy const& reply);
2069+ void getEventDetails(PreviewReplyProxy const& reply);
2070+ void previewVenue(PreviewReplyProxy const& reply);
2071+ void previewEvent(PreviewReplyProxy const& reply);
2072+ void previewFilm(PreviewReplyProxy const& reply);
2073+
2074+private:
2075+ const TimeOut timeout;
2076+};
2077+
2078+#endif
2079
2080=== added file 'src/TimeOut-query.cpp'
2081--- src/TimeOut-query.cpp 1970-01-01 00:00:00 +0000
2082+++ src/TimeOut-query.cpp 2014-09-24 10:37:38 +0000
2083@@ -0,0 +1,491 @@
2084+/*
2085+ * This file is part of Ubuntu TimeOut Scope.
2086+ * Copyright 2014 Canonical Ltd.
2087+ *
2088+ * TimeOut Scope is free software: you can redistribute it and/or modify it
2089+ * under the terms of the GNU General Public License as published by
2090+ * the Free Software Foundation.
2091+ *
2092+ * TimeOut Scope is distributed in the hope that it will be useful,
2093+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2094+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
2095+ * See the GNU General Public License for more details.
2096+ *
2097+ * You should have received a copy of the GNU General Public License
2098+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
2099+ */
2100+
2101+#include "TimeOut-query.h"
2102+#include "TimeOut-client.h"
2103+
2104+#include <unity/scopes/Annotation.h>
2105+#include <unity/scopes/CategorisedResult.h>
2106+#include <unity/scopes/CategoryRenderer.h>
2107+#include <unity/scopes/QueryBase.h>
2108+#include <unity/scopes/SearchReply.h>
2109+#include <unity/scopes/Department.h>
2110+#include <unity/scopes/VariantBuilder.h>
2111+
2112+using namespace Qt;
2113+using namespace unity::scopes;
2114+
2115+std::string JOURNAL;
2116+std::string WIDE_ART;
2117+std::string HORIZONTAL_LIST;
2118+std::string MEDIUM_GRID;
2119+std::string LARGE_GRID;
2120+std::string CAROUSEL;
2121+
2122+const QString imageWidth = QString("{width}");
2123+const QString imageHeight = QString("{height}");
2124+
2125+//avoid registering multiple depts
2126+std::set<QString> Deptset;
2127+
2128+QString readFile(QString path) {
2129+ QFile file(path);
2130+ file.open(QIODevice::ReadOnly | QIODevice::Text);
2131+ QString data = file.readAll();
2132+ file.close();
2133+ return data;
2134+}
2135+
2136+std::string TimeoutQuery::getRenderer(QString name) {
2137+ QString path = QString("%1/renderer/%2.json").arg(scopePath_).arg(name);
2138+ qDebug() << "loading renderer " << path;
2139+ QString renderer = readFile(path);
2140+ return renderer.toStdString();
2141+}
2142+
2143+TimeoutQuery::TimeoutQuery(CannedQuery const& query, SearchMetadata const& metadata, TimeOut &timeout, QString scope_dir)
2144+ : SearchQueryBase(query, metadata), timeout(timeout), scopePath_(scope_dir) {
2145+ JOURNAL = getRenderer("vjournal");
2146+ WIDE_ART = getRenderer("wide-art");
2147+ MEDIUM_GRID = getRenderer("medium-grid");
2148+ LARGE_GRID = getRenderer("large-grid");
2149+ CAROUSEL = getRenderer("carousel");
2150+ HORIZONTAL_LIST = getRenderer("horizontal-list");
2151+}
2152+
2153+TimeoutQuery::~TimeoutQuery() {
2154+
2155+}
2156+
2157+void TimeoutQuery::cancelled() {
2158+}
2159+
2160+void set(CategorisedResult &result, std::string &key, QString &value) {
2161+ result[key] = value.toStdString();
2162+}
2163+
2164+std::string reformat(QString mytext){
2165+ QTextDocument text;
2166+ text.setHtml(mytext);
2167+ auto newText =text.toPlainText().toStdString();
2168+ return newText;
2169+}
2170+
2171+#define SET_RESULT(key) result[key] = o.value(key).toString().toStdString()
2172+#define SET_RESULT_INT(key) result[key] = o.value(key).toInt(0)
2173+#define SET_RESULT_REMAP(apikey, key) result[key] = o.value(apikey).toString().toStdString()
2174+#define SET_RESULT_FROM_JSON(apikey, key, json) result[key] = json.value(apikey).toString().toStdString()
2175+
2176+void getResultDetailsFromJson(QJsonObject const& o, CategorisedResult &result) {
2177+ SET_RESULT("uid");
2178+ SET_RESULT("id");
2179+ SET_RESULT("category_representation");
2180+ SET_RESULT("subcategory_representation");
2181+
2182+ //remove html special characters from the description
2183+ auto formatted_text = reformat(o.value("description").toString());
2184+ result["description"]=formatted_text;
2185+
2186+ SET_RESULT_REMAP("to_website", "web");
2187+ if (o.contains("editorial_rating")) {
2188+ SET_RESULT_INT("editorial_rating");
2189+ }
2190+ if (o.contains("user_ratings_summary")) {
2191+ QJsonObject ratings = o.value("user_ratings_summary").toObject();
2192+ SET_RESULT_FROM_JSON("average", "average", ratings);
2193+ SET_RESULT_FROM_JSON("count", "count", ratings);
2194+ }
2195+}
2196+
2197+#define SET_SIZE(pattern, w, h) pattern\
2198+ .replace(imageWidth, QString::number(w))\
2199+ .replace(imageHeight, QString::number(h))\
2200+ .toStdString()
2201+
2202+void getResultFromJson(QJsonArray::iterator const& it, CategorisedResult &result) {
2203+ QJsonObject o = (*it).toObject();
2204+
2205+ SET_RESULT_REMAP("url", "uri");
2206+ SET_RESULT_REMAP("name", "title");
2207+ QJsonObject image = o.value("image").toObject();
2208+ if (image.contains("url_pattern")) {
2209+ QJsonObject pattern = image.value("url_pattern").toObject();
2210+ QString urlPattern = pattern.value("value").toString();
2211+ result["image"] = SET_SIZE(urlPattern, 480, 360);
2212+ result["image-large"] = SET_SIZE(urlPattern, 800, 600);
2213+ result["image-small"] = SET_SIZE(urlPattern, 320, 240);
2214+ } else {
2215+ SET_RESULT_FROM_JSON("url", "image", image);
2216+ }
2217+
2218+ if (o.contains("type")) {
2219+ qDebug() << "Item contains type";
2220+ QString type = o.value("type").toString();
2221+ result["type"] = type.toStdString();
2222+ if (type != "curated") {
2223+ getResultDetailsFromJson(o, result);
2224+ } else {
2225+ //this creates a link to a department when you click on a result
2226+ qDebug() << "Item is a link to a category";
2227+ auto uri = o.value("url").toString();
2228+ CannedQuery catheader_query((SCOPE_PACKAGE+"_"+SCOPE_NAME).toStdString(), "",
2229+ uri.toStdString());
2230+ result.set_uri(catheader_query.to_uri());
2231+ }
2232+ }
2233+}
2234+
2235+/*
2236+ This is hardcoded here only temporarily for alternate content surfacing. For instance,
2237+ in "Restaurants and Cafes" category we used to show the list of curated lists. Being
2238+ temporarily limited by technical reasons, instead of showing those (which would not yet
2239+ open proper lists of items), we show selected subcategory from given category when surfacing."
2240+*/
2241+static const QMap<QString, QString> ALTERNATE_SURFACING {
2242+ {
2243+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/editorial+lists/restaurants_caf_s?locale=en-GB",
2244+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/food+%26+drink/sunday_roasts_mobile?locale=en-GB"
2245+ },
2246+ {
2247+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/editorial+lists/bars_pubs?locale=en-GB",
2248+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/food+%26+drink/lon_en_20120718_ipad_cocktailbars?locale=en-GB"
2249+ },
2250+ {
2251+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/editorial+lists/things_to_do?locale=en-GB",
2252+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/things+to+do/london_hot_list?locale=en-GB"
2253+ },
2254+ {
2255+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/editorial+lists/art?locale=en-GB",
2256+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/art+%26+culture/art_best_new_art?locale=en-GB"
2257+ },
2258+ {
2259+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/editorial+lists/theatre_dance?locale=en-GB",
2260+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/art+%26+culture/theatre_critics_choice_new_shows?locale=en-GB"
2261+ },
2262+ {
2263+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/editorial+lists/muisc_nightlife?locale=en-GB",
2264+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/music+%26+nightlife/clubs_app?locale=en-GB"
2265+ },
2266+ {
2267+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/editorial+lists/shopping_style?locale=en-GB",
2268+ "http://graffiti.timeout.com/v1/mobile/uk-london/curateds/shopping+%26+lifestyle/department_stores?locale=en-GB"
2269+ }
2270+};
2271+
2272+#define FOREACH_JSON(it, results) for (QJsonArray::iterator it = results.begin(); it != results.end(); ++it)
2273+
2274+void TimeoutQuery::getGeneric(TimeOut const& timeout, QString &url, std::string &categoryJson,
2275+ QString &id, QString &title, SearchReplyProxy const& reply) {
2276+
2277+ qDebug() << "category id is " << id;
2278+ CannedQuery catheader_query((SCOPE_PACKAGE+"_"+SCOPE_NAME).toStdString(), "",
2279+ url.toStdString());
2280+
2281+ CategoryRenderer renderer(categoryJson);
2282+ Category::SCPtr category;
2283+
2284+ if (title.isEmpty()) {
2285+ category= reply->register_category(
2286+ id.toStdString(), title.toStdString(), "", renderer);
2287+ } else {
2288+ category= reply->register_category(
2289+ id.toStdString(), title.toStdString(), "",catheader_query, renderer);
2290+ }
2291+
2292+ QJsonValuePair response = timeout.get(QUrl(url), 1);
2293+ QJsonArray results = BODY(response);
2294+
2295+ FOREACH_JSON(json, results) {
2296+ CategorisedResult result(category);
2297+ getResultFromJson(json, result);
2298+ if (!reply->push(result)) break;
2299+ }
2300+}
2301+
2302+void TimeoutQuery::getEditorLists(TimeOut const& timeout, SearchReplyProxy const& reply) {
2303+ QJsonArray results = timeout.getEditorLists(1);
2304+ FOREACH_JSON(json, results) {
2305+ QJsonObject o = (*json).toObject();
2306+ QString uid = o.value("uid").toString();
2307+ if (!(uid.contains("things_to_do") || uid.contains(MAD_TTODO)))
2308+ continue;
2309+ QString listName = o.value("name").toString();
2310+ QString name = listName;
2311+ QString url = o.value("url").toString();
2312+ if (uid.contains(MAD_TTODO)) uid =+ "things_to_do";
2313+ std::string category = WIDE_ART;
2314+ getGeneric(timeout, url, category, uid, name, reply);
2315+ }
2316+
2317+ FOREACH_JSON(json, results) {
2318+ QJsonObject o = (*json).toObject();
2319+ QString uid = o.value("uid").toString();
2320+ if (uid.contains("things_to_do"))
2321+ continue;
2322+ QString listName = o.value("name").toString();
2323+ QString name = listName;
2324+ QString url = o.value("url").toString();
2325+ if (uid.contains(MAD_BAR)) uid =+ "bars";
2326+ if (uid.contains(MAD_RESTAURANTS)) uid =+ "restaurants";
2327+ if (uid.contains(MAD_SHOPPING)) uid =+ "shopping";
2328+ qDebug() << "Category id is " << uid;
2329+
2330+ std::string category = MEDIUM_GRID;
2331+ getGeneric(timeout, url, category, uid, name, reply);
2332+ }
2333+}
2334+
2335+void TimeoutQuery::getCitySurface(TimeOut timeout, SearchReplyProxy reply) {
2336+ CategoryRenderer renderer(JOURNAL);
2337+ auto citiesCat = reply->register_category("cities", "", "", renderer);
2338+ auto citiesArt =timeout.getCityLogos();
2339+ auto cities = timeout.getSupportedCities();
2340+ for (unsigned int i = 0; i < cities.size(); i++) {
2341+ CategorisedResult result(citiesCat);
2342+ CannedQuery city_query((SCOPE_PACKAGE+"_"+SCOPE_NAME).toStdString(), "",
2343+ ("city:"+ cities[i].url).toStdString());
2344+ result.set_uri(city_query.to_uri());
2345+ QString city_name = cities[i].name;
2346+ result["image-small"]=citiesArt[city_name].toStdString();
2347+ result["title"]=city_name.toStdString();
2348+
2349+ reply->push(result);
2350+ }
2351+
2352+}
2353+void TimeoutQuery::getEditorPicks(TimeOut const& timeout, SearchReplyProxy const& reply) {
2354+ CategoryRenderer renderer(HORIZONTAL_LIST);
2355+ auto editorPicks = reply->register_category("editor-picks", "", "", renderer);
2356+ QJsonArray results = timeout.getEditorPicks(1);
2357+
2358+ qDebug() << "Got editors picks";
2359+ FOREACH_JSON(json, results) {
2360+ QJsonObject o = (*json).toObject();
2361+ QString type = o.value("type").toString();
2362+ // FIXME filtering out type:curated for now. Needs activation.
2363+ if (type == "curated") continue;
2364+
2365+ CategorisedResult result(editorPicks);
2366+ getResultFromJson(json, result);
2367+ if (!reply->push(result)) break;
2368+ }
2369+}
2370+
2371+void TimeoutQuery::search(TimeOut const& timeout, SearchReplyProxy const& reply) {
2372+ CannedQuery cannedQuery = SearchQueryBase::query();
2373+ QString query = QString::fromStdString(cannedQuery.query_string());
2374+ QString title = QString("Results for %1:").arg(query);
2375+
2376+ CategoryRenderer renderer(JOURNAL);
2377+ auto search = reply->register_category("search", title.toStdString(), "", renderer);
2378+
2379+ QJsonArray results = timeout.search(query, 1);
2380+ FOREACH_JSON(json, results) {
2381+ QJsonObject o = (*json).toObject();
2382+ QString type = o.value("type").toString();
2383+
2384+ CategorisedResult result(search);
2385+ getResultFromJson(json, result);
2386+ if (!reply->push(result)) break;
2387+ }
2388+}
2389+
2390+const int MAX_DEPT_NAME = 45;
2391+
2392+void setSubdepartments(TimeOut const& timeout, Department::SPtr const& parent, QString &/*id*/,
2393+ QString &/*title*/, QUrl const& url, SearchReplyProxy const& /*reply*/) {
2394+ DepartmentList depts;
2395+
2396+ QJsonValuePair response = timeout.get(QUrl(url), 1);
2397+ QJsonArray results = BODY(response);
2398+
2399+ FOREACH_JSON(json, results) {
2400+ QJsonObject o = (*json).toObject();
2401+ QString uid = o.value("uid").toString();
2402+ QString name = o.value("name").toString();
2403+ QString url = o.value("url").toString();
2404+ QString type = o.value("type").toString();
2405+
2406+ if (name.length() > MAX_DEPT_NAME) {
2407+ name = name.left(MAX_DEPT_NAME) + "...";
2408+ }
2409+
2410+ if (type == "curated") {
2411+ CannedQuery query((SCOPE_PACKAGE+"_"+SCOPE_NAME).toStdString());
2412+ if (Deptset.find(url) != Deptset.end()) {
2413+ qDebug()<<"duplicated dept " << url;
2414+ continue;
2415+ }
2416+ Deptset.insert(url);
2417+ query.set_department_id(url.toStdString());
2418+ query.set_query_string(url.toStdString());
2419+ Department::SPtr dept(Department::create(url.toStdString(), query, name.toStdString()));
2420+ depts.push_back(dept);
2421+ }
2422+ }
2423+ depts.unique();
2424+ if (depts.size() >0)
2425+ parent->set_subdepartments(depts);
2426+}
2427+
2428+void setDepartmentsFromEditorLists(TimeOut timeout, Department::SPtr parent,
2429+ SearchReplyProxy reply, QString city_url) {
2430+ Deptset.clear();
2431+ DepartmentList depts;
2432+ qDebug()<<"Retriving departments";
2433+ timeout.useAlternateCity(city_url);
2434+ QJsonArray results = timeout.getEditorLists(1);
2435+ FOREACH_JSON(json, results) {
2436+ QJsonObject o = (*json).toObject();
2437+ QString uid = o.value("uid").toString();
2438+ QString name = o.value("name").toString();
2439+ QString url = o.value("url").toString();
2440+ QString type = o.value("type").toString();
2441+
2442+ qDebug() << " DeptId is " << url;
2443+
2444+ if (name.length() > MAX_DEPT_NAME) {
2445+ name = name.left(MAX_DEPT_NAME) + "...";
2446+ }
2447+
2448+ if (type == "curated") {
2449+ CannedQuery query((SCOPE_PACKAGE+"_"+SCOPE_NAME).toStdString());
2450+ if (Deptset.find(url) != Deptset.end()) {
2451+ qDebug()<<"duplicated dept " << url;
2452+ continue;
2453+ }
2454+ Deptset.insert(url);
2455+ query.set_department_id(url.toStdString());
2456+ query.set_query_string(url.toStdString());
2457+
2458+ Department::SPtr dept(Department::create(url.toStdString(), query, name.toStdString()));
2459+ depts.push_back(dept);
2460+ setSubdepartments(timeout, dept, uid, name, url, reply);
2461+ }
2462+ }
2463+ depts.unique();
2464+ parent->set_subdepartments(depts);
2465+}
2466+
2467+void TimeoutQuery::getDepartments(SearchReplyProxy const& reply, bool inCity, QString expandUrl) {
2468+ DepartmentList depts;
2469+
2470+ qDebug() << "City found is " << inCity << "url is " <<expandUrl;
2471+ //clear previous dept sets
2472+ Deptset.clear();
2473+ QString cityUrl = timeout.getCityUrl();
2474+
2475+ Department::SPtr moreCities;
2476+ Department::SPtr topDept;
2477+ Department::SPtr expandCity;
2478+
2479+
2480+ CannedQuery topQuery((SCOPE_PACKAGE+"_"+SCOPE_NAME).toStdString());
2481+ topQuery.set_department_id("");
2482+
2483+ //get list of cities
2484+ std::vector<CityType> list_cities = timeout.getSupportedCities();
2485+
2486+ for (unsigned int i = 0; i < list_cities.size(); i++) {
2487+ CannedQuery query((SCOPE_PACKAGE+"_"+SCOPE_NAME).toStdString());
2488+ query.set_department_id(list_cities[i].name.toStdString());
2489+ query.set_query_string(list_cities[i].url.toStdString());
2490+
2491+ Department::SPtr dept(Department::create(("city:" + list_cities[i].url).toStdString(), query, list_cities[i].name.toStdString()));
2492+ dept->set_has_subdepartments(true);
2493+
2494+ //check if it is the dept I need to expand
2495+ if (expandUrl == list_cities[i].url)
2496+ expandCity = dept;
2497+
2498+ //check if it is the root dept
2499+ if (!(inCity && cityUrl == list_cities[i].url))
2500+ depts.push_back(dept);
2501+
2502+ }
2503+
2504+ if (inCity){
2505+ Department::SPtr rootDept(Department::create("", topQuery, timeout.getCityName().toStdString()));
2506+ Department::SPtr moreDept(Department::create("moreCities", topQuery, "More Cities"));
2507+ moreDept->set_subdepartments(depts);
2508+ setDepartmentsFromEditorLists(timeout, rootDept, reply, cityUrl);
2509+ rootDept->add_subdepartment(moreDept);
2510+ topDept = rootDept;
2511+
2512+ } else {
2513+ Department::SPtr rootDept(Department::create("", topQuery, "Pick a city"));
2514+ rootDept->set_subdepartments(depts);
2515+ topDept = rootDept;
2516+ }
2517+ if(expandUrl != cityUrl)
2518+ setDepartmentsFromEditorLists(timeout, expandCity, reply, expandUrl);
2519+
2520+ reply->register_departments(topDept);
2521+}
2522+
2523+void TimeoutQuery::run(SearchReplyProxy const& reply) {
2524+
2525+
2526+ auto mylang = QString::fromStdString(search_metadata().locale()).left(2);
2527+ qDebug() << "language is " <<mylang;
2528+ timeout.setLocale(mylang);
2529+ try {
2530+ timeout.setLocation(search_metadata().location().latitude(),search_metadata().location().longitude());
2531+ } catch (const std::exception &e) {
2532+ // timeout.setLocation(0,0);
2533+ }
2534+
2535+ CannedQuery query = SearchQueryBase::query();
2536+ QString queryString = QString::fromStdString(query.query_string());
2537+ QString deptId = QString::fromStdString(query.department_id());
2538+ auto city_found = timeout.setupCity();
2539+ qDebug() << "city is " << timeout.getCityUrl();
2540+
2541+ if (queryString.length() == 0) {
2542+ if (deptId == "") {
2543+ getDepartments(reply, city_found, timeout.getCityUrl());
2544+ qDebug() << "Empty search - doing surfacing instead";
2545+ if (city_found){
2546+ getEditorPicks(timeout, reply);
2547+ getEditorLists(timeout, reply);
2548+ } else {
2549+ getCitySurface(timeout, reply);
2550+ }
2551+ return;
2552+ }
2553+ if (deptId.contains("city:")) {
2554+ auto cityUrl = deptId.right(deptId.size()-5);
2555+ getDepartments(reply, city_found, cityUrl);
2556+ timeout.useAlternateCity(cityUrl);
2557+ getEditorPicks(timeout, reply);
2558+ getEditorLists(timeout, reply);
2559+ return;
2560+ }
2561+ if (deptId.contains("moreCities")) {
2562+ getDepartments(reply, city_found,timeout.getCityUrl());
2563+ return;
2564+ }
2565+ auto cityUrl = timeout.getCityFromUrl(deptId);
2566+ getDepartments(reply, city_found,cityUrl);
2567+ QString url = deptId;
2568+ QString title = "";
2569+ getGeneric(timeout, url, WIDE_ART, url, title, reply);
2570+
2571+ } else {
2572+ search(timeout, reply);
2573+ }
2574+}
2575
2576=== added file 'src/TimeOut-query.h'
2577--- src/TimeOut-query.h 1970-01-01 00:00:00 +0000
2578+++ src/TimeOut-query.h 2014-09-24 10:37:38 +0000
2579@@ -0,0 +1,69 @@
2580+/*
2581+ * This file is part of Ubuntu TimeOut Scope.
2582+ * Copyright 2014 Canonical Ltd.
2583+ *
2584+ * TimeOut Scope is free software: you can redistribute it and/or modify it
2585+ * under the terms of the GNU General Public License as published by
2586+ * the Free Software Foundation.
2587+ *
2588+ * TimeOut Scope is distributed in the hope that it will be useful,
2589+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2590+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
2591+ * See the GNU General Public License for more details.
2592+ *
2593+ * You should have received a copy of the GNU General Public License
2594+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
2595+ */
2596+
2597+#ifndef TIMEOUT_QUERY_H
2598+#define TIMEOUT_QUERY_H
2599+
2600+#include "TimeOut-client.h"
2601+
2602+#include <unity/scopes/SearchQueryBase.h>
2603+#include <unity/scopes/ReplyProxyFwd.h>
2604+#include <unity/scopes/CategorisedResult.h>
2605+
2606+#include <QFile>
2607+#include <QString>
2608+#include <QMap>
2609+#include <set>
2610+#include <unity/scopes/Location.h>
2611+#include <unity/scopes/Location.h>
2612+#include <unity/scopes/SearchMetadata.h>
2613+#include <QTextDocument>
2614+#include <QCoreApplication>
2615+
2616+
2617+using namespace unity::scopes;
2618+
2619+class TimeOut;
2620+
2621+class TimeoutQuery : public SearchQueryBase
2622+{
2623+public:
2624+ TimeoutQuery(CannedQuery const&, SearchMetadata const&, TimeOut &, QString);
2625+ ~TimeoutQuery();
2626+ virtual void cancelled() override;
2627+
2628+ virtual void run(SearchReplyProxy const& reply) override;
2629+
2630+ void getDepartments(SearchReplyProxy const& reply, bool inCity, QString expandUrl);
2631+ void search(TimeOut const& timeout, SearchReplyProxy const& reply);
2632+ void getEditorLists(TimeOut const& timeout, SearchReplyProxy const& reply);
2633+ void getEditorPicks(TimeOut const& timeout, SearchReplyProxy const& reply);
2634+ void getGeneric(TimeOut const& timeout, QString &url, std::string &categoryJson,
2635+ QString &id, QString &title, SearchReplyProxy const& reply);
2636+ void getCitySurface(TimeOut timeout, SearchReplyProxy reply);
2637+
2638+
2639+
2640+private:
2641+ std::string getRenderer(QString name);
2642+ TimeOut timeout;
2643+ //avoid registering multiple depts
2644+ std::set<QString> Deptset;
2645+ QString scopePath_;
2646+};
2647+
2648+#endif
2649
2650=== added file 'src/TimeOut-scope.cpp'
2651--- src/TimeOut-scope.cpp 1970-01-01 00:00:00 +0000
2652+++ src/TimeOut-scope.cpp 2014-09-24 10:37:38 +0000
2653@@ -0,0 +1,62 @@
2654+/*
2655+ * This file is part of Ubuntu TimeOut Scope.
2656+ * Copyright 2014 Canonical Ltd.
2657+ *
2658+ * TimeOut Scope is free software: you can redistribute it and/or modify it
2659+ * under the terms of the GNU General Public License as published by
2660+ * the Free Software Foundation.
2661+ *
2662+ * TimeOut Scope is distributed in the hope that it will be useful,
2663+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2664+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
2665+ * See the GNU General Public License for more details.
2666+ *
2667+ * You should have received a copy of the GNU General Public License
2668+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
2669+ */
2670+
2671+#include "TimeOut-scope.h"
2672+#include "TimeOut-query.h"
2673+#include "TimeOut-preview.h"
2674+#include <unity-scopes.h>
2675+
2676+using namespace unity::scopes;
2677+
2678+void TimeoutScope::start(std::string const&) {
2679+ timeout.setCacheDirectory(cache_directory());
2680+}
2681+
2682+void TimeoutScope::stop() {
2683+}
2684+
2685+SearchQueryBase::UPtr TimeoutScope::search(CannedQuery const &q, SearchMetadata const& metadata) {
2686+ const QString scopePath = QString::fromStdString(scope_directory());
2687+ SearchQueryBase::UPtr query(new TimeoutQuery(q, metadata, timeout, scopePath));
2688+ return query;
2689+}
2690+
2691+PreviewQueryBase::UPtr TimeoutScope::preview(Result const& result, ActionMetadata const& metadata) {
2692+ PreviewQueryBase::UPtr preview(new TimeoutPreview(result, metadata, timeout));
2693+ return preview;
2694+}
2695+
2696+#define EXPORT __attribute__ ((visibility ("default")))
2697+
2698+extern "C"
2699+{
2700+
2701+EXPORT
2702+ScopeBase*
2703+// cppcheck-suppress unusedFunction
2704+UNITY_SCOPE_CREATE_FUNCTION() {
2705+ return new TimeoutScope();
2706+}
2707+
2708+EXPORT
2709+void
2710+// cppcheck-suppress unusedFunction
2711+UNITY_SCOPE_DESTROY_FUNCTION(ScopeBase* scope_base) {
2712+ delete scope_base;
2713+}
2714+
2715+}
2716
2717=== added file 'src/TimeOut-scope.h'
2718--- src/TimeOut-scope.h 1970-01-01 00:00:00 +0000
2719+++ src/TimeOut-scope.h 2014-09-24 10:37:38 +0000
2720@@ -0,0 +1,51 @@
2721+/*
2722+ * This file is part of Ubuntu TimeOut Scope.
2723+ * Copyright 2014 Canonical Ltd.
2724+ *
2725+ * TimeOut Scope is free software: you can redistribute it and/or modify it
2726+ * under the terms of the GNU General Public License as published by
2727+ * the Free Software Foundation.
2728+ *
2729+ * TimeOut Scope is distributed in the hope that it will be useful,
2730+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2731+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
2732+ * See the GNU General Public License for more details.
2733+ *
2734+ * You should have received a copy of the GNU General Public License
2735+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
2736+ */
2737+
2738+#ifndef DEMOSCOPE_H
2739+#define DEMOSCOPE_H
2740+
2741+#include "TimeOut-client.h"
2742+
2743+#include <unity/scopes/ScopeBase.h>
2744+#include <unity/scopes/QueryBase.h>
2745+#include <unity/scopes/ReplyProxyFwd.h>
2746+#include <unity/scopes/QueryBase.h>
2747+#include <unity/scopes/PreviewQueryBase.h>
2748+#include <unity/scopes/Location.h>
2749+#include <QCoreApplication>
2750+
2751+
2752+
2753+using namespace unity::scopes;
2754+
2755+class TimeoutScope : public unity::scopes::ScopeBase
2756+{
2757+public:
2758+ virtual void start(std::string const&) override;
2759+
2760+ virtual void stop() override;
2761+
2762+ PreviewQueryBase::UPtr preview(const Result&, const ActionMetadata&) override;
2763+
2764+ virtual SearchQueryBase::UPtr search(CannedQuery const& q, SearchMetadata const&) override;
2765+
2766+private:
2767+ TimeOut timeout;
2768+
2769+};
2770+
2771+#endif
2772
2773=== added file 'src/TimeOut-scope.h.autosave'
2774--- src/TimeOut-scope.h.autosave 1970-01-01 00:00:00 +0000
2775+++ src/TimeOut-scope.h.autosave 2014-09-24 10:37:38 +0000
2776@@ -0,0 +1,50 @@
2777+/*
2778+ * This file is part of Ubuntu TimeOut Scope.
2779+ * Copyright 2014 Canonical Ltd.
2780+ *
2781+ * TimeOut Scope is free software: you can redistribute it and/or modify it
2782+ * under the terms of the GNU General Public License as published by
2783+ * the Free Software Foundation.
2784+ *
2785+ * TimeOut Scope is distributed in the hope that it will be useful,
2786+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2787+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
2788+ * See the GNU General Public License for more details.
2789+ *
2790+ * You should have received a copy of the GNU General Public License
2791+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
2792+ */
2793+
2794+#ifndef DEMOSCOPE_H
2795+#define DEMOSCOPE_H
2796+
2797+#include "TimeOut-client.h"
2798+
2799+#include <unity/scopes/ScopeBase.h>
2800+#include <unity/scopes/QueryBase.h>
2801+#include <unity/scopes/ReplyProxyFwd.h>
2802+#include <unity/scopes/QueryBase.h>
2803+#include <unity/scopes/PreviewQueryBase.h>
2804+#include <unity/scopes/Location.h>
2805+
2806+
2807+
2808+using namespace unity::scopes;
2809+
2810+class TimeoutScope : public unity::scopes::ScopeBase
2811+{
2812+public:
2813+ virtual void start(std::string const&) override;
2814+
2815+ virtual void stop() override;
2816+
2817+ PreviewQueryBase::UPtr preview(const Result&, const ActionMetadata&) override;
2818+
2819+ virtual SearchQueryBase::UPtr search(CannedQuery const& q, SearchMetadata const&) override;
2820+
2821+private:
2822+ TimeOut timeout;
2823+
2824+};
2825+
2826+#endif
2827
2828=== added file 'src/com.canonical.scopes.timeout_timeout.ini'
2829--- src/com.canonical.scopes.timeout_timeout.ini 1970-01-01 00:00:00 +0000
2830+++ src/com.canonical.scopes.timeout_timeout.ini 2014-09-24 10:37:38 +0000
2831@@ -0,0 +1,13 @@
2832+[ScopeConfig]
2833+DisplayName = TimeOut
2834+Description = This is an Ubuntu search plugin that enables information from TimeOut to be searched and displayed in the Dash. If you do not wish to search this content source, you can disable this search plugin.
2835+Icon = icon.png
2836+Author = Canonical Ltd.
2837+SearchHint = Search TimeOut
2838+LocationDataNeeded=true
2839+[Appearance]
2840+Background = color:///#000000
2841+PageHeader.Logo = logo.png
2842+PageHeader.Background = color:///#000000
2843+PageHeader.ForegroundColor = #FFFFFF
2844+BackgroundColor = #FFFFFF
2845
2846=== added file 'src/com.canonical.scopes.timeout_timeout_automoc.cpp'
2847--- src/com.canonical.scopes.timeout_timeout_automoc.cpp 1970-01-01 00:00:00 +0000
2848+++ src/com.canonical.scopes.timeout_timeout_automoc.cpp 2014-09-24 10:37:38 +0000
2849@@ -0,0 +1,2 @@
2850+/* This file is autogenerated, do not edit*/
2851+enum some_compilers { need_more_than_nothing };
2852
2853=== added file 'src/config.h.in'
2854--- src/config.h.in 1970-01-01 00:00:00 +0000
2855+++ src/config.h.in 2014-09-24 10:37:38 +0000
2856@@ -0,0 +1,47 @@
2857+/*
2858+ * This file is part of Ubuntu TimeOut Scope.
2859+ * Copyright 2014 Canonical Ltd.
2860+ *
2861+ * TimeOut Scope is free software: you can redistribute it and/or modify it
2862+ * under the terms of the GNU General Public License as published by
2863+ * the Free Software Foundation.
2864+ *
2865+ * TimeOut Scope is distributed in the hope that it will be useful,
2866+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
2867+ * MERCHANTABILITY, SATISFACTORY QUALITY, or FITNESS FOR A PARTICULAR PURPOSE.
2868+ * See the GNU General Public License for more details.
2869+ *
2870+ * You should have received a copy of the GNU General Public License
2871+ * along with TimeOut Scope. If not, see <http://www.gnu.org/licenses/>.
2872+ */
2873+
2874+#ifndef CONFIG_H
2875+#define CONFIG_H
2876+
2877+#include <QString>
2878+
2879+/*** Please edit this section. ***/
2880+const QString HOME_URL = "http://timeout.com/";
2881+const QString MOBILE_URL = "http://m.timeout.com/";
2882+const QString SURFACING_LAYOUT = "wide-art";
2883+const QString READ_MORE = "Read more...";
2884+const QString NO_CONNECTION = "No connection.";
2885+const QString RESULTS = "Results:";
2886+const QString ERROR = "Error";
2887+
2888+// If false, your first department will become your top (root) department.
2889+//const bool BROWSE_AT_ROOT = true;
2890+//const QString BROWSE = "Browse";
2891+
2892+/*** DO NOT edit this section! ***/
2893+const QString SCOPE_TITLE = "@SCOPE_TITLE@";
2894+const QString SCOPE_PACKAGE = "@SCOPE_PACKAGE@";
2895+const QString SCOPE_NAME = "@SCOPE_NAME@";
2896+
2897+//WORK AROUND MADRID IUDs
2898+const QString MAD_SHOPPING = "tiendas";
2899+const QString MAD_BAR = "bares";
2900+const QString MAD_TTODO = "qu_hacer";
2901+const QString MAD_RESTAURANTS = "restaurantes";
2902+
2903+#endif
2904
2905=== added file 'src/timeout.ini'
2906--- src/timeout.ini 1970-01-01 00:00:00 +0000
2907+++ src/timeout.ini 2014-09-24 10:37:38 +0000
2908@@ -0,0 +1,13 @@
2909+[ScopeConfig]
2910+DisplayName = TimeOut
2911+Description = This is an Ubuntu search plugin that enables information from TimeOut to be searched and displayed in the Dash. If you do not wish to search this content source, you can disable this search plugin.
2912+Icon = icon.png
2913+Author = Canonical Ltd.
2914+SearchHint = Search TimeOut
2915+LocationDataNeeded=true
2916+[Appearance]
2917+Background = color:///#000000
2918+PageHeader.Logo = /opt/click.ubuntu.com/com.canonical.scopes.timeout/current/images/logo.png
2919+PageHeader.Background = color:///#000000
2920+PageHeader.ForegroundColor = #FFFFFF
2921+BackgroundColor = #FFFFFF
2922
2923=== added file 'src/timeout_automoc.cpp'
2924--- src/timeout_automoc.cpp 1970-01-01 00:00:00 +0000
2925+++ src/timeout_automoc.cpp 2014-09-24 10:37:38 +0000
2926@@ -0,0 +1,2 @@
2927+/* This file is autogenerated, do not edit*/
2928+enum some_compilers { need_more_than_nothing };
2929
2930=== added directory 'test'
2931=== added file 'test/CMakeLists.txt'
2932--- test/CMakeLists.txt 1970-01-01 00:00:00 +0000
2933+++ test/CMakeLists.txt 2014-09-24 10:37:38 +0000
2934@@ -0,0 +1,24 @@
2935+if (NOT DEFINED GMOCK_ROOT)
2936+ set(GMOCK_ROOT /usr/src/gmock)
2937+endif()
2938+add_subdirectory(${GMOCK_ROOT} gmock)
2939+include_directories(${GMOCK_ROOT}/gtest/include)
2940+
2941+set(gtest_libs gtest gmock gmock_main)
2942+foreach(target ${gtest_libs})
2943+ set_property(TARGET ${target} APPEND_STRING PROPERTY COMPILE_FLAGS " -Wno-missing-field-initializers -Wno-missing-declarations")
2944+endforeach()
2945+
2946+add_subdirectory(files)
2947+
2948+include_directories(${UNITY_INCLUDE_DIRS})
2949+find_package(Qt5Network REQUIRED)
2950+
2951+add_executable(test-timeout-client
2952+ test-timeout-client.cpp
2953+ ../src/TimeOut-client.cpp
2954+)
2955+
2956+qt5_use_modules(test-timeout-client Network)
2957+target_link_libraries(test-timeout-client ${UNITY_LDFLAGS} ${gtest_libs})
2958+add_test(test-timeout-client test-timeout-client)
2959
2960=== added directory 'test/files'
2961=== added file 'test/files/CMakeLists.txt'
2962--- test/files/CMakeLists.txt 1970-01-01 00:00:00 +0000
2963+++ test/files/CMakeLists.txt 2014-09-24 10:37:38 +0000
2964@@ -0,0 +1,1 @@
2965+configure_file(response-mobile.json ${CMAKE_CURRENT_BINARY_DIR}/response-mobile.json COPYONLY)
2966
2967=== added file 'test/files/response-mobile.json'
2968=== added file 'test/test-timeout-client.cpp'
2969--- test/test-timeout-client.cpp 1970-01-01 00:00:00 +0000
2970+++ test/test-timeout-client.cpp 2014-09-24 10:37:38 +0000
2971@@ -0,0 +1,16 @@
2972+#include <gmock/gmock.h>
2973+#include <gtest/gtest.h>
2974+
2975+#include <QFile>
2976+
2977+#include "../src/TimeOut-client.h"
2978+
2979+using ::testing::_;
2980+
2981+TEST(TimeOut, getCities) {
2982+}
2983+
2984+int main(int argc, char **argv) {
2985+ ::testing::InitGoogleTest(&argc, argv);
2986+ return RUN_ALL_TESTS();
2987+}
2988
2989=== added file 'timeout-scope.json'
2990--- timeout-scope.json 1970-01-01 00:00:00 +0000
2991+++ timeout-scope.json 2014-09-24 10:37:38 +0000
2992@@ -0,0 +1,6 @@
2993+{
2994+ "policy_groups": [
2995+ "networking"
2996+ ],
2997+ "policy_version": 1.1
2998+}
2999\ No newline at end of file
3000
3001=== added file 'timeout.cbp'
3002--- timeout.cbp 1970-01-01 00:00:00 +0000
3003+++ timeout.cbp 2014-09-24 10:37:38 +0000
3004@@ -0,0 +1,199 @@
3005+<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
3006+<CodeBlocks_project_file>
3007+ <FileVersion major="1" minor="6" />
3008+ <Project>
3009+ <Option title="timeout" />
3010+ <Option makefile_is_custom="1" />
3011+ <Option compiler="gcc" />
3012+ <Option virtualFolders="CMake Files\;CMake Files\src\;CMake Files\..\;CMake Files\..\..\;CMake Files\..\..\..\;CMake Files\..\..\..\..\;CMake Files\..\..\..\..\usr\;CMake Files\..\..\..\..\usr\lib\;CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\;CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\;CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Network\;CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Core\;CMake Files\data\;" />
3013+ <Build>
3014+ <Target title="all">
3015+ <Option working_dir="/home/victorp/qtworkspace/timeout" />
3016+ <Option type="4" />
3017+ <MakeCommands>
3018+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 all" />
3019+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3020+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3021+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3022+ </MakeCommands>
3023+ </Target>
3024+ <Target title="install">
3025+ <Option working_dir="/home/victorp/qtworkspace/timeout" />
3026+ <Option type="4" />
3027+ <MakeCommands>
3028+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 install" />
3029+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3030+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3031+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3032+ </MakeCommands>
3033+ </Target>
3034+ <Target title="install/local">
3035+ <Option working_dir="/home/victorp/qtworkspace/timeout" />
3036+ <Option type="4" />
3037+ <MakeCommands>
3038+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 install/local" />
3039+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3040+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3041+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3042+ </MakeCommands>
3043+ </Target>
3044+ <Target title="install/strip">
3045+ <Option working_dir="/home/victorp/qtworkspace/timeout" />
3046+ <Option type="4" />
3047+ <MakeCommands>
3048+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 install/strip" />
3049+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3050+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3051+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3052+ </MakeCommands>
3053+ </Target>
3054+ <Target title="list_install_components">
3055+ <Option working_dir="/home/victorp/qtworkspace/timeout" />
3056+ <Option type="4" />
3057+ <MakeCommands>
3058+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 list_install_components" />
3059+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3060+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3061+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3062+ </MakeCommands>
3063+ </Target>
3064+ <Target title="rebuild_cache">
3065+ <Option working_dir="/home/victorp/qtworkspace/timeout" />
3066+ <Option type="4" />
3067+ <MakeCommands>
3068+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 rebuild_cache" />
3069+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3070+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3071+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/Makefile&quot; VERBOSE=1 clean" />
3072+ </MakeCommands>
3073+ </Target>
3074+ <Target title="timeout">
3075+ <Option output="/home/victorp/qtworkspace/timeout/src/libtimeout.so" prefix_auto="0" extension_auto="0" />
3076+ <Option working_dir="/home/victorp/qtworkspace/timeout/src" />
3077+ <Option object_output="./" />
3078+ <Option type="3" />
3079+ <Option compiler="gcc" />
3080+ <Compiler>
3081+ <Add option="-DQT_NETWORK_LIB" />
3082+ <Add option="-DQT_CORE_LIB" />
3083+ <Add option="-DQT_NO_KEYWORDS" />
3084+ <Add option="-DQT_NO_DEBUG" />
3085+ <Add directory="/usr/arm-linux-gnueabihf/include/c++/4.8.2" />
3086+ <Add directory="/usr/arm-linux-gnueabihf/include/c++/4.8.2/arm-linux-gnueabihf" />
3087+ <Add directory="/usr/arm-linux-gnueabihf/include/c++/4.8.2/backward" />
3088+ <Add directory="/usr/include" />
3089+ <Add directory="/usr/include/arm-linux-gnueabihf" />
3090+ <Add directory="/usr/include/arm-linux-gnueabihf/qt5" />
3091+ <Add directory="/usr/include/arm-linux-gnueabihf/qt5/QtCore" />
3092+ <Add directory="/usr/include/arm-linux-gnueabihf/qt5/QtNetwork" />
3093+ <Add directory="/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++" />
3094+ <Add directory="/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/include" />
3095+ <Add directory="/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include" />
3096+ <Add directory="/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include-fixed" />
3097+ </Compiler>
3098+ <MakeCommands>
3099+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 timeout" />
3100+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3101+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 clean" />
3102+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 clean" />
3103+ </MakeCommands>
3104+ </Target>
3105+ <Target title="timeout/fast">
3106+ <Option output="/home/victorp/qtworkspace/timeout/src/libtimeout.so" prefix_auto="0" extension_auto="0" />
3107+ <Option working_dir="/home/victorp/qtworkspace/timeout/src" />
3108+ <Option object_output="./" />
3109+ <Option type="3" />
3110+ <Option compiler="gcc" />
3111+ <Compiler>
3112+ <Add option="-DQT_NETWORK_LIB" />
3113+ <Add option="-DQT_CORE_LIB" />
3114+ <Add option="-DQT_NO_KEYWORDS" />
3115+ <Add option="-DQT_NO_DEBUG" />
3116+ <Add directory="/usr/arm-linux-gnueabihf/include/c++/4.8.2" />
3117+ <Add directory="/usr/arm-linux-gnueabihf/include/c++/4.8.2/arm-linux-gnueabihf" />
3118+ <Add directory="/usr/arm-linux-gnueabihf/include/c++/4.8.2/backward" />
3119+ <Add directory="/usr/include" />
3120+ <Add directory="/usr/include/arm-linux-gnueabihf" />
3121+ <Add directory="/usr/include/arm-linux-gnueabihf/qt5" />
3122+ <Add directory="/usr/include/arm-linux-gnueabihf/qt5/QtCore" />
3123+ <Add directory="/usr/include/arm-linux-gnueabihf/qt5/QtNetwork" />
3124+ <Add directory="/usr/lib/arm-linux-gnueabihf/qt5/mkspecs/linux-g++" />
3125+ <Add directory="/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/../../../../arm-linux-gnueabihf/include" />
3126+ <Add directory="/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include" />
3127+ <Add directory="/usr/lib/gcc-cross/arm-linux-gnueabihf/4.8/include-fixed" />
3128+ </Compiler>
3129+ <MakeCommands>
3130+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 timeout/fast" />
3131+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3132+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 clean" />
3133+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 clean" />
3134+ </MakeCommands>
3135+ </Target>
3136+ <Target title="timeout_automoc">
3137+ <Option working_dir="/home/victorp/qtworkspace/timeout/src" />
3138+ <Option type="4" />
3139+ <MakeCommands>
3140+ <Build command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 timeout_automoc" />
3141+ <CompileFile command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 &quot;$file&quot;" />
3142+ <Clean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 clean" />
3143+ <DistClean command="/usr/bin/make -f &quot;/home/victorp/qtworkspace/timeout/src/Makefile&quot; VERBOSE=1 clean" />
3144+ </MakeCommands>
3145+ </Target>
3146+ </Build>
3147+ <Unit filename="/home/victorp/qtworkspace/timeout/src/TimeOut-client.cpp">
3148+ </Unit>
3149+ <Unit filename="/home/victorp/qtworkspace/timeout/src/TimeOut-preview.cpp">
3150+ </Unit>
3151+ <Unit filename="/home/victorp/qtworkspace/timeout/src/TimeOut-query.cpp">
3152+ </Unit>
3153+ <Unit filename="/home/victorp/qtworkspace/timeout/src/TimeOut-scope.cpp">
3154+ </Unit>
3155+ <Unit filename="/home/victorp/qtworkspace/timeout/src/TimeOut-client.h">
3156+ </Unit>
3157+ <Unit filename="/home/victorp/qtworkspace/timeout/src/TimeOut-preview.h">
3158+ </Unit>
3159+ <Unit filename="/home/victorp/qtworkspace/timeout/src/TimeOut-query.h">
3160+ </Unit>
3161+ <Unit filename="/home/victorp/qtworkspace/timeout/src/TimeOut-scope.h">
3162+ </Unit>
3163+ <Unit filename="/home/victorp/qtworkspace/timeout/CMakeLists.txt">
3164+ <Option virtualFolder="CMake Files\" />
3165+ </Unit>
3166+ <Unit filename="/home/victorp/qtworkspace/timeout/manifest.json.in">
3167+ <Option virtualFolder="CMake Files\" />
3168+ </Unit>
3169+ <Unit filename="/home/victorp/qtworkspace/timeout/src/CMakeLists.txt">
3170+ <Option virtualFolder="CMake Files\src\" />
3171+ </Unit>
3172+ <Unit filename="/home/victorp/qtworkspace/timeout/src/config.h.in">
3173+ <Option virtualFolder="CMake Files\src\" />
3174+ </Unit>
3175+ <Unit filename="/home/victorp/qtworkspace/timeout/../../../../usr/lib/arm-linux-gnueabihf/cmake/Qt5Network/Qt5NetworkConfigVersion.cmake">
3176+ <Option virtualFolder="CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Network\" />
3177+ </Unit>
3178+ <Unit filename="/home/victorp/qtworkspace/timeout/../../../../usr/lib/arm-linux-gnueabihf/cmake/Qt5Network/Qt5NetworkConfig.cmake">
3179+ <Option virtualFolder="CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Network\" />
3180+ </Unit>
3181+ <Unit filename="/home/victorp/qtworkspace/timeout/../../../../usr/lib/arm-linux-gnueabihf/cmake/Qt5Core/Qt5CoreConfigVersion.cmake">
3182+ <Option virtualFolder="CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Core\" />
3183+ </Unit>
3184+ <Unit filename="/home/victorp/qtworkspace/timeout/../../../../usr/lib/arm-linux-gnueabihf/cmake/Qt5Core/Qt5CoreConfig.cmake">
3185+ <Option virtualFolder="CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Core\" />
3186+ </Unit>
3187+ <Unit filename="/home/victorp/qtworkspace/timeout/../../../../usr/lib/arm-linux-gnueabihf/cmake/Qt5Core/Qt5CoreConfigExtras.cmake">
3188+ <Option virtualFolder="CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Core\" />
3189+ </Unit>
3190+ <Unit filename="/home/victorp/qtworkspace/timeout/../../../../usr/lib/arm-linux-gnueabihf/cmake/Qt5Core/Qt5CoreConfigExtrasMkspecDir.cmake">
3191+ <Option virtualFolder="CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Core\" />
3192+ </Unit>
3193+ <Unit filename="/home/victorp/qtworkspace/timeout/../../../../usr/lib/arm-linux-gnueabihf/cmake/Qt5Core/Qt5CoreMacros.cmake">
3194+ <Option virtualFolder="CMake Files\..\..\..\..\usr\lib\arm-linux-gnueabihf\cmake\Qt5Core\" />
3195+ </Unit>
3196+ <Unit filename="/home/victorp/qtworkspace/timeout/data/CMakeLists.txt">
3197+ <Option virtualFolder="CMake Files\data\" />
3198+ </Unit>
3199+ <Unit filename="/home/victorp/qtworkspace/timeout/data/timeout.ini.in">
3200+ <Option virtualFolder="CMake Files\data\" />
3201+ </Unit>
3202+ </Project>
3203+</CodeBlocks_project_file>
3204
3205=== added file 'timeout.json'
3206--- timeout.json 1970-01-01 00:00:00 +0000
3207+++ timeout.json 2014-09-24 10:37:38 +0000
3208@@ -0,0 +1,6 @@
3209+{
3210+ "policy_groups": [
3211+ "networking"
3212+ ],
3213+ "policy_version": 1.1
3214+}
3215\ No newline at end of file

Subscribers

People subscribed via source and target branches