Merge lp:~aacid/unity8/unitySortFilterProxyQML into lp:unity8

Proposed by Albert Astals Cid
Status: Merged
Approved by: Michael Zanetti
Approved revision: 1520
Merged at revision: 1526
Proposed branch: lp:~aacid/unity8/unitySortFilterProxyQML
Merge into: lp:unity8
Diff against target: 470 lines (+50/-50)
15 files modified
plugins/LightDM/CMakeLists.txt (+1/-1)
plugins/LightDM/UsersModel.cpp (+1/-1)
plugins/LightDM/UsersModel.h (+2/-2)
plugins/Utils/CMakeLists.txt (+1/-1)
plugins/Utils/plugin.cpp (+2/-2)
plugins/Utils/unitysortfilterproxymodelqml.cpp (+15/-15)
plugins/Utils/unitysortfilterproxymodelqml.h (+5/-5)
qml/Dash/GenericScopeView.qml (+2/-2)
qml/Notifications/Notifications.qml (+1/-1)
qml/Panel/Indicators/VisibleIndicators.qml (+2/-2)
tests/mocks/LightDM/CMakeLists.txt (+1/-1)
tests/plugins/Utils/CMakeLists.txt (+1/-1)
tests/plugins/Utils/unitysortfilterproxymodeltest.cpp (+14/-14)
tests/qmltests/Components/tst_ResponsiveVerticalJournal.qml (+1/-1)
tests/qmltests/tst_Shell.qml (+1/-1)
To merge this branch: bzr merge lp:~aacid/unity8/unitySortFilterProxyQML
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Approve
PS Jenkins bot (community) continuous-integration Approve
Review via email: mp+245198@code.launchpad.net

Commit message

QSortFilterProxyModelQML -> UnitySortFilterProxyModelQML

Someone copied the class to the sdk (but with less features...) so we better rename, class and qml name collisions are not cool

Description of the change

 * Are there any related MPs required for this MP to build/function as expected?
No

 * Did you perform an exploratory manual test run of your code change and any related functionality?
Yes

 * Did you make sure that your branch does not contain spurious tags?
Yes

 * If you changed the packaging (debian), did you subscribe the ubuntu-unity team to this MP?
N/A

 * If you changed the UI, has there been a design review?
N/A

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michael Zanetti (mzanetti) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?

yes

 * Did CI run pass? If not, please explain why.

it... it did!

 * Did you make sure that the branch does not contain spurious tags?

all fine

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/LightDM/CMakeLists.txt'
2--- plugins/LightDM/CMakeLists.txt 2014-10-09 14:53:00 +0000
3+++ plugins/LightDM/CMakeLists.txt 2014-12-19 14:56:15 +0000
4@@ -15,7 +15,7 @@
5 )
6
7 set(QMLPLUGIN_SRC
8- ../Utils/qsortfilterproxymodelqml.cpp # FIXME evaluate a more generic approach for using other plugins
9+ ../Utils/unitysortfilterproxymodelqml.cpp # FIXME evaluate a more generic approach for using other plugins
10 DBusGreeter.cpp
11 DBusGreeterList.cpp
12 Greeter.cpp
13
14=== modified file 'plugins/LightDM/UsersModel.cpp'
15--- plugins/LightDM/UsersModel.cpp 2013-06-05 22:03:08 +0000
16+++ plugins/LightDM/UsersModel.cpp 2014-12-19 14:56:15 +0000
17@@ -58,7 +58,7 @@
18 // **** Now we continue with actual UsersModel class ****
19
20 UsersModel::UsersModel(QObject* parent)
21- : QSortFilterProxyModelQML(parent)
22+ : UnitySortFilterProxyModelQML(parent)
23 {
24 setModel(new MangleModel(this));
25 setSortCaseSensitivity(Qt::CaseInsensitive);
26
27=== modified file 'plugins/LightDM/UsersModel.h'
28--- plugins/LightDM/UsersModel.h 2013-12-17 14:56:25 +0000
29+++ plugins/LightDM/UsersModel.h 2014-12-19 14:56:15 +0000
30@@ -23,10 +23,10 @@
31 #ifndef UNITY_USERSMODEL_H
32 #define UNITY_USERSMODEL_H
33
34-#include <qsortfilterproxymodelqml.h>
35+#include <unitysortfilterproxymodelqml.h>
36 #include <QtCore/QObject>
37
38-class UsersModel : public QSortFilterProxyModelQML
39+class UsersModel : public UnitySortFilterProxyModelQML
40 {
41 Q_OBJECT
42
43
44=== modified file 'plugins/Utils/CMakeLists.txt'
45--- plugins/Utils/CMakeLists.txt 2014-11-12 15:47:02 +0000
46+++ plugins/Utils/CMakeLists.txt 2014-12-19 14:56:15 +0000
47@@ -12,7 +12,7 @@
48
49 set(QMLPLUGIN_SRC
50 qlimitproxymodelqml.cpp
51- qsortfilterproxymodelqml.cpp
52+ unitysortfilterproxymodelqml.cpp
53 relativetimeformatter.cpp
54 timeformatter.cpp
55 unitymenumodelpaths.cpp
56
57=== modified file 'plugins/Utils/plugin.cpp'
58--- plugins/Utils/plugin.cpp 2014-07-31 13:12:29 +0000
59+++ plugins/Utils/plugin.cpp 2014-12-19 14:56:15 +0000
60@@ -27,7 +27,7 @@
61
62 // local
63 #include "qlimitproxymodelqml.h"
64-#include "qsortfilterproxymodelqml.h"
65+#include "unitysortfilterproxymodelqml.h"
66 #include "relativetimeformatter.h"
67 #include "timeformatter.h"
68 #include "unitymenumodelpaths.h"
69@@ -39,7 +39,7 @@
70 Q_ASSERT(uri == QLatin1String("Utils"));
71 qmlRegisterType<QAbstractItemModel>();
72 qmlRegisterType<QLimitProxyModelQML>(uri, 0, 1, "LimitProxyModel");
73- qmlRegisterType<QSortFilterProxyModelQML>(uri, 0, 1, "SortFilterProxyModel");
74+ qmlRegisterType<UnitySortFilterProxyModelQML>(uri, 0, 1, "UnitySortFilterProxyModel");
75 qmlRegisterType<UnityMenuModelPaths>(uri, 0, 1, "UnityMenuModelPaths");
76 qmlRegisterType<TimeFormatter>(uri, 0, 1, "TimeFormatter");
77 qmlRegisterType<WindowKeysFilter>(uri, 0, 1, "WindowKeysFilter");
78
79=== renamed file 'plugins/Utils/qsortfilterproxymodelqml.cpp' => 'plugins/Utils/unitysortfilterproxymodelqml.cpp'
80--- plugins/Utils/qsortfilterproxymodelqml.cpp 2014-08-26 08:14:44 +0000
81+++ plugins/Utils/unitysortfilterproxymodelqml.cpp 2014-12-19 14:56:15 +0000
82@@ -15,12 +15,12 @@
83 */
84
85 // self
86-#include "qsortfilterproxymodelqml.h"
87+#include "unitysortfilterproxymodelqml.h"
88
89 // Qt
90 #include <QDebug>
91
92-QSortFilterProxyModelQML::QSortFilterProxyModelQML(QObject *parent)
93+UnitySortFilterProxyModelQML::UnitySortFilterProxyModelQML(QObject *parent)
94 : QSortFilterProxyModel(parent)
95 , m_invertMatch(false)
96 {
97@@ -32,7 +32,7 @@
98 /*
99 * Enter row index of filtered/sorted model, returns row index of source model
100 */
101-int QSortFilterProxyModelQML::mapRowToSource(int row)
102+int UnitySortFilterProxyModelQML::mapRowToSource(int row)
103 {
104 if (sourceModel() == nullptr)
105 return -1;
106@@ -40,13 +40,13 @@
107 return QSortFilterProxyModel::mapToSource(index(row, 0)).row();
108 }
109
110-QHash<int, QByteArray> QSortFilterProxyModelQML::roleNames() const
111+QHash<int, QByteArray> UnitySortFilterProxyModelQML::roleNames() const
112 {
113 return sourceModel() ? sourceModel()->roleNames() : QHash<int, QByteArray>();
114 }
115
116 void
117-QSortFilterProxyModelQML::setModel(QAbstractItemModel *itemModel)
118+UnitySortFilterProxyModelQML::setModel(QAbstractItemModel *itemModel)
119 {
120 if (itemModel == nullptr) {
121 return;
122@@ -69,7 +69,7 @@
123 }
124
125 QVariantMap
126-QSortFilterProxyModelQML::get(int row)
127+UnitySortFilterProxyModelQML::get(int row)
128 {
129 QVariantMap res;
130 const QHash<int, QByteArray> roles = roleNames();
131@@ -81,7 +81,7 @@
132 }
133
134 QVariant
135-QSortFilterProxyModelQML::data(int row, int role)
136+UnitySortFilterProxyModelQML::data(int row, int role)
137 {
138 if (sourceModel() == nullptr) {
139 return QVariant();
140@@ -91,7 +91,7 @@
141 }
142
143 int
144-QSortFilterProxyModelQML::totalCount() const
145+UnitySortFilterProxyModelQML::totalCount() const
146 {
147 if (sourceModel() != nullptr) {
148 return sourceModel()->rowCount();
149@@ -101,19 +101,19 @@
150 }
151
152 int
153-QSortFilterProxyModelQML::count()
154+UnitySortFilterProxyModelQML::count()
155 {
156 return rowCount();
157 }
158
159 bool
160-QSortFilterProxyModelQML::invertMatch() const
161+UnitySortFilterProxyModelQML::invertMatch() const
162 {
163 return m_invertMatch;
164 }
165
166 void
167-QSortFilterProxyModelQML::setInvertMatch(bool invertMatch)
168+UnitySortFilterProxyModelQML::setInvertMatch(bool invertMatch)
169 {
170 if (invertMatch != m_invertMatch) {
171 m_invertMatch = invertMatch;
172@@ -123,7 +123,7 @@
173 }
174
175 bool
176-QSortFilterProxyModelQML::filterAcceptsRow(int sourceRow,
177+UnitySortFilterProxyModelQML::filterAcceptsRow(int sourceRow,
178 const QModelIndex &sourceParent) const
179 {
180 // If there's no regexp set, always accept all rows indepenently of the invertMatch setting
181@@ -136,7 +136,7 @@
182 }
183
184 int
185-QSortFilterProxyModelQML::findFirst(int role, const QVariant& value) const
186+UnitySortFilterProxyModelQML::findFirst(int role, const QVariant& value) const
187 {
188 QModelIndexList matches = match(index(0, 0), role, value, 1, Qt::MatchExactly);
189 if (!matches.isEmpty()) {
190@@ -147,7 +147,7 @@
191 }
192
193 int
194-QSortFilterProxyModelQML::mapFromSource(int row)
195+UnitySortFilterProxyModelQML::mapFromSource(int row)
196 {
197 if (sourceModel() != nullptr) {
198 return QSortFilterProxyModel::mapFromSource(sourceModel()->index(row, 0)).row();
199@@ -157,7 +157,7 @@
200 }
201
202 int
203-QSortFilterProxyModelQML::mapToSource(int row)
204+UnitySortFilterProxyModelQML::mapToSource(int row)
205 {
206 if (sourceModel() != nullptr) {
207 return QSortFilterProxyModel::mapToSource(index(row, 0)).row();
208
209=== renamed file 'plugins/Utils/qsortfilterproxymodelqml.h' => 'plugins/Utils/unitysortfilterproxymodelqml.h'
210--- plugins/Utils/qsortfilterproxymodelqml.h 2013-11-27 12:49:28 +0000
211+++ plugins/Utils/unitysortfilterproxymodelqml.h 2014-12-19 14:56:15 +0000
212@@ -14,12 +14,12 @@
213 * along with this program. If not, see <http://www.gnu.org/licenses/>.
214 */
215
216-#ifndef QSORTFILTERPROXYMODELQML_H
217-#define QSORTFILTERPROXYMODELQML_H
218+#ifndef UNITYSORTFILTERPROXYMODELQML_H
219+#define UNITYSORTFILTERPROXYMODELQML_H
220
221 #include <QSortFilterProxyModel>
222
223-class QSortFilterProxyModelQML : public QSortFilterProxyModel
224+class UnitySortFilterProxyModelQML : public QSortFilterProxyModel
225 {
226 Q_OBJECT
227
228@@ -29,7 +29,7 @@
229 Q_PROPERTY(bool invertMatch READ invertMatch WRITE setInvertMatch NOTIFY invertMatchChanged)
230
231 public:
232- explicit QSortFilterProxyModelQML(QObject *parent = 0);
233+ explicit UnitySortFilterProxyModelQML(QObject *parent = 0);
234
235 Q_INVOKABLE QVariantMap get(int row); // Use with caution, it can be slow to query all the roles
236 Q_INVOKABLE QVariant data(int row, int role);
237@@ -60,4 +60,4 @@
238 bool m_invertMatch;
239 };
240
241-#endif // QSORTFILTERPROXYMODELQML_H
242+#endif // UNITYSORTFILTERPROXYMODELQML_H
243
244=== modified file 'qml/Dash/GenericScopeView.qml'
245--- qml/Dash/GenericScopeView.qml 2014-12-15 22:42:11 +0000
246+++ qml/Dash/GenericScopeView.qml 2014-12-19 14:56:15 +0000
247@@ -28,7 +28,7 @@
248 readonly property bool navigationShown: pageHeaderLoader.item ? pageHeaderLoader.item.bottomItem[0].openList : false
249 property bool forceNonInteractive: false
250 property var scope: null
251- property SortFilterProxyModel categories: categoryFilter
252+ property UnitySortFilterProxyModel categories: categoryFilter
253 property bool isCurrent: false
254 property alias moving: categoryView.moving
255 property bool hasBackAction: false
256@@ -106,7 +106,7 @@
257 value: isCurrent && !subPageLoader.open
258 }
259
260- SortFilterProxyModel {
261+ UnitySortFilterProxyModel {
262 id: categoryFilter
263 model: scope ? scope.categories : null
264 dynamicSortFilter: true
265
266=== modified file 'qml/Notifications/Notifications.qml'
267--- qml/Notifications/Notifications.qml 2014-10-30 21:42:32 +0000
268+++ qml/Notifications/Notifications.qml 2014-12-19 14:56:15 +0000
269@@ -29,7 +29,7 @@
270 property real margin
271 property bool useModal: snapDecisionProxyModel.count > 0
272
273- SortFilterProxyModel {
274+ UnitySortFilterProxyModel {
275 id: snapDecisionProxyModel
276 objectName: "snapDecisionProxyModel"
277
278
279=== modified file 'qml/Panel/Indicators/VisibleIndicators.qml'
280--- qml/Panel/Indicators/VisibleIndicators.qml 2014-10-07 09:12:16 +0000
281+++ qml/Panel/Indicators/VisibleIndicators.qml 2014-12-19 14:56:15 +0000
282@@ -22,13 +22,13 @@
283 import Utils 0.1
284
285 Item {
286- property SortFilterProxyModel model: filterModel
287+ property UnitySortFilterProxyModel model: filterModel
288
289 function initialise(profile) {
290 indicatorsModel.load(profile);
291 }
292
293- SortFilterProxyModel {
294+ UnitySortFilterProxyModel {
295 id: filterModel
296 filterRole: Indicators.IndicatorsModelRole.IsVisible
297 filterRegExp: RegExp("^true$")
298
299=== modified file 'tests/mocks/LightDM/CMakeLists.txt'
300--- tests/mocks/LightDM/CMakeLists.txt 2014-10-09 14:53:00 +0000
301+++ tests/mocks/LightDM/CMakeLists.txt 2014-12-19 14:56:15 +0000
302@@ -24,7 +24,7 @@
303 ${CMAKE_SOURCE_DIR}/plugins/LightDM/Greeter.cpp
304 ${CMAKE_SOURCE_DIR}/plugins/LightDM/plugin.cpp
305 ${CMAKE_SOURCE_DIR}/plugins/LightDM/UsersModel.cpp
306- ${CMAKE_SOURCE_DIR}/plugins/Utils/qsortfilterproxymodelqml.cpp
307+ ${CMAKE_SOURCE_DIR}/plugins/Utils/unitysortfilterproxymodelqml.cpp
308 )
309
310 add_library(MockLightDM-qml MODULE
311
312=== modified file 'tests/plugins/Utils/CMakeLists.txt'
313--- tests/plugins/Utils/CMakeLists.txt 2014-09-22 09:20:57 +0000
314+++ tests/plugins/Utils/CMakeLists.txt 2014-12-19 14:56:15 +0000
315@@ -23,7 +23,7 @@
316
317 run_tests(
318 qlimitproxymodeltest
319- qsortfilterproxymodeltest
320+ unitysortfilterproxymodeltest
321 timeformattertest
322 )
323
324
325=== renamed file 'tests/plugins/Utils/qsortfilterproxymodeltest.cpp' => 'tests/plugins/Utils/unitysortfilterproxymodeltest.cpp'
326--- tests/plugins/Utils/qsortfilterproxymodeltest.cpp 2014-10-22 18:40:40 +0000
327+++ tests/plugins/Utils/unitysortfilterproxymodeltest.cpp 2014-12-19 14:56:15 +0000
328@@ -18,7 +18,7 @@
329 */
330
331 // local
332-#include "qsortfilterproxymodelqml.h"
333+#include "unitysortfilterproxymodelqml.h"
334 #include "modeltest.h"
335
336 // Qt
337@@ -91,7 +91,7 @@
338 QHash<int, QByteArray> m_roles;
339 };
340
341-class QSortFilterProxyModelTest : public QObject
342+class UnitySortFilterProxyModelTest : public QObject
343 {
344 Q_OBJECT
345
346@@ -103,7 +103,7 @@
347
348 void testRoleNamesSetAfter()
349 {
350- QSortFilterProxyModelQML proxy;
351+ UnitySortFilterProxyModelQML proxy;
352 MockListModel model;
353 QHash<int, QByteArray> roles;
354
355@@ -117,7 +117,7 @@
356
357 void testRoleNamesSetBefore()
358 {
359- QSortFilterProxyModelQML proxy;
360+ UnitySortFilterProxyModelQML proxy;
361 MockListModel model;
362 QHash<int, QByteArray> roles;
363
364@@ -131,7 +131,7 @@
365
366 void testCountSetAfter()
367 {
368- QSortFilterProxyModelQML proxy;
369+ UnitySortFilterProxyModelQML proxy;
370 MockListModel model;
371 model.insertRows(0, 5);
372
373@@ -144,7 +144,7 @@
374
375 void testCountInsert()
376 {
377- QSortFilterProxyModelQML proxy;
378+ UnitySortFilterProxyModelQML proxy;
379 MockListModel model;
380
381 proxy.setModel(&model);
382@@ -158,7 +158,7 @@
383
384 void testCountRemove()
385 {
386- QSortFilterProxyModelQML proxy;
387+ UnitySortFilterProxyModelQML proxy;
388 MockListModel model;
389 model.insertRows(0, 5);
390
391@@ -173,7 +173,7 @@
392 }
393
394 void testInvertMatch() {
395- QSortFilterProxyModelQML proxy;
396+ UnitySortFilterProxyModelQML proxy;
397 MockListModel model;
398
399 proxy.setModel(&model);
400@@ -215,7 +215,7 @@
401 }
402
403 void testNestedProxyRoleNames() {
404- QSortFilterProxyModelQML proxy1, proxy2;
405+ UnitySortFilterProxyModelQML proxy1, proxy2;
406 MockListModel model;
407 QHash<int, QByteArray> roles;
408 roles[0] = "role0";
409@@ -229,7 +229,7 @@
410 }
411
412 void testModelTest() {
413- QSortFilterProxyModelQML proxy;
414+ UnitySortFilterProxyModelQML proxy;
415 MockListModel model;
416
417 proxy.setModel(&model);
418@@ -246,7 +246,7 @@
419 }
420
421 void testModelChanged() {
422- QSortFilterProxyModelQML proxy;
423+ UnitySortFilterProxyModelQML proxy;
424 MockListModel model, model2;
425
426 QSignalSpy spyOnModelChanged(&proxy, SIGNAL(modelChanged()));
427@@ -265,7 +265,7 @@
428 }
429
430 void testData() {
431- QSortFilterProxyModelQML proxy;
432+ UnitySortFilterProxyModelQML proxy;
433 MockListModel model, model2;
434
435 QStringList rows;
436@@ -285,6 +285,6 @@
437 }
438 };
439
440-QTEST_GUILESS_MAIN(QSortFilterProxyModelTest)
441+QTEST_GUILESS_MAIN(UnitySortFilterProxyModelTest)
442
443-#include "qsortfilterproxymodeltest.moc"
444+#include "unitysortfilterproxymodeltest.moc"
445
446=== modified file 'tests/qmltests/Components/tst_ResponsiveVerticalJournal.qml'
447--- tests/qmltests/Components/tst_ResponsiveVerticalJournal.qml 2014-06-17 15:52:19 +0000
448+++ tests/qmltests/Components/tst_ResponsiveVerticalJournal.qml 2014-12-19 14:56:15 +0000
449@@ -79,7 +79,7 @@
450 ListElement { name: "U" }
451 }
452
453- SortFilterProxyModel {
454+ UnitySortFilterProxyModel {
455 id: wrappedFakeModel
456 model: fakeModel
457 }
458
459=== modified file 'tests/qmltests/tst_Shell.qml'
460--- tests/qmltests/tst_Shell.qml 2014-12-11 13:24:26 +0000
461+++ tests/qmltests/tst_Shell.qml 2014-12-19 14:56:15 +0000
462@@ -222,7 +222,7 @@
463
464 notifications.model = mockNotificationsModel;
465
466- // FIXME: Hack: SortFilterProxyModelQML doesn't work with QML ListModels which we use
467+ // FIXME: Hack: UnitySortFilterProxyModelQML doesn't work with QML ListModels which we use
468 // for mocking here (RoleType can't be found in the QML model). As we only need to show
469 // one SnapDecision lets just disable the filtering and make appear any notification as a
470 // SnapDecision.

Subscribers

People subscribed via source and target branches