Merge lp:~renatofilho/indicator-transfer/source-clear-fix into lp:indicator-transfer/15.10
- source-clear-fix
- Merge into trunk.15.10
Status: | Merged |
---|---|
Approved by: | Charles Kerr |
Approved revision: | 57 |
Merged at revision: | 34 |
Proposed branch: | lp:~renatofilho/indicator-transfer/source-clear-fix |
Merge into: | lp:indicator-transfer/15.10 |
Prerequisite: | lp:~charlesk/indicator-transfer/add-plugins |
Diff against target: |
1004 lines (+198/-123) 21 files modified
CMakeLists.txt (+1/-1) data/indicator-transfer.pc.in (+3/-0) debian/changelog (+6/-0) include/transfer/controller.h (+9/-3) include/transfer/dm-source.h (+2/-1) include/transfer/model.h (+2/-0) include/transfer/multisource.h (+3/-2) include/transfer/source.h (+2/-1) include/transfer/view-gmenu.h (+3/-4) src/controller.cpp (+43/-14) src/dm-plugin/dm-source.cpp (+23/-13) src/main.cpp (+2/-3) src/model.cpp (+10/-0) src/multisource.cpp (+13/-1) src/view-gmenu.cpp (+16/-24) tests/controller-mock.h (+2/-3) tests/source-mock.h (+9/-2) tests/test-controller.cpp (+22/-18) tests/test-multisource.cpp (+8/-8) tests/test-plugin-source.cpp (+1/-4) tests/test-view-gmenu.cpp (+18/-21) |
To merge this branch: | bzr merge lp:~renatofilho/indicator-transfer/source-clear-fix |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Charles Kerr (community) | Approve | ||
PS Jenkins bot (community) | continuous-integration | Approve | |
Review via email: mp+267690@code.launchpad.net |
Commit message
Added 'clear' function into the Source interface.
Call 'Source.clear' in the 'Controller.
Does not keep a separated copy of source model inside of the Controller class.
Changed the return of 'Source.
Update unit tests.
Description of the change
PS Jenkins bot (ps-jenkins) wrote : | # |
- 54. By Renato Araujo Oliveira Filho
-
Fix warnings from cppcheck test.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:54
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
- 55. By Renato Araujo Oliveira Filho
-
[DM-Plugin] Add download on removed list only if it was removed by 'clear' function.
- 56. By Renato Araujo Oliveira Filho
-
Avoid pass a model to GMenuView. Instead use the controller model.
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:56
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
- 57. By Renato Araujo Oliveira Filho
-
Fixed cppcheck errors.
PS Jenkins bot (ps-jenkins) wrote : | # |
PASSED: Continuous integration, rev:57
http://
Executed test runs:
SUCCESS: http://
SUCCESS: http://
deb: http://
Click here to trigger a rebuild:
http://
Charles Kerr (charlesk) wrote : | # |
Looks great.
Also, the "explicit" warning in cppcheck always bites me too ;)
Renato Araujo Oliveira Filho (renatofilho) wrote : | # |
Are there any related MPs required for this MP to build/function as expected?
YES: lp:~charlesk/indicator-transfer/add-plugins
Is your branch in sync with latest trunk?
YES
Did you perform an exploratory manual test run of your code change and any related functionality on device or emulator?
YES
Did you successfully run all tests found in your component's Test Plan on device or emulator?
YES
If you changed the UI, was the change specified/approved by design?
NO UI CHANGED
If you changed UI labels, did you update the pot file?
NO LABEL CHANGED
If you changed the packaging (debian), did you add a core-dev as a reviewer to this MP?
NO PACKAGE CHANGED
- 58. By Renato Araujo Oliveira Filho
-
Parent branch merged.
- 59. By Renato Araujo Oliveira Filho
-
Added "Requires" packages into .pc file.
- 60. By Renato Araujo Oliveira Filho
-
Update version to 0.2
- 61. By Renato Araujo Oliveira Filho
-
Added 'plugindir' variable into .pc file.
Preview Diff
1 | === modified file 'CMakeLists.txt' | |||
2 | --- CMakeLists.txt 2015-08-19 18:01:58 +0000 | |||
3 | +++ CMakeLists.txt 2015-08-19 18:01:58 +0000 | |||
4 | @@ -30,7 +30,7 @@ | |||
5 | 30 | 30 | ||
6 | 31 | set(INDICATOR_TRANSFER_VERSION_MAJOR 0) | 31 | set(INDICATOR_TRANSFER_VERSION_MAJOR 0) |
7 | 32 | set(INDICATOR_TRANSFER_VERSION_MINOR 0) | 32 | set(INDICATOR_TRANSFER_VERSION_MINOR 0) |
9 | 33 | set(INDICATOR_TRANSFER_VERSION_PATCH 1) | 33 | set(INDICATOR_TRANSFER_VERSION_PATCH 2) |
10 | 34 | set(INDICATOR_TRANSFER_VERSION "${INDICATOR_TRANSFER_VERSION_MAJOR}.${INDICATOR_TRANSFER_VERSION_MINOR}.${INDICATOR_TRANSFER_VERSION_PATCH}") | 34 | set(INDICATOR_TRANSFER_VERSION "${INDICATOR_TRANSFER_VERSION_MAJOR}.${INDICATOR_TRANSFER_VERSION_MINOR}.${INDICATOR_TRANSFER_VERSION_PATCH}") |
11 | 35 | 35 | ||
12 | 36 | ## | 36 | ## |
13 | 37 | 37 | ||
14 | === modified file 'data/indicator-transfer.pc.in' | |||
15 | --- data/indicator-transfer.pc.in 2015-08-19 18:01:58 +0000 | |||
16 | +++ data/indicator-transfer.pc.in 2015-08-19 18:01:58 +0000 | |||
17 | @@ -1,8 +1,11 @@ | |||
18 | 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ | 1 | libdir=@CMAKE_INSTALL_FULL_LIBDIR@ |
19 | 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/@CMAKE_PROJECT_NAME@ | 2 | includedir=@CMAKE_INSTALL_FULL_INCLUDEDIR@/@CMAKE_PROJECT_NAME@ |
20 | 3 | plugindir=@CMAKE_INSTALL_FULL_PKGLIBEXECDIR@ | ||
21 | 3 | 4 | ||
22 | 4 | Name: @CMAKE_PROJECT_NAME@ | 5 | Name: @CMAKE_PROJECT_NAME@ |
23 | 5 | Description: Developer files for @CMAKE_PROJECT_NAME@ | 6 | Description: Developer files for @CMAKE_PROJECT_NAME@ |
24 | 6 | Version: @INDICATOR_TRANSFER_VERSION@ | 7 | Version: @INDICATOR_TRANSFER_VERSION@ |
25 | 7 | Libs: -L${libdir} -lindicator-transfer | 8 | Libs: -L${libdir} -lindicator-transfer |
26 | 8 | Cflags: -I${includedir} | 9 | Cflags: -I${includedir} |
27 | 10 | Requires: properties-cpp, gmodule-2.0 | ||
28 | 11 | |||
29 | 9 | 12 | ||
30 | === modified file 'debian/changelog' | |||
31 | --- debian/changelog 2015-08-13 14:15:58 +0000 | |||
32 | +++ debian/changelog 2015-08-19 18:01:58 +0000 | |||
33 | @@ -1,3 +1,9 @@ | |||
34 | 1 | indicator-transfer (0.2-0buntu1) UNRELEASED; urgency=medium | ||
35 | 2 | |||
36 | 3 | * Update version to 0.2 | ||
37 | 4 | |||
38 | 5 | -- Renato Araujo Oliveira Filho <renato.filho@canonical.com> Wed, 19 Aug 2015 14:52:32 -0300 | ||
39 | 6 | |||
40 | 1 | indicator-transfer (0.1+15.10.20150727-0ubuntu2~gcc5.1) wily; urgency=medium | 7 | indicator-transfer (0.1+15.10.20150727-0ubuntu2~gcc5.1) wily; urgency=medium |
41 | 2 | 8 | ||
42 | 3 | * No change rebuild using GCC 5. | 9 | * No change rebuild using GCC 5. |
43 | 4 | 10 | ||
44 | === modified file 'include/transfer/controller.h' | |||
45 | --- include/transfer/controller.h 2015-08-19 18:01:58 +0000 | |||
46 | +++ include/transfer/controller.h 2015-08-19 18:01:58 +0000 | |||
47 | @@ -36,8 +36,7 @@ | |||
48 | 36 | class Controller | 36 | class Controller |
49 | 37 | { | 37 | { |
50 | 38 | public: | 38 | public: |
53 | 39 | Controller(const std::shared_ptr<MutableModel>& model, | 39 | explicit Controller(const std::shared_ptr<Source>& source); |
52 | 40 | const std::shared_ptr<Source>& source); | ||
54 | 41 | virtual ~Controller(); | 40 | virtual ~Controller(); |
55 | 42 | 41 | ||
56 | 43 | virtual void pause_all(); | 42 | virtual void pause_all(); |
57 | @@ -48,12 +47,19 @@ | |||
58 | 48 | virtual void pause(const Transfer::Id&); | 47 | virtual void pause(const Transfer::Id&); |
59 | 49 | virtual void cancel(const Transfer::Id&); | 48 | virtual void cancel(const Transfer::Id&); |
60 | 50 | virtual void resume(const Transfer::Id&); | 49 | virtual void resume(const Transfer::Id&); |
61 | 50 | virtual void clear(const Transfer::Id&); | ||
62 | 51 | virtual void open(const Transfer::Id&); | 51 | virtual void open(const Transfer::Id&); |
63 | 52 | virtual void open_app(const Transfer::Id&); | 52 | virtual void open_app(const Transfer::Id&); |
64 | 53 | 53 | ||
65 | 54 | int size() const; | ||
66 | 55 | int count(const Transfer::Id&) const; | ||
67 | 56 | const std::shared_ptr<const MutableModel> get_model(); | ||
68 | 57 | |||
69 | 54 | private: | 58 | private: |
70 | 55 | std::shared_ptr<MutableModel> m_model; | ||
71 | 56 | std::shared_ptr<Source> m_source; | 59 | std::shared_ptr<Source> m_source; |
72 | 60 | |||
73 | 61 | std::set<Transfer::Id> get_ids() const; | ||
74 | 62 | std::shared_ptr<Transfer> get(const Transfer::Id& id) const; | ||
75 | 57 | }; | 63 | }; |
76 | 58 | 64 | ||
77 | 59 | } // namespace transfer | 65 | } // namespace transfer |
78 | 60 | 66 | ||
79 | === modified file 'include/transfer/dm-source.h' | |||
80 | --- include/transfer/dm-source.h 2015-08-19 18:01:58 +0000 | |||
81 | +++ include/transfer/dm-source.h 2015-08-19 18:01:58 +0000 | |||
82 | @@ -44,8 +44,9 @@ | |||
83 | 44 | void pause(const Transfer::Id& id) override; | 44 | void pause(const Transfer::Id& id) override; |
84 | 45 | void resume(const Transfer::Id& id) override; | 45 | void resume(const Transfer::Id& id) override; |
85 | 46 | void cancel(const Transfer::Id& id) override; | 46 | void cancel(const Transfer::Id& id) override; |
86 | 47 | void clear(const Transfer::Id& id) override; | ||
87 | 47 | void open_app(const Transfer::Id& id) override; | 48 | void open_app(const Transfer::Id& id) override; |
89 | 48 | std::shared_ptr<MutableModel> get_model() override; | 49 | const std::shared_ptr<const MutableModel> get_model() override; |
90 | 49 | 50 | ||
91 | 50 | private: | 51 | private: |
92 | 51 | class Impl; | 52 | class Impl; |
93 | 52 | 53 | ||
94 | === modified file 'include/transfer/model.h' | |||
95 | --- include/transfer/model.h 2014-06-17 01:36:16 +0000 | |||
96 | +++ include/transfer/model.h 2015-08-19 18:01:58 +0000 | |||
97 | @@ -42,6 +42,8 @@ | |||
98 | 42 | std::set<Transfer::Id> get_ids() const; | 42 | std::set<Transfer::Id> get_ids() const; |
99 | 43 | std::vector<std::shared_ptr<Transfer>> get_all() const; | 43 | std::vector<std::shared_ptr<Transfer>> get_all() const; |
100 | 44 | std::shared_ptr<Transfer> get(const Transfer::Id&) const; | 44 | std::shared_ptr<Transfer> get(const Transfer::Id&) const; |
101 | 45 | int size() const; | ||
102 | 46 | int count(const Transfer::Id&) const; | ||
103 | 45 | 47 | ||
104 | 46 | const core::Signal<Transfer::Id>& changed() const; | 48 | const core::Signal<Transfer::Id>& changed() const; |
105 | 47 | const core::Signal<Transfer::Id>& added() const; | 49 | const core::Signal<Transfer::Id>& added() const; |
106 | 48 | 50 | ||
107 | === modified file 'include/transfer/multisource.h' | |||
108 | --- include/transfer/multisource.h 2015-08-19 18:01:58 +0000 | |||
109 | +++ include/transfer/multisource.h 2015-08-19 18:01:58 +0000 | |||
110 | @@ -35,14 +35,15 @@ | |||
111 | 35 | MultiSource(); | 35 | MultiSource(); |
112 | 36 | virtual ~MultiSource(); | 36 | virtual ~MultiSource(); |
113 | 37 | 37 | ||
115 | 38 | // Source | 38 | // Source |
116 | 39 | void open(const Transfer::Id& id) override; | 39 | void open(const Transfer::Id& id) override; |
117 | 40 | void start(const Transfer::Id& id) override; | 40 | void start(const Transfer::Id& id) override; |
118 | 41 | void pause(const Transfer::Id& id) override; | 41 | void pause(const Transfer::Id& id) override; |
119 | 42 | void resume(const Transfer::Id& id) override; | 42 | void resume(const Transfer::Id& id) override; |
120 | 43 | void cancel(const Transfer::Id& id) override; | 43 | void cancel(const Transfer::Id& id) override; |
121 | 44 | void clear(const Transfer::Id& id) override; | ||
122 | 44 | void open_app(const Transfer::Id& id) override; | 45 | void open_app(const Transfer::Id& id) override; |
124 | 45 | std::shared_ptr<MutableModel> get_model() override; | 46 | const std::shared_ptr<const MutableModel> get_model() override; |
125 | 46 | 47 | ||
126 | 47 | void add_source(const std::shared_ptr<Source>& source); | 48 | void add_source(const std::shared_ptr<Source>& source); |
127 | 48 | 49 | ||
128 | 49 | 50 | ||
129 | === modified file 'include/transfer/source.h' | |||
130 | --- include/transfer/source.h 2015-08-19 18:01:58 +0000 | |||
131 | +++ include/transfer/source.h 2015-08-19 18:01:58 +0000 | |||
132 | @@ -50,9 +50,10 @@ | |||
133 | 50 | virtual void pause(const Transfer::Id& id) =0; | 50 | virtual void pause(const Transfer::Id& id) =0; |
134 | 51 | virtual void resume(const Transfer::Id& id) =0; | 51 | virtual void resume(const Transfer::Id& id) =0; |
135 | 52 | virtual void cancel(const Transfer::Id& id) =0; | 52 | virtual void cancel(const Transfer::Id& id) =0; |
136 | 53 | virtual void clear(const Transfer::Id& id) =0; | ||
137 | 53 | virtual void open_app(const Transfer::Id& id) =0; | 54 | virtual void open_app(const Transfer::Id& id) =0; |
138 | 54 | 55 | ||
140 | 55 | virtual std::shared_ptr<MutableModel> get_model() =0; | 56 | virtual const std::shared_ptr<const MutableModel> get_model() =0; |
141 | 56 | }; | 57 | }; |
142 | 57 | 58 | ||
143 | 58 | } // namespace transfer | 59 | } // namespace transfer |
144 | 59 | 60 | ||
145 | === modified file 'include/transfer/view-gmenu.h' | |||
146 | --- include/transfer/view-gmenu.h 2014-06-17 01:36:16 +0000 | |||
147 | +++ include/transfer/view-gmenu.h 2015-08-19 18:01:58 +0000 | |||
148 | @@ -32,16 +32,15 @@ | |||
149 | 32 | class GMenuView | 32 | class GMenuView |
150 | 33 | { | 33 | { |
151 | 34 | public: | 34 | public: |
154 | 35 | GMenuView(const std::shared_ptr<Model>& model, | 35 | explicit GMenuView(const std::shared_ptr<Controller>& controller); |
153 | 36 | const std::shared_ptr<Controller>& controller); | ||
155 | 37 | ~GMenuView(); | 36 | ~GMenuView(); |
156 | 38 | void set_controller(const std::shared_ptr<Controller>&); | ||
157 | 39 | void set_model(const std::shared_ptr<Model>&); | ||
158 | 40 | const core::Signal<>& name_lost() const; | 37 | const core::Signal<>& name_lost() const; |
159 | 41 | 38 | ||
160 | 42 | private: | 39 | private: |
161 | 43 | class Impl; | 40 | class Impl; |
162 | 44 | std::unique_ptr<Impl> p; | 41 | std::unique_ptr<Impl> p; |
163 | 42 | |||
164 | 43 | void set_model(const std::shared_ptr<Model>&); | ||
165 | 45 | }; | 44 | }; |
166 | 46 | 45 | ||
167 | 47 | } // namespace transfer | 46 | } // namespace transfer |
168 | 48 | 47 | ||
169 | === modified file 'src/controller.cpp' | |||
170 | --- src/controller.cpp 2015-08-19 18:01:58 +0000 | |||
171 | +++ src/controller.cpp 2015-08-19 18:01:58 +0000 | |||
172 | @@ -27,9 +27,7 @@ | |||
173 | 27 | **** | 27 | **** |
174 | 28 | ***/ | 28 | ***/ |
175 | 29 | 29 | ||
179 | 30 | Controller::Controller(const std::shared_ptr<MutableModel>& model, | 30 | Controller::Controller(const std::shared_ptr<Source>& source): |
177 | 31 | const std::shared_ptr<Source>& source): | ||
178 | 32 | m_model(model), | ||
180 | 33 | m_source(source) | 31 | m_source(source) |
181 | 34 | { | 32 | { |
182 | 35 | } | 33 | } |
183 | @@ -40,26 +38,25 @@ | |||
184 | 40 | 38 | ||
185 | 41 | void Controller::pause_all() | 39 | void Controller::pause_all() |
186 | 42 | { | 40 | { |
188 | 43 | for(const auto& id : m_model->get_ids()) | 41 | for(const auto& id : get_ids()) |
189 | 44 | pause(id); | 42 | pause(id); |
190 | 45 | } | 43 | } |
191 | 46 | 44 | ||
192 | 47 | void Controller::resume_all() | 45 | void Controller::resume_all() |
193 | 48 | { | 46 | { |
195 | 49 | for(const auto& id : m_model->get_ids()) | 47 | for(const auto& id : get_ids()) |
196 | 50 | resume(id); | 48 | resume(id); |
197 | 51 | } | 49 | } |
198 | 52 | 50 | ||
199 | 53 | void Controller::clear_all() | 51 | void Controller::clear_all() |
200 | 54 | { | 52 | { |
204 | 55 | for (const auto& transfer : m_model->get_all()) | 53 | for (const auto& id : get_ids()) |
205 | 56 | if (transfer->can_clear()) | 54 | clear(id); |
203 | 57 | m_model->remove(transfer->id); | ||
206 | 58 | } | 55 | } |
207 | 59 | 56 | ||
208 | 60 | void Controller::tap(const Transfer::Id& id) | 57 | void Controller::tap(const Transfer::Id& id) |
209 | 61 | { | 58 | { |
211 | 62 | const auto transfer = m_model->get(id); | 59 | const auto transfer = get(id); |
212 | 63 | g_return_if_fail (transfer); | 60 | g_return_if_fail (transfer); |
213 | 64 | 61 | ||
214 | 65 | if (transfer->can_start()) | 62 | if (transfer->can_start()) |
215 | @@ -75,28 +72,35 @@ | |||
216 | 75 | 72 | ||
217 | 76 | void Controller::pause(const Transfer::Id& id) | 73 | void Controller::pause(const Transfer::Id& id) |
218 | 77 | { | 74 | { |
220 | 78 | const auto& transfer = m_model->get(id); | 75 | const auto& transfer = get(id); |
221 | 79 | if (transfer && transfer->can_pause()) | 76 | if (transfer && transfer->can_pause()) |
222 | 80 | m_source->pause(id); | 77 | m_source->pause(id); |
223 | 81 | } | 78 | } |
224 | 82 | 79 | ||
225 | 83 | void Controller::cancel(const Transfer::Id& id) | 80 | void Controller::cancel(const Transfer::Id& id) |
226 | 84 | { | 81 | { |
228 | 85 | const auto& transfer = m_model->get(id); | 82 | const auto& transfer = get(id); |
229 | 86 | if (transfer && transfer->can_cancel()) | 83 | if (transfer && transfer->can_cancel()) |
230 | 87 | m_source->cancel(id); | 84 | m_source->cancel(id); |
231 | 88 | } | 85 | } |
232 | 89 | 86 | ||
233 | 87 | void Controller::clear(const Transfer::Id& id) | ||
234 | 88 | { | ||
235 | 89 | const auto& transfer = get(id); | ||
236 | 90 | if (transfer && transfer->can_clear()) | ||
237 | 91 | m_source->clear(id); | ||
238 | 92 | } | ||
239 | 93 | |||
240 | 90 | void Controller::resume(const Transfer::Id& id) | 94 | void Controller::resume(const Transfer::Id& id) |
241 | 91 | { | 95 | { |
243 | 92 | const auto& transfer = m_model->get(id); | 96 | const auto& transfer = get(id); |
244 | 93 | if (transfer && transfer->can_resume()) | 97 | if (transfer && transfer->can_resume()) |
245 | 94 | m_source->resume(id); | 98 | m_source->resume(id); |
246 | 95 | } | 99 | } |
247 | 96 | 100 | ||
248 | 97 | void Controller::start(const Transfer::Id& id) | 101 | void Controller::start(const Transfer::Id& id) |
249 | 98 | { | 102 | { |
251 | 99 | const auto& transfer = m_model->get(id); | 103 | const auto& transfer = get(id); |
252 | 100 | if (transfer && transfer->can_start()) | 104 | if (transfer && transfer->can_start()) |
253 | 101 | m_source->start(id); | 105 | m_source->start(id); |
254 | 102 | } | 106 | } |
255 | @@ -108,7 +112,32 @@ | |||
256 | 108 | 112 | ||
257 | 109 | void Controller::open_app(const Transfer::Id& id) | 113 | void Controller::open_app(const Transfer::Id& id) |
258 | 110 | { | 114 | { |
260 | 111 | m_source->open_app(id); | 115 | m_source->open_app(id); |
261 | 116 | } | ||
262 | 117 | |||
263 | 118 | int Controller::size() const | ||
264 | 119 | { | ||
265 | 120 | return m_source->get_model()->size(); | ||
266 | 121 | } | ||
267 | 122 | |||
268 | 123 | int Controller::count(const Transfer::Id& id) const | ||
269 | 124 | { | ||
270 | 125 | return m_source->get_model()->count(id); | ||
271 | 126 | } | ||
272 | 127 | |||
273 | 128 | const std::shared_ptr<const MutableModel> Controller::get_model() | ||
274 | 129 | { | ||
275 | 130 | return m_source->get_model(); | ||
276 | 131 | } | ||
277 | 132 | |||
278 | 133 | std::set<Transfer::Id> Controller::get_ids() const | ||
279 | 134 | { | ||
280 | 135 | return m_source->get_model()->get_ids(); | ||
281 | 136 | } | ||
282 | 137 | |||
283 | 138 | std::shared_ptr<Transfer> Controller::get(const Transfer::Id& id) const | ||
284 | 139 | { | ||
285 | 140 | return m_source->get_model()->get(id); | ||
286 | 112 | } | 141 | } |
287 | 113 | 142 | ||
288 | 114 | /*** | 143 | /*** |
289 | 115 | 144 | ||
290 | === modified file 'src/dm-plugin/dm-source.cpp' | |||
291 | --- src/dm-plugin/dm-source.cpp 2015-08-19 18:01:58 +0000 | |||
292 | +++ src/dm-plugin/dm-source.cpp 2015-08-19 18:01:58 +0000 | |||
293 | @@ -43,7 +43,7 @@ | |||
294 | 43 | 43 | ||
295 | 44 | /** | 44 | /** |
296 | 45 | * A Transfer whose state comes from content-hub and ubuntu-download-manager. | 45 | * A Transfer whose state comes from content-hub and ubuntu-download-manager. |
298 | 46 | * | 46 | * |
299 | 47 | * Each DMTransfer tracks a com.canonical.applications.Download (ccad) object | 47 | * Each DMTransfer tracks a com.canonical.applications.Download (ccad) object |
300 | 48 | * from ubuntu-download-manager. The ccad is used for pause/resume/cancel, | 48 | * from ubuntu-download-manager. The ccad is used for pause/resume/cancel, |
301 | 49 | * state change / download progress signals, etc. | 49 | * state change / download progress signals, etc. |
302 | @@ -85,14 +85,14 @@ | |||
303 | 85 | void start() | 85 | void start() |
304 | 86 | { | 86 | { |
305 | 87 | g_return_if_fail(can_start()); | 87 | g_return_if_fail(can_start()); |
307 | 88 | 88 | ||
308 | 89 | call_ccad_method_no_args_no_response("start"); | 89 | call_ccad_method_no_args_no_response("start"); |
309 | 90 | } | 90 | } |
310 | 91 | 91 | ||
311 | 92 | void pause() | 92 | void pause() |
312 | 93 | { | 93 | { |
313 | 94 | g_return_if_fail(can_pause()); | 94 | g_return_if_fail(can_pause()); |
315 | 95 | 95 | ||
316 | 96 | call_ccad_method_no_args_no_response("pause"); | 96 | call_ccad_method_no_args_no_response("pause"); |
317 | 97 | } | 97 | } |
318 | 98 | 98 | ||
319 | @@ -359,7 +359,7 @@ | |||
320 | 359 | speed_Bps = 0; | 359 | speed_Bps = 0; |
321 | 360 | m_history.clear(); | 360 | m_history.clear(); |
322 | 361 | } | 361 | } |
324 | 362 | 362 | ||
325 | 363 | emit_changed_soon(); | 363 | emit_changed_soon(); |
326 | 364 | } | 364 | } |
327 | 365 | } | 365 | } |
328 | @@ -631,12 +631,6 @@ | |||
329 | 631 | m_model(std::make_shared<MutableModel>()) | 631 | m_model(std::make_shared<MutableModel>()) |
330 | 632 | { | 632 | { |
331 | 633 | g_bus_get(G_BUS_TYPE_SESSION, m_cancellable, on_bus_ready, this); | 633 | g_bus_get(G_BUS_TYPE_SESSION, m_cancellable, on_bus_ready, this); |
332 | 634 | |||
333 | 635 | m_model->removed().connect([this](const Transfer::Id& id){ | ||
334 | 636 | auto transfer = find_transfer_by_id(id); | ||
335 | 637 | if (transfer) | ||
336 | 638 | m_removed_ccad.insert(transfer->ccad_path()); | ||
337 | 639 | }); | ||
338 | 640 | } | 634 | } |
339 | 641 | 635 | ||
340 | 642 | ~Impl() | 636 | ~Impl() |
341 | @@ -675,6 +669,16 @@ | |||
342 | 675 | transfer->cancel(); | 669 | transfer->cancel(); |
343 | 676 | } | 670 | } |
344 | 677 | 671 | ||
345 | 672 | void clear(const Transfer::Id& id) | ||
346 | 673 | { | ||
347 | 674 | auto transfer = find_transfer_by_id(id); | ||
348 | 675 | if (transfer) | ||
349 | 676 | { | ||
350 | 677 | m_removed_ccad.insert(transfer->ccad_path()); | ||
351 | 678 | m_model->remove(id); | ||
352 | 679 | } | ||
353 | 680 | } | ||
354 | 681 | |||
355 | 678 | void open(const Transfer::Id& id) | 682 | void open(const Transfer::Id& id) |
356 | 679 | { | 683 | { |
357 | 680 | auto transfer = find_transfer_by_id(id); | 684 | auto transfer = find_transfer_by_id(id); |
358 | @@ -812,7 +816,7 @@ | |||
359 | 812 | g_debug("download signal: %s %s %s", ccad_path, signal_name, variant_str); | 816 | g_debug("download signal: %s %s %s", ccad_path, signal_name, variant_str); |
360 | 813 | g_free(variant_str); | 817 | g_free(variant_str); |
361 | 814 | 818 | ||
363 | 815 | // Route this signal to the DMTransfer for processing | 819 | // Route this signal to the DMTransfer for processing |
364 | 816 | auto self = static_cast<Impl*>(gself); | 820 | auto self = static_cast<Impl*>(gself); |
365 | 817 | auto transfer = self->find_transfer_by_ccad_path(ccad_path); | 821 | auto transfer = self->find_transfer_by_ccad_path(ccad_path); |
366 | 818 | if (transfer) | 822 | if (transfer) |
367 | @@ -927,12 +931,18 @@ | |||
368 | 927 | } | 931 | } |
369 | 928 | 932 | ||
370 | 929 | void | 933 | void |
371 | 934 | DMSource::clear(const Transfer::Id& id) | ||
372 | 935 | { | ||
373 | 936 | impl->clear(id); | ||
374 | 937 | } | ||
375 | 938 | |||
376 | 939 | void | ||
377 | 930 | DMSource::open_app(const Transfer::Id& id) | 940 | DMSource::open_app(const Transfer::Id& id) |
378 | 931 | { | 941 | { |
380 | 932 | impl->open_app(id); | 942 | impl->open_app(id); |
381 | 933 | } | 943 | } |
382 | 934 | 944 | ||
384 | 935 | std::shared_ptr<MutableModel> | 945 | const std::shared_ptr<const MutableModel> |
385 | 936 | DMSource::get_model() | 946 | DMSource::get_model() |
386 | 937 | { | 947 | { |
387 | 938 | return impl->get_model(); | 948 | return impl->get_model(); |
388 | 939 | 949 | ||
389 | === modified file 'src/main.cpp' | |||
390 | --- src/main.cpp 2015-08-19 18:01:58 +0000 | |||
391 | +++ src/main.cpp 2015-08-19 18:01:58 +0000 | |||
392 | @@ -45,9 +45,8 @@ | |||
393 | 45 | 45 | ||
394 | 46 | // run until we lose the busname | 46 | // run until we lose the busname |
395 | 47 | auto source = std::make_shared<PluginSource>(PLUGINDIR); | 47 | auto source = std::make_shared<PluginSource>(PLUGINDIR); |
399 | 48 | auto model = source->get_model(); | 48 | auto controller = std::make_shared<Controller>(source); |
400 | 49 | auto controller = std::make_shared<Controller>(model, source); | 49 | GMenuView menu_view (controller); |
398 | 50 | GMenuView menu_view (model, controller); | ||
401 | 51 | // FIXME: listen for busname-lost | 50 | // FIXME: listen for busname-lost |
402 | 52 | g_main_loop_run(loop); | 51 | g_main_loop_run(loop); |
403 | 53 | 52 | ||
404 | 54 | 53 | ||
405 | === modified file 'src/model.cpp' | |||
406 | --- src/model.cpp 2014-06-17 01:36:16 +0000 | |||
407 | +++ src/model.cpp 2015-08-19 18:01:58 +0000 | |||
408 | @@ -58,6 +58,16 @@ | |||
409 | 58 | return ret; | 58 | return ret; |
410 | 59 | } | 59 | } |
411 | 60 | 60 | ||
412 | 61 | int Model::size() const | ||
413 | 62 | { | ||
414 | 63 | return m_transfers.size(); | ||
415 | 64 | } | ||
416 | 65 | |||
417 | 66 | int Model::count(const Transfer::Id& id) const | ||
418 | 67 | { | ||
419 | 68 | return m_transfers.count(id); | ||
420 | 69 | } | ||
421 | 70 | |||
422 | 61 | const core::Signal<Transfer::Id>& Model::changed() const | 71 | const core::Signal<Transfer::Id>& Model::changed() const |
423 | 62 | { | 72 | { |
424 | 63 | return m_changed; | 73 | return m_changed; |
425 | 64 | 74 | ||
426 | === modified file 'src/multisource.cpp' | |||
427 | --- src/multisource.cpp 2015-08-19 18:01:58 +0000 | |||
428 | +++ src/multisource.cpp 2015-08-19 18:01:58 +0000 | |||
429 | @@ -104,6 +104,13 @@ | |||
430 | 104 | source->cancel(id); | 104 | source->cancel(id); |
431 | 105 | } | 105 | } |
432 | 106 | 106 | ||
433 | 107 | void clear(const Transfer::Id& id) | ||
434 | 108 | { | ||
435 | 109 | auto source = lookup_source(id); | ||
436 | 110 | g_return_if_fail(source); | ||
437 | 111 | source->clear(id); | ||
438 | 112 | } | ||
439 | 113 | |||
440 | 107 | void open(const Transfer::Id& id) | 114 | void open(const Transfer::Id& id) |
441 | 108 | { | 115 | { |
442 | 109 | auto source = lookup_source(id); | 116 | auto source = lookup_source(id); |
443 | @@ -180,13 +187,18 @@ | |||
444 | 180 | impl->cancel(id); | 187 | impl->cancel(id); |
445 | 181 | } | 188 | } |
446 | 182 | 189 | ||
447 | 190 | void MultiSource::clear(const Transfer::Id &id) | ||
448 | 191 | { | ||
449 | 192 | impl->clear(id); | ||
450 | 193 | } | ||
451 | 194 | |||
452 | 183 | void | 195 | void |
453 | 184 | MultiSource::open_app(const Transfer::Id& id) | 196 | MultiSource::open_app(const Transfer::Id& id) |
454 | 185 | { | 197 | { |
455 | 186 | impl->open_app(id); | 198 | impl->open_app(id); |
456 | 187 | } | 199 | } |
457 | 188 | 200 | ||
459 | 189 | std::shared_ptr<MutableModel> | 201 | const std::shared_ptr<const MutableModel> |
460 | 190 | MultiSource::get_model() | 202 | MultiSource::get_model() |
461 | 191 | { | 203 | { |
462 | 192 | return impl->get_model(); | 204 | return impl->get_model(); |
463 | 193 | 205 | ||
464 | === modified file 'src/view-gmenu.cpp' | |||
465 | --- src/view-gmenu.cpp 2014-10-03 20:54:45 +0000 | |||
466 | +++ src/view-gmenu.cpp 2015-08-19 18:01:58 +0000 | |||
467 | @@ -43,12 +43,11 @@ | |||
468 | 43 | { | 43 | { |
469 | 44 | public: | 44 | public: |
470 | 45 | 45 | ||
473 | 46 | GActions(const std::shared_ptr<Model>& model, | 46 | explicit GActions(const std::shared_ptr<Controller>& controller): |
472 | 47 | const std::shared_ptr<Controller>& controller): | ||
474 | 48 | m_action_group(g_simple_action_group_new()), | 47 | m_action_group(g_simple_action_group_new()), |
475 | 49 | m_controller(controller) | 48 | m_controller(controller) |
476 | 50 | { | 49 | { |
478 | 51 | set_model(model); | 50 | set_model(controller->get_model()); |
479 | 52 | 51 | ||
480 | 53 | const GActionEntry entries[] = { | 52 | const GActionEntry entries[] = { |
481 | 54 | { "activate-transfer", on_tap, "s", nullptr }, | 53 | { "activate-transfer", on_tap, "s", nullptr }, |
482 | @@ -75,7 +74,7 @@ | |||
483 | 75 | 74 | ||
484 | 76 | } | 75 | } |
485 | 77 | 76 | ||
487 | 78 | void set_model(const std::shared_ptr<Model>& model) | 77 | void set_model(const std::shared_ptr<const Model>& model) |
488 | 79 | { | 78 | { |
489 | 80 | // out with the old... | 79 | // out with the old... |
490 | 81 | auto& c = m_connections; | 80 | auto& c = m_connections; |
491 | @@ -252,7 +251,7 @@ | |||
492 | 252 | } | 251 | } |
493 | 253 | 252 | ||
494 | 254 | GSimpleActionGroup* m_action_group = nullptr; | 253 | GSimpleActionGroup* m_action_group = nullptr; |
496 | 255 | std::shared_ptr<Model> m_model; | 254 | std::shared_ptr<const Model> m_model; |
497 | 256 | std::shared_ptr<Controller> m_controller; | 255 | std::shared_ptr<Controller> m_controller; |
498 | 257 | std::set<core::ScopedConnection> m_connections; | 256 | std::set<core::ScopedConnection> m_connections; |
499 | 258 | 257 | ||
500 | @@ -279,7 +278,7 @@ | |||
501 | 279 | GMenuModel* menu_model() { return G_MENU_MODEL(m_menu); } | 278 | GMenuModel* menu_model() { return G_MENU_MODEL(m_menu); } |
502 | 280 | 279 | ||
503 | 281 | Menu(const char* name_in, | 280 | Menu(const char* name_in, |
505 | 282 | const std::shared_ptr<Model>& model, | 281 | const std::shared_ptr<const Model>& model, |
506 | 283 | const std::shared_ptr<GActions>& gactions): | 282 | const std::shared_ptr<GActions>& gactions): |
507 | 284 | m_name{name_in}, | 283 | m_name{name_in}, |
508 | 285 | m_gactions{gactions} | 284 | m_gactions{gactions} |
509 | @@ -296,7 +295,7 @@ | |||
510 | 296 | g_clear_object(&m_menu); | 295 | g_clear_object(&m_menu); |
511 | 297 | } | 296 | } |
512 | 298 | 297 | ||
514 | 299 | void set_model (const std::shared_ptr<Model>& model) | 298 | void set_model (const std::shared_ptr<const Model>& model) |
515 | 300 | { | 299 | { |
516 | 301 | auto& c = m_connections; | 300 | auto& c = m_connections; |
517 | 302 | c.clear(); | 301 | c.clear(); |
518 | @@ -563,7 +562,7 @@ | |||
519 | 563 | return item; | 562 | return item; |
520 | 564 | } | 563 | } |
521 | 565 | 564 | ||
523 | 566 | static bool bulk_menu_item_is_equal(GMenuModel* model, | 565 | static bool bulk_menu_item_is_equal(GMenuModel* model, |
524 | 567 | int pos, | 566 | int pos, |
525 | 568 | GMenuItem* item) | 567 | GMenuItem* item) |
526 | 569 | { | 568 | { |
527 | @@ -772,7 +771,7 @@ | |||
528 | 772 | GMenu* m_menu = nullptr; | 771 | GMenu* m_menu = nullptr; |
529 | 773 | const char* const m_name; | 772 | const char* const m_name; |
530 | 774 | 773 | ||
532 | 775 | std::shared_ptr<Model> m_model; | 774 | std::shared_ptr<const Model> m_model; |
533 | 776 | std::shared_ptr<GActions> m_gactions; | 775 | std::shared_ptr<GActions> m_gactions; |
534 | 777 | std::map<Transfer::Id,Section> m_visible_transfers; | 776 | std::map<Transfer::Id,Section> m_visible_transfers; |
535 | 778 | GMenu* m_submenu = nullptr; | 777 | GMenu* m_submenu = nullptr; |
536 | @@ -936,17 +935,16 @@ | |||
537 | 936 | { | 935 | { |
538 | 937 | public: | 936 | public: |
539 | 938 | 937 | ||
543 | 939 | Impl (const std::shared_ptr<Model>& model, | 938 | explicit Impl (const std::shared_ptr<Controller>& controller): |
541 | 940 | const std::shared_ptr<Controller>& controller): | ||
542 | 941 | m_model(model), | ||
544 | 942 | m_controller(controller), | 939 | m_controller(controller), |
546 | 943 | m_gactions(new GActions(model, controller)), | 940 | m_gactions(new GActions(controller)), |
547 | 944 | m_exporter(new Exporter) | 941 | m_exporter(new Exporter) |
548 | 945 | { | 942 | { |
549 | 943 | set_model(controller->get_model()); | ||
550 | 946 | // create the Menus | 944 | // create the Menus |
551 | 947 | for(int i=0; i<Menu::NUM_PROFILES; i++) | 945 | for(int i=0; i<Menu::NUM_PROFILES; i++) |
552 | 948 | m_menus.push_back(create_menu_for_profile(Menu::Profile(i))); | 946 | m_menus.push_back(create_menu_for_profile(Menu::Profile(i))); |
554 | 949 | 947 | ||
555 | 950 | m_exporter->publish(m_gactions, m_menus); | 948 | m_exporter->publish(m_gactions, m_menus); |
556 | 951 | } | 949 | } |
557 | 952 | 950 | ||
558 | @@ -954,7 +952,7 @@ | |||
559 | 954 | { | 952 | { |
560 | 955 | } | 953 | } |
561 | 956 | 954 | ||
563 | 957 | void set_model(const std::shared_ptr<Model>& model) | 955 | void set_model(const std::shared_ptr<const Model>& model) |
564 | 958 | { | 956 | { |
565 | 959 | m_model = model; | 957 | m_model = model; |
566 | 960 | 958 | ||
567 | @@ -976,7 +974,7 @@ | |||
568 | 976 | return m; | 974 | return m; |
569 | 977 | } | 975 | } |
570 | 978 | 976 | ||
572 | 979 | std::shared_ptr<Model> m_model; | 977 | std::shared_ptr<const Model> m_model; |
573 | 980 | std::shared_ptr<Controller> m_controller; | 978 | std::shared_ptr<Controller> m_controller; |
574 | 981 | std::shared_ptr<GActions> m_gactions; | 979 | std::shared_ptr<GActions> m_gactions; |
575 | 982 | std::vector<std::shared_ptr<Menu>> m_menus; | 980 | std::vector<std::shared_ptr<Menu>> m_menus; |
576 | @@ -987,9 +985,8 @@ | |||
577 | 987 | **** | 985 | **** |
578 | 988 | ***/ | 986 | ***/ |
579 | 989 | 987 | ||
583 | 990 | GMenuView::GMenuView(const std::shared_ptr<Model>& model, | 988 | GMenuView::GMenuView(const std::shared_ptr<Controller>& controller): |
584 | 991 | const std::shared_ptr<Controller>& controller): | 989 | p(new Impl(controller)) |
582 | 992 | p(new Impl(model, controller)) | ||
585 | 993 | { | 990 | { |
586 | 994 | } | 991 | } |
587 | 995 | 992 | ||
588 | @@ -997,11 +994,6 @@ | |||
589 | 997 | { | 994 | { |
590 | 998 | } | 995 | } |
591 | 999 | 996 | ||
592 | 1000 | void GMenuView::set_model(const std::shared_ptr<Model>& model) | ||
593 | 1001 | { | ||
594 | 1002 | p->set_model(model); | ||
595 | 1003 | } | ||
596 | 1004 | |||
597 | 1005 | const core::Signal<>& GMenuView::name_lost() const | 997 | const core::Signal<>& GMenuView::name_lost() const |
598 | 1006 | { | 998 | { |
599 | 1007 | return p->name_lost(); | 999 | return p->name_lost(); |
600 | 1008 | 1000 | ||
601 | === modified file 'tests/controller-mock.h' | |||
602 | --- tests/controller-mock.h 2015-08-19 18:01:58 +0000 | |||
603 | +++ tests/controller-mock.h 2015-08-19 18:01:58 +0000 | |||
604 | @@ -31,9 +31,8 @@ | |||
605 | 31 | class MockController: public Controller | 31 | class MockController: public Controller |
606 | 32 | { | 32 | { |
607 | 33 | public: | 33 | public: |
611 | 34 | MockController(const std::shared_ptr<MutableModel>& model, | 34 | explicit MockController(const std::shared_ptr<Source>& source): |
612 | 35 | const std::shared_ptr<Source>& source): | 35 | Controller(source) {} |
610 | 36 | Controller(model, source) {} | ||
613 | 37 | 36 | ||
614 | 38 | MOCK_METHOD0(pause_all, void()); | 37 | MOCK_METHOD0(pause_all, void()); |
615 | 39 | MOCK_METHOD0(resume_all, void()); | 38 | MOCK_METHOD0(resume_all, void()); |
616 | 40 | 39 | ||
617 | === modified file 'tests/source-mock.h' | |||
618 | --- tests/source-mock.h 2015-08-19 18:01:58 +0000 | |||
619 | +++ tests/source-mock.h 2015-08-19 18:01:58 +0000 | |||
620 | @@ -34,16 +34,23 @@ | |||
621 | 34 | class MockSource: public Source | 34 | class MockSource: public Source |
622 | 35 | { | 35 | { |
623 | 36 | public: | 36 | public: |
625 | 37 | MockSource(): m_model(new MutableModel) {} | 37 | MockSource(): m_model(new MutableModel) |
626 | 38 | { | ||
627 | 39 | // make sure that the transfer get removed from model on clear call | ||
628 | 40 | ON_CALL(*this, clear(::testing::_)) | ||
629 | 41 | .WillByDefault(::testing::Invoke(m_model.get(), &MutableModel::remove)); | ||
630 | 42 | } | ||
631 | 38 | 43 | ||
632 | 39 | MOCK_METHOD1(open, void(const Transfer::Id&)); | 44 | MOCK_METHOD1(open, void(const Transfer::Id&)); |
633 | 40 | MOCK_METHOD1(start, void(const Transfer::Id&)); | 45 | MOCK_METHOD1(start, void(const Transfer::Id&)); |
634 | 41 | MOCK_METHOD1(pause, void(const Transfer::Id&)); | 46 | MOCK_METHOD1(pause, void(const Transfer::Id&)); |
635 | 42 | MOCK_METHOD1(resume, void(const Transfer::Id&)); | 47 | MOCK_METHOD1(resume, void(const Transfer::Id&)); |
636 | 43 | MOCK_METHOD1(cancel, void(const Transfer::Id&)); | 48 | MOCK_METHOD1(cancel, void(const Transfer::Id&)); |
637 | 49 | MOCK_METHOD1(clear, void(const Transfer::Id&)); | ||
638 | 50 | MOCK_METHOD1(update, void(const Transfer::Id&)); | ||
639 | 44 | MOCK_METHOD1(open_app, void(const Transfer::Id&)); | 51 | MOCK_METHOD1(open_app, void(const Transfer::Id&)); |
640 | 45 | 52 | ||
642 | 46 | std::shared_ptr<MutableModel> get_model() override {return m_model;} | 53 | const std::shared_ptr<const MutableModel> get_model() override {return m_model;} |
643 | 47 | std::shared_ptr<MutableModel> m_model; | 54 | std::shared_ptr<MutableModel> m_model; |
644 | 48 | }; | 55 | }; |
645 | 49 | 56 | ||
646 | 50 | 57 | ||
647 | === modified file 'tests/test-controller.cpp' | |||
648 | --- tests/test-controller.cpp 2015-08-19 18:01:58 +0000 | |||
649 | +++ tests/test-controller.cpp 2015-08-19 18:01:58 +0000 | |||
650 | @@ -36,7 +36,6 @@ | |||
651 | 36 | GTestDBus* bus = nullptr; | 36 | GTestDBus* bus = nullptr; |
652 | 37 | 37 | ||
653 | 38 | std::shared_ptr<MockSource> m_source; | 38 | std::shared_ptr<MockSource> m_source; |
654 | 39 | std::shared_ptr<MutableModel> m_model; | ||
655 | 40 | std::shared_ptr<Controller> m_controller; | 39 | std::shared_ptr<Controller> m_controller; |
656 | 41 | 40 | ||
657 | 42 | void SetUp() | 41 | void SetUp() |
658 | @@ -44,14 +43,12 @@ | |||
659 | 44 | super::SetUp(); | 43 | super::SetUp(); |
660 | 45 | 44 | ||
661 | 46 | m_source.reset(new MockSource); | 45 | m_source.reset(new MockSource); |
664 | 47 | m_model.reset(new MutableModel); | 46 | m_controller.reset(new Controller(m_source)); |
663 | 48 | m_controller.reset(new Controller(m_model, m_source)); | ||
665 | 49 | } | 47 | } |
666 | 50 | 48 | ||
667 | 51 | void TearDown() | 49 | void TearDown() |
668 | 52 | { | 50 | { |
669 | 53 | m_controller.reset(); | 51 | m_controller.reset(); |
670 | 54 | m_model.reset(); | ||
671 | 55 | m_source.reset(); | 52 | m_source.reset(); |
672 | 56 | 53 | ||
673 | 57 | super::TearDown(); | 54 | super::TearDown(); |
674 | @@ -102,22 +99,29 @@ | |||
675 | 102 | auto t = std::make_shared<Transfer>(); | 99 | auto t = std::make_shared<Transfer>(); |
676 | 103 | t->state = transfer.state; | 100 | t->state = transfer.state; |
677 | 104 | t->id = transfer.id; | 101 | t->id = transfer.id; |
679 | 105 | m_model->add(t); | 102 | m_source->m_model->add(t); |
680 | 106 | } | 103 | } |
681 | 107 | 104 | ||
682 | 108 | // make sure all the transfers made it into the model | 105 | // make sure all the transfers made it into the model |
685 | 109 | auto ids = m_model->get_ids(); | 106 | EXPECT_EQ(G_N_ELEMENTS(transfers), m_controller->size()); |
684 | 110 | EXPECT_EQ(G_N_ELEMENTS(transfers), ids.size()); | ||
686 | 111 | for (const auto& transfer : transfers) | 107 | for (const auto& transfer : transfers) |
688 | 112 | EXPECT_EQ(1, ids.count(transfer.id)); | 108 | { |
689 | 109 | EXPECT_EQ(1, m_controller->count(transfer.id)); | ||
690 | 110 | EXPECT_CALL(*m_source, clear(transfer.id)).Times(transfer.can_clear?1:0); | ||
691 | 111 | } | ||
692 | 113 | 112 | ||
693 | 114 | // call clear-all | 113 | // call clear-all |
694 | 115 | m_controller->clear_all(); | 114 | m_controller->clear_all(); |
695 | 116 | 115 | ||
698 | 117 | // make sure all the clearable transfers are gone | 116 | // make sure all the clearable transfers are gone from controler and source |
699 | 118 | ids = m_model->get_ids(); | 117 | auto source_ids = m_source->get_model()->get_ids(); |
700 | 118 | |||
701 | 119 | for (const auto& transfer : transfers) | 119 | for (const auto& transfer : transfers) |
703 | 120 | EXPECT_EQ((transfer.can_clear ? 0 : 1), ids.count(transfer.id)); | 120 | { |
704 | 121 | int expect_count = (transfer.can_clear ? 0 : 1); | ||
705 | 122 | EXPECT_EQ(source_ids.count(transfer.id), expect_count); | ||
706 | 123 | EXPECT_EQ(m_controller->count(transfer.id), expect_count); | ||
707 | 124 | } | ||
708 | 121 | } | 125 | } |
709 | 122 | 126 | ||
710 | 123 | /** | 127 | /** |
711 | @@ -145,7 +149,7 @@ | |||
712 | 145 | auto t = std::make_shared<Transfer>(); | 149 | auto t = std::make_shared<Transfer>(); |
713 | 146 | t->state = transfer.state; | 150 | t->state = transfer.state; |
714 | 147 | t->id = transfer.id; | 151 | t->id = transfer.id; |
716 | 148 | m_model->add(t); | 152 | m_source->m_model->add(t); |
717 | 149 | EXPECT_EQ(transfer.can_pause, t->can_pause()); | 153 | EXPECT_EQ(transfer.can_pause, t->can_pause()); |
718 | 150 | EXPECT_CALL(*m_source, pause(transfer.id)).Times(transfer.can_pause?1:0); | 154 | EXPECT_CALL(*m_source, pause(transfer.id)).Times(transfer.can_pause?1:0); |
719 | 151 | } | 155 | } |
720 | @@ -178,7 +182,7 @@ | |||
721 | 178 | auto t = std::make_shared<Transfer>(); | 182 | auto t = std::make_shared<Transfer>(); |
722 | 179 | t->state = transfer.state; | 183 | t->state = transfer.state; |
723 | 180 | t->id = transfer.id; | 184 | t->id = transfer.id; |
725 | 181 | m_model->add(t); | 185 | m_source->m_model->add(t); |
726 | 182 | EXPECT_EQ(transfer.can_resume, t->can_resume()); | 186 | EXPECT_EQ(transfer.can_resume, t->can_resume()); |
727 | 183 | EXPECT_CALL(*m_source, resume(transfer.id)).Times(transfer.can_resume?1:0); | 187 | EXPECT_CALL(*m_source, resume(transfer.id)).Times(transfer.can_resume?1:0); |
728 | 184 | } | 188 | } |
729 | @@ -196,7 +200,7 @@ | |||
730 | 196 | auto t = std::make_shared<Transfer>(); | 200 | auto t = std::make_shared<Transfer>(); |
731 | 197 | t->state = Transfer::QUEUED; | 201 | t->state = Transfer::QUEUED; |
732 | 198 | t->id = id; | 202 | t->id = id; |
734 | 199 | m_model->add(t); | 203 | m_source->m_model->add(t); |
735 | 200 | 204 | ||
736 | 201 | t->state = Transfer::QUEUED; | 205 | t->state = Transfer::QUEUED; |
737 | 202 | EXPECT_CALL(*m_source, start(id)).Times(1); | 206 | EXPECT_CALL(*m_source, start(id)).Times(1); |
738 | @@ -269,7 +273,7 @@ | |||
739 | 269 | auto t = std::make_shared<Transfer>(); | 273 | auto t = std::make_shared<Transfer>(); |
740 | 270 | t->id = id; | 274 | t->id = id; |
741 | 271 | t->state = Transfer::QUEUED; | 275 | t->state = Transfer::QUEUED; |
743 | 272 | m_model->add(t); | 276 | m_source->m_model->add(t); |
744 | 273 | 277 | ||
745 | 274 | for (const auto& state : all_states) | 278 | for (const auto& state : all_states) |
746 | 275 | { | 279 | { |
747 | @@ -289,7 +293,7 @@ | |||
748 | 289 | auto t = std::make_shared<Transfer>(); | 293 | auto t = std::make_shared<Transfer>(); |
749 | 290 | t->id = id; | 294 | t->id = id; |
750 | 291 | t->state = Transfer::QUEUED; | 295 | t->state = Transfer::QUEUED; |
752 | 292 | m_model->add(t); | 296 | m_source->m_model->add(t); |
753 | 293 | 297 | ||
754 | 294 | for (const auto& state : all_states) | 298 | for (const auto& state : all_states) |
755 | 295 | { | 299 | { |
756 | @@ -309,7 +313,7 @@ | |||
757 | 309 | auto t = std::make_shared<Transfer>(); | 313 | auto t = std::make_shared<Transfer>(); |
758 | 310 | t->id = id; | 314 | t->id = id; |
759 | 311 | t->state = Transfer::QUEUED; | 315 | t->state = Transfer::QUEUED; |
761 | 312 | m_model->add(t); | 316 | m_source->m_model->add(t); |
762 | 313 | 317 | ||
763 | 314 | for (const auto& state : all_states) | 318 | for (const auto& state : all_states) |
764 | 315 | { | 319 | { |
765 | @@ -329,7 +333,7 @@ | |||
766 | 329 | auto t = std::make_shared<Transfer>(); | 333 | auto t = std::make_shared<Transfer>(); |
767 | 330 | t->id = id; | 334 | t->id = id; |
768 | 331 | t->state = Transfer::QUEUED; | 335 | t->state = Transfer::QUEUED; |
770 | 332 | m_model->add(t); | 336 | m_source->m_model->add(t); |
771 | 333 | 337 | ||
772 | 334 | for (const auto& state : all_states) | 338 | for (const auto& state : all_states) |
773 | 335 | { | 339 | { |
774 | 336 | 340 | ||
775 | === modified file 'tests/test-multisource.cpp' | |||
776 | --- tests/test-multisource.cpp 2015-08-19 18:01:58 +0000 | |||
777 | +++ tests/test-multisource.cpp 2015-08-19 18:01:58 +0000 | |||
778 | @@ -40,7 +40,7 @@ | |||
779 | 40 | bool operator==(const Event& that) const { return type==that.type && id==that.id; } | 40 | bool operator==(const Event& that) const { return type==that.type && id==that.id; } |
780 | 41 | }; | 41 | }; |
781 | 42 | 42 | ||
783 | 43 | bool model_consists_of(const std::shared_ptr<Model>& model, std::initializer_list<std::shared_ptr<Transfer>> list) const | 43 | bool model_consists_of(const std::shared_ptr<const Model>& model, std::initializer_list<std::shared_ptr<Transfer>> list) const |
784 | 44 | { | 44 | { |
785 | 45 | // test get_all() | 45 | // test get_all() |
786 | 46 | std::vector<std::shared_ptr<Transfer>> transfers(list); | 46 | std::vector<std::shared_ptr<Transfer>> transfers(list); |
787 | @@ -82,7 +82,7 @@ | |||
788 | 82 | const Transfer::Id aid {"aid"}; | 82 | const Transfer::Id aid {"aid"}; |
789 | 83 | auto at = std::make_shared<Transfer>(); | 83 | auto at = std::make_shared<Transfer>(); |
790 | 84 | at->id = aid; | 84 | at->id = aid; |
792 | 85 | a->get_model()->add(at); | 85 | a->m_model->add(at); |
793 | 86 | expected_events.push_back(Event{Event::ADDED,aid}); | 86 | expected_events.push_back(Event{Event::ADDED,aid}); |
794 | 87 | 87 | ||
795 | 88 | // confirm that the multimodel sees the new transfer | 88 | // confirm that the multimodel sees the new transfer |
796 | @@ -94,7 +94,7 @@ | |||
797 | 94 | const Transfer::Id bid {"bid"}; | 94 | const Transfer::Id bid {"bid"}; |
798 | 95 | auto bt = std::make_shared<Transfer>(); | 95 | auto bt = std::make_shared<Transfer>(); |
799 | 96 | bt->id = bid; | 96 | bt->id = bid; |
801 | 97 | b->get_model()->add(bt); | 97 | b->m_model->add(bt); |
802 | 98 | expected_events.push_back(Event{Event::ADDED,bid}); | 98 | expected_events.push_back(Event{Event::ADDED,bid}); |
803 | 99 | 99 | ||
804 | 100 | // confirm that the multimodel sees the new transfer | 100 | // confirm that the multimodel sees the new transfer |
805 | @@ -104,20 +104,20 @@ | |||
806 | 104 | 104 | ||
807 | 105 | // poke transfer 'at'... | 105 | // poke transfer 'at'... |
808 | 106 | at->progress = 50.0; | 106 | at->progress = 50.0; |
810 | 107 | a->get_model()->emit_changed(aid); | 107 | a->m_model->emit_changed(aid); |
811 | 108 | expected_events.push_back(Event{Event::CHANGED,aid}); | 108 | expected_events.push_back(Event{Event::CHANGED,aid}); |
812 | 109 | EXPECT_EQ(expected_events, events); | 109 | EXPECT_EQ(expected_events, events); |
813 | 110 | EXPECT_TRUE(model_consists_of(multimodel, {at, bt})); | 110 | EXPECT_TRUE(model_consists_of(multimodel, {at, bt})); |
814 | 111 | 111 | ||
815 | 112 | // remove transfer 'at'... | 112 | // remove transfer 'at'... |
817 | 113 | a->get_model()->remove(aid); | 113 | a->m_model->remove(aid); |
818 | 114 | expected_events.push_back(Event{Event::REMOVED,aid}); | 114 | expected_events.push_back(Event{Event::REMOVED,aid}); |
819 | 115 | EXPECT_EQ(expected_events, events); | 115 | EXPECT_EQ(expected_events, events); |
820 | 116 | EXPECT_FALSE(a->get_model()->get(aid)); | 116 | EXPECT_FALSE(a->get_model()->get(aid)); |
821 | 117 | EXPECT_TRUE(model_consists_of(multimodel, {bt})); | 117 | EXPECT_TRUE(model_consists_of(multimodel, {bt})); |
822 | 118 | 118 | ||
823 | 119 | // remove transfer 'bt'... | 119 | // remove transfer 'bt'... |
825 | 120 | b->get_model()->remove(bid); | 120 | b->m_model->remove(bid); |
826 | 121 | expected_events.push_back(Event{Event::REMOVED,bid}); | 121 | expected_events.push_back(Event{Event::REMOVED,bid}); |
827 | 122 | EXPECT_EQ(expected_events, events); | 122 | EXPECT_EQ(expected_events, events); |
828 | 123 | EXPECT_FALSE(b->get_model()->get(aid)); | 123 | EXPECT_FALSE(b->get_model()->get(aid)); |
829 | @@ -139,13 +139,13 @@ | |||
830 | 139 | const Transfer::Id aid {"aid"}; | 139 | const Transfer::Id aid {"aid"}; |
831 | 140 | auto at = std::make_shared<Transfer>(); | 140 | auto at = std::make_shared<Transfer>(); |
832 | 141 | at->id = aid; | 141 | at->id = aid; |
834 | 142 | a->get_model()->add(at); | 142 | a->m_model->add(at); |
835 | 143 | 143 | ||
836 | 144 | // add a transfer to the 'b' source... | 144 | // add a transfer to the 'b' source... |
837 | 145 | const Transfer::Id bid {"bid"}; | 145 | const Transfer::Id bid {"bid"}; |
838 | 146 | auto bt = std::make_shared<Transfer>(); | 146 | auto bt = std::make_shared<Transfer>(); |
839 | 147 | bt->id = bid; | 147 | bt->id = bid; |
841 | 148 | b->get_model()->add(bt); | 148 | b->m_model->add(bt); |
842 | 149 | 149 | ||
843 | 150 | // confirm that multisource method calls are delegated to 'a' | 150 | // confirm that multisource method calls are delegated to 'a' |
844 | 151 | EXPECT_CALL(*a, open(aid)); multisource.open(aid); | 151 | EXPECT_CALL(*a, open(aid)); multisource.open(aid); |
845 | 152 | 152 | ||
846 | === modified file 'tests/test-plugin-source.cpp' | |||
847 | --- tests/test-plugin-source.cpp 2015-08-19 18:01:58 +0000 | |||
848 | +++ tests/test-plugin-source.cpp 2015-08-19 18:01:58 +0000 | |||
849 | @@ -34,7 +34,6 @@ | |||
850 | 34 | 34 | ||
851 | 35 | GTestDBus* bus = nullptr; | 35 | GTestDBus* bus = nullptr; |
852 | 36 | 36 | ||
853 | 37 | std::shared_ptr<MutableModel> m_model; | ||
854 | 38 | std::shared_ptr<Source> m_source; | 37 | std::shared_ptr<Source> m_source; |
855 | 39 | std::shared_ptr<Controller> m_controller; | 38 | std::shared_ptr<Controller> m_controller; |
856 | 40 | 39 | ||
857 | @@ -44,15 +43,13 @@ | |||
858 | 44 | 43 | ||
859 | 45 | auto plugin_dir = g_get_current_dir(); | 44 | auto plugin_dir = g_get_current_dir(); |
860 | 46 | m_source.reset(new PluginSource(plugin_dir)); | 45 | m_source.reset(new PluginSource(plugin_dir)); |
863 | 47 | m_model = m_source->get_model(); | 46 | m_controller.reset(new Controller(m_source)); |
862 | 48 | m_controller.reset(new Controller(m_model, m_source)); | ||
864 | 49 | g_clear_pointer(&plugin_dir, g_free); | 47 | g_clear_pointer(&plugin_dir, g_free); |
865 | 50 | } | 48 | } |
866 | 51 | 49 | ||
867 | 52 | void TearDown() | 50 | void TearDown() |
868 | 53 | { | 51 | { |
869 | 54 | m_controller.reset(); | 52 | m_controller.reset(); |
870 | 55 | m_model.reset(); | ||
871 | 56 | m_source.reset(); | 53 | m_source.reset(); |
872 | 57 | 54 | ||
873 | 58 | super::TearDown(); | 55 | super::TearDown(); |
874 | 59 | 56 | ||
875 | === modified file 'tests/test-view-gmenu.cpp' | |||
876 | --- tests/test-view-gmenu.cpp 2015-08-19 18:01:58 +0000 | |||
877 | +++ tests/test-view-gmenu.cpp 2015-08-19 18:01:58 +0000 | |||
878 | @@ -37,7 +37,6 @@ | |||
879 | 37 | 37 | ||
880 | 38 | GTestDBus* bus = nullptr; | 38 | GTestDBus* bus = nullptr; |
881 | 39 | std::shared_ptr<MockSource> m_source; | 39 | std::shared_ptr<MockSource> m_source; |
882 | 40 | std::shared_ptr<MutableModel> m_model; | ||
883 | 41 | std::shared_ptr<MockController> m_controller; | 40 | std::shared_ptr<MockController> m_controller; |
884 | 42 | std::shared_ptr<GMenuView> m_view; | 41 | std::shared_ptr<GMenuView> m_view; |
885 | 43 | 42 | ||
886 | @@ -54,22 +53,21 @@ | |||
887 | 54 | 53 | ||
888 | 55 | // bring up the source | 54 | // bring up the source |
889 | 56 | m_source.reset(new MockSource); | 55 | m_source.reset(new MockSource); |
890 | 57 | m_model.reset(new MutableModel); | ||
891 | 58 | std::shared_ptr<Transfer> t; | 56 | std::shared_ptr<Transfer> t; |
892 | 59 | t.reset(new Transfer); | 57 | t.reset(new Transfer); |
893 | 60 | t->id = "a"; | 58 | t->id = "a"; |
894 | 61 | t->state = Transfer::RUNNING; | 59 | t->state = Transfer::RUNNING; |
896 | 62 | m_model->add(t); | 60 | m_source->m_model->add(t); |
897 | 63 | t.reset(new Transfer); | 61 | t.reset(new Transfer); |
898 | 64 | t->id = "b"; | 62 | t->id = "b"; |
899 | 65 | t->state = Transfer::PAUSED; | 63 | t->state = Transfer::PAUSED; |
901 | 66 | m_model->add(t); | 64 | m_source->m_model->add(t); |
902 | 67 | t.reset(new Transfer); | 65 | t.reset(new Transfer); |
903 | 68 | t->id = "c"; | 66 | t->id = "c"; |
904 | 69 | t->state = Transfer::FINISHED; | 67 | t->state = Transfer::FINISHED; |
908 | 70 | m_model->add(t); | 68 | m_source->m_model->add(t); |
909 | 71 | m_controller.reset(new MockController(m_model, m_source)); | 69 | m_controller.reset(new MockController(m_source)); |
910 | 72 | m_view.reset(new GMenuView(m_model, m_controller)); | 70 | m_view.reset(new GMenuView(m_controller)); |
911 | 73 | } | 71 | } |
912 | 74 | 72 | ||
913 | 75 | void TearDown() | 73 | void TearDown() |
914 | @@ -77,7 +75,6 @@ | |||
915 | 77 | // empty the source | 75 | // empty the source |
916 | 78 | m_view.reset(); | 76 | m_view.reset(); |
917 | 79 | m_controller.reset(); | 77 | m_controller.reset(); |
918 | 80 | m_model.reset(); | ||
919 | 81 | m_source.reset(); | 78 | m_source.reset(); |
920 | 82 | 79 | ||
921 | 83 | // bring down the bus | 80 | // bring down the bus |
922 | @@ -147,9 +144,9 @@ | |||
923 | 147 | "resume-all", | 144 | "resume-all", |
924 | 148 | "resume-transfer" | 145 | "resume-transfer" |
925 | 149 | }; | 146 | }; |
927 | 150 | for (const auto& id : m_model->get_ids()) | 147 | for (const auto& id : m_source->get_model()->get_ids()) |
928 | 151 | expected_actions.insert("transfer-state." + id); | 148 | expected_actions.insert("transfer-state." + id); |
930 | 152 | 149 | ||
931 | 153 | auto connection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, nullptr); | 150 | auto connection = g_bus_get_sync(G_BUS_TYPE_SESSION, nullptr, nullptr); |
932 | 154 | auto exported = g_dbus_action_group_get(connection, BUS_NAME, BUS_PATH); | 151 | auto exported = g_dbus_action_group_get(connection, BUS_NAME, BUS_PATH); |
933 | 155 | auto names_strv = g_action_group_list_actions(G_ACTION_GROUP(exported)); | 152 | auto names_strv = g_action_group_list_actions(G_ACTION_GROUP(exported)); |
934 | @@ -205,14 +202,14 @@ | |||
935 | 205 | 202 | ||
936 | 206 | // try tapping a transfer that can be resumed | 203 | // try tapping a transfer that can be resumed |
937 | 207 | const char* id = "b"; | 204 | const char* id = "b"; |
939 | 208 | EXPECT_TRUE(m_model->get(id)->can_resume()); | 205 | EXPECT_TRUE(m_source->get_model()->get(id)->can_resume()); |
940 | 209 | EXPECT_CALL(*m_controller, tap(id)).Times(1); | 206 | EXPECT_CALL(*m_controller, tap(id)).Times(1); |
941 | 210 | g_action_group_activate_action(action_group, "activate-transfer", g_variant_new_string(id)); | 207 | g_action_group_activate_action(action_group, "activate-transfer", g_variant_new_string(id)); |
942 | 211 | wait_msec(); | 208 | wait_msec(); |
943 | 212 | 209 | ||
944 | 213 | // try tapping a transfer that CAN'T be resumed | 210 | // try tapping a transfer that CAN'T be resumed |
945 | 214 | id = "c"; | 211 | id = "c"; |
947 | 215 | EXPECT_TRUE(!m_model->get(id)->can_resume()); | 212 | EXPECT_TRUE(!m_source->get_model()->get(id)->can_resume()); |
948 | 216 | EXPECT_CALL(*m_controller, tap(id)).Times(1); | 213 | EXPECT_CALL(*m_controller, tap(id)).Times(1); |
949 | 217 | g_action_group_activate_action(action_group, "activate-transfer", g_variant_new_string(id)); | 214 | g_action_group_activate_action(action_group, "activate-transfer", g_variant_new_string(id)); |
950 | 218 | wait_msec(); | 215 | wait_msec(); |
951 | @@ -270,7 +267,7 @@ | |||
952 | 270 | /*** | 267 | /*** |
953 | 271 | **** | 268 | **** |
954 | 272 | **** Header | 269 | **** Header |
956 | 273 | **** | 270 | **** |
957 | 274 | ***/ | 271 | ***/ |
958 | 275 | 272 | ||
959 | 276 | namespace | 273 | namespace |
960 | @@ -352,10 +349,10 @@ | |||
961 | 352 | // Visibility test #1: | 349 | // Visibility test #1: |
962 | 353 | // Change the model to all transfers finished. | 350 | // Change the model to all transfers finished. |
963 | 354 | // Confirm that the header is not visible. | 351 | // Confirm that the header is not visible. |
965 | 355 | for (auto& transfer : m_model->get_all()) | 352 | for (auto& transfer : m_source->get_model()->get_all()) |
966 | 356 | { | 353 | { |
967 | 357 | transfer->state = Transfer::FINISHED; | 354 | transfer->state = Transfer::FINISHED; |
969 | 358 | m_model->emit_changed(transfer->id); | 355 | m_source->m_model->emit_changed(transfer->id); |
970 | 359 | } | 356 | } |
971 | 360 | 357 | ||
972 | 361 | wait_msec(200); | 358 | wait_msec(200); |
973 | @@ -364,26 +361,26 @@ | |||
974 | 364 | // Visibility test #2: | 361 | // Visibility test #2: |
975 | 365 | // Change the model to all transfers finished except one running. | 362 | // Change the model to all transfers finished except one running. |
976 | 366 | // Confirm that the header is visible. | 363 | // Confirm that the header is visible. |
978 | 367 | auto transfer = m_model->get("a"); | 364 | auto transfer = m_source->get_model()->get("a"); |
979 | 368 | transfer->state = Transfer::RUNNING; | 365 | transfer->state = Transfer::RUNNING; |
981 | 369 | m_model->emit_changed(transfer->id); | 366 | m_source->m_model->emit_changed(transfer->id); |
982 | 370 | wait_msec(200); | 367 | wait_msec(200); |
983 | 371 | EXPECT_TRUE(is_header_visible(action_group, action_name)); | 368 | EXPECT_TRUE(is_header_visible(action_group, action_name)); |
984 | 372 | 369 | ||
985 | 373 | // Visibility test #3: | 370 | // Visibility test #3: |
986 | 374 | // Change the model to all transfers finished except one paused. | 371 | // Change the model to all transfers finished except one paused. |
987 | 375 | // Confirm that the header is visible. | 372 | // Confirm that the header is visible. |
989 | 376 | transfer = m_model->get("a"); | 373 | transfer = m_source->get_model()->get("a"); |
990 | 377 | transfer->state = Transfer::PAUSED; | 374 | transfer->state = Transfer::PAUSED; |
992 | 378 | m_model->emit_changed(transfer->id); | 375 | m_source->m_model->emit_changed(transfer->id); |
993 | 379 | wait_msec(200); | 376 | wait_msec(200); |
994 | 380 | EXPECT_TRUE(is_header_visible(action_group, action_name)); | 377 | EXPECT_TRUE(is_header_visible(action_group, action_name)); |
995 | 381 | 378 | ||
996 | 382 | // Visibility test #4: | 379 | // Visibility test #4: |
997 | 383 | // Remove all the transfers from the menu. | 380 | // Remove all the transfers from the menu. |
998 | 384 | // Confirm that the header is not visible. | 381 | // Confirm that the header is not visible. |
1001 | 385 | for (const auto& id : m_model->get_ids()) | 382 | for (const auto& id : m_source->get_model()->get_ids()) |
1002 | 386 | m_model->remove(id); | 383 | m_source->m_model->remove(id); |
1003 | 387 | wait_msec(200); | 384 | wait_msec(200); |
1004 | 388 | EXPECT_FALSE(is_header_visible(action_group, action_name)); | 385 | EXPECT_FALSE(is_header_visible(action_group, action_name)); |
1005 | 389 | 386 |
FAILED: Continuous integration, rev:53 jenkins. qa.ubuntu. com/job/ indicator- transfer- ci/32/ jenkins. qa.ubuntu. com/job/ indicator- transfer- wily-amd64- ci/14/console jenkins. qa.ubuntu. com/job/ indicator- transfer- wily-armhf- ci/14/console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/indicator- transfer- ci/32/rebuild
http://