Merge lp:~mvo/unity-scope-click/libclick into lp:unity-scope-click/devel

Proposed by Michael Vogt
Status: Work in progress
Proposed branch: lp:~mvo/unity-scope-click/libclick
Merge into: lp:unity-scope-click/devel
Diff against target: 197 lines (+50/-49) (has conflicts)
7 files modified
debian/changelog (+15/-0)
debian/control (+1/-0)
debian/tests/control (+1/-0)
scope/click/CMakeLists.txt (+13/-0)
scope/click/configuration.cpp (+16/-2)
scope/click/configuration.h (+0/-3)
scope/tests/test_configuration.cpp (+4/-44)
Text conflict in scope/click/CMakeLists.txt
To merge this branch: bzr merge lp:~mvo/unity-scope-click/libclick
Reviewer Review Type Date Requested Status
Unity Team Pending
Review via email: mp+220003@code.launchpad.net

Description of the change

This branch adds libclick as a build/runtime dependency to unity-scope-click. For now it only uses it to get the installed frameworks. But eventually we can use it to e.g. get the list of installed click apps (bug #1292645).

Thanks,
 Michael

To post a comment you must log in.

Unmerged revisions

223. By Michael Vogt

use libclick instead of using list_folder() to get available frameworks

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-05-06 17:24:10 +0000
3+++ debian/changelog 2014-05-19 09:27:46 +0000
4@@ -1,3 +1,18 @@
5+unity-scope-click (0.1+14.10.20140508.1-0ubuntu1) utopic; urgency=low
6+
7+ [ Ubuntu daily release ]
8+ * New rebuild forced
9+
10+ [ Rodney Dawes ]
11+ * Support for translations of installed apps. (LP: #1237992) Fix
12+ translations not being installed. (LP: #1316802) Fix merge of
13+ translations to clickscope.ini. (LP: #1316778) Strip full path from
14+ translations and template. (LP: #1316777) Enable submission of
15+ reviews from the installed preview. (LP: #1237992, #1316777,
16+ #1316802, #1316778)
17+
18+ -- Ubuntu daily release <ps-jenkins@lists.canonical.com> Thu, 08 May 2014 18:24:59 +0000
19+
20 unity-scope-click (0.1+14.10.20140506-0ubuntu1) utopic; urgency=low
21
22 [ Alejandro J. Cura ]
23
24=== modified file 'debian/control'
25--- debian/control 2014-05-16 13:09:36 +0000
26+++ debian/control 2014-05-19 09:27:46 +0000
27@@ -6,6 +6,7 @@
28 dh-translations,
29 google-mock,
30 intltool,
31+ libclick-0.4-dev,
32 libglib2.0-dev (>= 2.32),
33 libjsoncpp-dev,
34 libubuntu-download-manager-client-dev (>= 0.3+14.10.20140430-0ubuntu1),
35
36=== modified file 'debian/tests/control'
37--- debian/tests/control 2013-12-17 17:56:49 +0000
38+++ debian/tests/control 2014-05-19 09:27:46 +0000
39@@ -5,6 +5,7 @@
40 dh-autoreconf,
41 gnome-common,
42 libaccounts-glib-dev,
43+ libclick-0.4-dev,
44 libdee-dev (>= 1.2.5),
45 libgee-dev,
46 libglib2.0-dev (>= 2.32),
47
48=== modified file 'scope/click/CMakeLists.txt'
49--- scope/click/CMakeLists.txt 2014-05-13 19:32:29 +0000
50+++ scope/click/CMakeLists.txt 2014-05-19 09:27:46 +0000
51@@ -2,6 +2,7 @@
52 SET (CMAKE_AUTOMOC ON)
53 find_package (Qt5Core REQUIRED)
54 pkg_check_modules(JSON_CPP REQUIRED jsoncpp)
55+pkg_check_modules(CLICK REQUIRED click-0.4)
56
57 add_definitions(
58 -DGETTEXT_PACKAGE=\"${PROJECT_NAME}\"
59@@ -28,15 +29,27 @@
60 )
61
62 include_directories(
63+<<<<<<< TREE
64 ${CMAKE_SOURCE_DIR}/libclickscope
65 ${JSON_CPP_INCLUDE_DIRS}
66 )
67+=======
68+ ${CLICK_INCLUDE_DIRS}
69+ ${JSON_CPP_INCLUDE_DIRS}
70+ ${LIBURL_DISPATCHER_INCLUDE_DIRS})
71+
72+link_directories(${LIBURL_DISPATCHER_LIBRARY_DIRS})
73+>>>>>>> MERGE-SOURCE
74
75 qt5_use_modules (${SCOPE_LIB_UNVERSIONED} Network)
76
77 target_link_libraries (${SCOPE_LIB_UNVERSIONED}
78+<<<<<<< TREE
79 -L${CMAKE_BINARY_DIR}/libclickscope
80 ${SCOPE_LIB_NAME}
81+=======
82+ ${CLICK_LDFLAGS}
83+>>>>>>> MERGE-SOURCE
84 ${JSON_CPP_LDFLAGS}
85 ${UNITY_SCOPES_LDFLAGS}
86 ${UBUNTUONE_LDFLAGS}
87
88=== modified file 'scope/click/configuration.cpp'
89--- scope/click/configuration.cpp 2014-05-01 21:04:23 +0000
90+++ scope/click/configuration.cpp 2014-05-19 09:27:46 +0000
91@@ -27,6 +27,10 @@
92 * files in the program, then also delete it here.
93 */
94
95+#include <glib-2.0/glib.h>
96+#include <click-0.4/click.h>
97+
98+
99 #include <string>
100 #include <vector>
101
102@@ -57,10 +61,20 @@
103
104 std::vector<std::string> Configuration::get_available_frameworks()
105 {
106+ GList *l = nullptr;
107+ GList *frameworks = l = click_framework_get_frameworks();
108+
109 std::vector<std::string> result;
110- for (auto f: list_folder(FRAMEWORKS_FOLDER, FRAMEWORKS_PATTERN)) {
111- result.push_back(f.substr(0, f.size()-FRAMEWORKS_EXTENSION_LENGTH));
112+ while (l != nullptr) {
113+ gchar *framework_name = nullptr;
114+ GObject *framework = (GObject *)l->data;
115+ g_object_get(framework, "name", &framework_name, nullptr);
116+ result.push_back(framework_name);
117+ l = g_list_next(l);
118+ g_free(framework_name);
119 }
120+ g_list_free_full(frameworks, g_object_unref);
121+
122 return result;
123 }
124
125
126=== modified file 'scope/click/configuration.h'
127--- scope/click/configuration.h 2014-05-01 21:04:23 +0000
128+++ scope/click/configuration.h 2014-05-19 09:27:46 +0000
129@@ -39,9 +39,6 @@
130 class Configuration
131 {
132 public:
133- constexpr static const char* FRAMEWORKS_FOLDER {"/usr/share/click/frameworks/"};
134- constexpr static const char* FRAMEWORKS_PATTERN {"*.framework"};
135- constexpr static const int FRAMEWORKS_EXTENSION_LENGTH = 10; // strlen(".framework")
136 constexpr static const char* LANGUAGE_ENVVAR {"LANGUAGE"};
137
138 virtual std::vector<std::string> get_available_frameworks();
139
140=== modified file 'scope/tests/test_configuration.cpp'
141--- scope/tests/test_configuration.cpp 2014-05-01 21:04:23 +0000
142+++ scope/tests/test_configuration.cpp 2014-05-19 09:27:46 +0000
143@@ -46,50 +46,10 @@
144
145 }
146
147-
148-TEST(Configuration, getAvailableFrameworksUsesRightFolder)
149-{
150- using namespace ::testing;
151- FakeConfiguration locator;
152- EXPECT_CALL(locator, list_folder(Configuration::FRAMEWORKS_FOLDER, _))
153- .Times(1).WillOnce(Return(std::vector<std::string>()));
154- locator.get_available_frameworks();
155-}
156-
157-TEST(Configuration, getAvailableFrameworksUsesRightPattern)
158-{
159- using namespace ::testing;
160- FakeConfiguration locator;
161- EXPECT_CALL(locator, list_folder(_, Configuration::FRAMEWORKS_PATTERN))
162- .Times(1).WillOnce(Return(std::vector<std::string>()));
163- locator.get_available_frameworks();
164-}
165-
166-TEST(Configuration, getAvailableFrameworksTwoResults)
167-{
168- using namespace ::testing;
169-
170- FakeConfiguration locator;
171- std::vector<std::string> response = {"abc.framework", "def.framework"};
172- EXPECT_CALL(locator, list_folder(_, _))
173- .Times(1)
174- .WillOnce(Return(response));
175- auto frameworks = locator.get_available_frameworks();
176- std::vector<std::string> expected = {"abc", "def"};
177- EXPECT_EQ(expected, frameworks);
178-}
179-
180-TEST(Configuration, getAvailableFrameworksNoResults)
181-{
182- using namespace ::testing;
183-
184- FakeConfiguration locator;
185- std::vector<std::string> response = {};
186- EXPECT_CALL(locator, list_folder(_, _))
187- .Times(1)
188- .WillOnce(Return(response));
189- auto frameworks = locator.get_available_frameworks();
190- EXPECT_EQ(0, frameworks.size());
191+TEST(Configuration, getAvailableFrameworksSmokeTest)
192+{
193+ FakeConfiguration locator;
194+ std::vector<std::string> frameworks = locator.get_available_frameworks();
195 }
196
197 TEST(Configuration, getLanguageCorrect)

Subscribers

People subscribed via source and target branches

to all changes: