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

Proposed by Albert Astals Cid
Status: Merged
Approved by: Andrea Cimitan
Approved revision: 2005
Merged at revision: 2052
Proposed branch: lp:~aacid/unity8/dash_reset_instead_of_fatal
Merge into: lp:unity8
Diff against target: 162 lines (+17/-22)
10 files modified
plugins/Dash/horizontaljournal.cpp (+3/-1)
plugins/Dash/organicgrid.cpp (+3/-1)
plugins/Dash/verticaljournal.cpp (+3/-1)
tests/mocks/Unity/CMakeLists.txt (+1/-1)
tests/mocks/Unity/fake_categories.cpp (+0/-5)
tests/mocks/Unity/fake_categories.h (+0/-1)
tests/mocks/Unity/fake_scope.cpp (+5/-0)
tests/mocks/Unity/fake_scope.h (+2/-0)
tests/mocks/Unity/fake_scopesoverview.cpp (+0/-10)
tests/mocks/Unity/fake_scopesoverview.h (+0/-2)
To merge this branch: bzr merge lp:~aacid/unity8/dash_reset_instead_of_fatal
Reviewer Review Type Date Requested Status
Michael Zanetti (community) Needs Information
Andrea Cimitan (community) Approve
PS Jenkins bot (community) continuous-integration Needs Fixing
Review via email: mp+274363@code.launchpad.net

Commit message

Reset instead of qFatal when removing things from the middle

This can be optimized but let's see how this behaves, at least we won't qFatal anymore :D

Description of the change

* Are there any related MPs required for this MP to build/function as expected?
https://code.launchpad.net/~stolowski/unity-api/scope-activate-action/+merge/273557
https://code.launchpad.net/~stolowski/unity-scopes-shell/diff-updates/+merge/273554

 * 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.
2003. By Albert Astals Cid

increase deps for easier building in silo

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:2002
http://jenkins.qa.ubuntu.com/job/unity8-ci/6468/
Executed test runs:
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-vivid-touch/4635
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-wily-touch/850
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-vivid/1180
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity-phablet-qmluitests-wily/499
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-amd64-ci/1075
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-vivid-i386-ci/1076
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-amd64-ci/707
    SUCCESS: http://jenkins.qa.ubuntu.com/job/unity8-wily-i386-ci/708
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-vivid-mako/3739
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4632
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-vivid-armhf/4632/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24178
    UNSTABLE: http://jenkins.qa.ubuntu.com/job/generic-deb-autopilot-runner-wily-mako/503
    SUCCESS: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/850
        deb: http://jenkins.qa.ubuntu.com/job/generic-mediumtests-builder-wily-armhf/850/artifact/work/output/*zip*/output.zip
    SUCCESS: http://s-jenkins.ubuntu-ci:8080/job/touch-flash-device/24177

Click here to trigger a rebuild:
http://s-jenkins.ubuntu-ci:8080/job/unity8-ci/6468/rebuild

review: Needs Fixing (continuous-integration)
2004. By Albert Astals Cid

Adapt to unity-api changes

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
2005. By Albert Astals Cid

Merge

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Andrea Cimitan (cimi) wrote :

 * Did you perform an exploratory manual test run of the code change and any related functionality?
y
 * Did CI run pass? If not, please explain why.
unrelated
 * Did you make sure that the branch does not contain spurious tags?
y

review: Approve
Revision history for this message
Michael Zanetti (mzanetti) wrote :

Needs information on the prerequisite branches. It just points to an abandoned silo. Which of them are needed? Should they be landed by us?

review: Needs Information

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'plugins/Dash/horizontaljournal.cpp'
2--- plugins/Dash/horizontaljournal.cpp 2015-09-14 09:11:08 +0000
3+++ plugins/Dash/horizontaljournal.cpp 2015-10-26 13:52:18 +0000
4@@ -199,7 +199,9 @@
5 m_lastInRowIndexPosition.remove(indexToRemove);
6 } else {
7 if (indexToRemove < lastIndex) {
8- qFatal("HorizontalJournal only supports removal from the end of the model");
9+ qDebug() << "HorizontalJournal only supports removal from the end of the model, resetting instead";
10+ cleanupExistingItems();
11+ break;
12 } else {
13 setImplicitHeightDirty();
14 }
15
16=== modified file 'plugins/Dash/organicgrid.cpp'
17--- plugins/Dash/organicgrid.cpp 2015-09-14 09:11:08 +0000
18+++ plugins/Dash/organicgrid.cpp 2015-10-26 13:52:18 +0000
19@@ -250,7 +250,9 @@
20 releaseItem(m_visibleItems.takeLast());
21 } else {
22 if (indexToRemove < lastIndex) {
23- qFatal("OrganicGrid only supports removal from the end of the model");
24+ qDebug() << "OrganicGrid only supports removal from the end of the model, resetting instead";
25+ cleanupExistingItems();
26+ break;
27 }
28 }
29 }
30
31=== modified file 'plugins/Dash/verticaljournal.cpp'
32--- plugins/Dash/verticaljournal.cpp 2015-09-14 09:11:08 +0000
33+++ plugins/Dash/verticaljournal.cpp 2015-10-26 13:52:18 +0000
34@@ -265,7 +265,9 @@
35 }
36 if (!found) {
37 if (indexToRemove < lastCreatedIndex) {
38- qFatal("VerticalJournal only supports removal from the end of the model");
39+ qDebug() << "VerticalJournal only supports removal from the end of the model, resetting instead";
40+ cleanupExistingItems();
41+ break;
42 } else {
43 setImplicitHeightDirty();
44 }
45
46=== modified file 'tests/mocks/Unity/CMakeLists.txt'
47--- tests/mocks/Unity/CMakeLists.txt 2015-08-06 13:06:10 +0000
48+++ tests/mocks/Unity/CMakeLists.txt 2015-10-26 13:52:18 +0000
49@@ -7,7 +7,7 @@
50 add_subdirectory(DashCommunicator)
51
52 pkg_search_module(GOBJECT gobject-2.0 REQUIRED)
53-pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=7)
54+pkg_check_modules(SCOPES_API REQUIRED unity-shell-scopes=8)
55
56 include_directories(
57 ${CMAKE_CURRENT_BINARY_DIR}
58
59=== modified file 'tests/mocks/Unity/fake_categories.cpp'
60--- tests/mocks/Unity/fake_categories.cpp 2014-08-20 08:44:08 +0000
61+++ tests/mocks/Unity/fake_categories.cpp 2015-10-26 13:52:18 +0000
62@@ -32,11 +32,6 @@
63 return m_category_count;
64 }
65
66-void Categories::addSpecialCategory(QString const& /*categoryId*/, QString const& /*name*/, QString const& /*icon*/, QString const& /*rawTemplate*/, QObject* /*countObject*/)
67-{
68- qFatal("Using un-implemented Categories::addSpecialCategory");
69-}
70-
71 bool Categories::overrideCategoryJson(QString const& /* categoryId */, QString const& /* json */)
72 {
73 qFatal("Using un-implemented Categories::overrideCategoryJson");
74
75=== modified file 'tests/mocks/Unity/fake_categories.h'
76--- tests/mocks/Unity/fake_categories.h 2014-08-19 15:59:49 +0000
77+++ tests/mocks/Unity/fake_categories.h 2015-10-26 13:52:18 +0000
78@@ -34,7 +34,6 @@
79 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
80 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
81
82- Q_INVOKABLE void addSpecialCategory(QString const& categoryId, QString const& name, QString const& icon, QString const& rawTemplate, QObject* countObject) override;
83 Q_INVOKABLE bool overrideCategoryJson(QString const& categoryId, QString const& json) override;
84
85 Q_INVOKABLE QVariant data(int row, int role) const;
86
87=== modified file 'tests/mocks/Unity/fake_scope.cpp'
88--- tests/mocks/Unity/fake_scope.cpp 2015-09-22 12:57:08 +0000
89+++ tests/mocks/Unity/fake_scope.cpp 2015-10-26 13:52:18 +0000
90@@ -271,6 +271,11 @@
91 Q_EMIT refreshed();
92 }
93
94+void Scope::activateAction(QVariant const& /*result*/, QString const& /*categoryId*/, QString const& /*actionId*/)
95+{
96+ qFatal("Using Scope::activateAction");
97+}
98+
99 unity::shell::scopes::NavigationInterface* Scope::getNavigation(const QString& id)
100 {
101 if (id.isEmpty())
102
103=== modified file 'tests/mocks/Unity/fake_scope.h'
104--- tests/mocks/Unity/fake_scope.h 2015-07-08 09:40:35 +0000
105+++ tests/mocks/Unity/fake_scope.h 2015-10-26 13:52:18 +0000
106@@ -79,6 +79,8 @@
107
108 Q_INVOKABLE void refresh() override;
109
110+ Q_INVOKABLE virtual void activateAction(QVariant const& result, QString const& categoryId, QString const& actionId) override;
111+
112 Q_SIGNALS:
113 // These are not in the Interface, here for testing benefits
114 void refreshed();
115
116=== modified file 'tests/mocks/Unity/fake_scopesoverview.cpp'
117--- tests/mocks/Unity/fake_scopesoverview.cpp 2015-09-30 13:09:38 +0000
118+++ tests/mocks/Unity/fake_scopesoverview.cpp 2015-10-26 13:52:18 +0000
119@@ -74,11 +74,6 @@
120 return 2;
121 }
122
123-void ScopesOverviewCategories::addSpecialCategory(QString const&, QString const&, QString const&, QString const&, QObject*)
124-{
125- qFatal("Using un-implemented ScopesOverviewCategories::addSpecialCategory");
126-}
127-
128 bool ScopesOverviewCategories::overrideCategoryJson(QString const& /* categoryId */, QString const& /* json */)
129 {
130 qFatal("Using un-implemented ScopesOverviewCategories::overrideCategoryJson");
131@@ -175,11 +170,6 @@
132 return 2;
133 }
134
135-void ScopesOverviewSearchCategories::addSpecialCategory(QString const&, QString const&, QString const&, QString const&, QObject*)
136-{
137- qFatal("Using un-implemented ScopesOverviewSearchCategories::addSpecialCategory");
138-}
139-
140 bool ScopesOverviewSearchCategories::overrideCategoryJson(QString const& /* categoryId */, QString const& /* json */)
141 {
142 qFatal("Using un-implemented ScopesOverviewSearchCategories::overrideCategoryJson");
143
144=== modified file 'tests/mocks/Unity/fake_scopesoverview.h'
145--- tests/mocks/Unity/fake_scopesoverview.h 2015-07-08 09:40:35 +0000
146+++ tests/mocks/Unity/fake_scopesoverview.h 2015-10-26 13:52:18 +0000
147@@ -53,7 +53,6 @@
148 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
149 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
150
151- Q_INVOKABLE void addSpecialCategory(QString const& categoryId, QString const& name, QString const& icon, QString const& rawTemplate, QObject* countObject) override;
152 Q_INVOKABLE bool overrideCategoryJson(QString const& categoryId, QString const& json) override;
153
154 // This is implementation detail
155@@ -76,7 +75,6 @@
156 QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
157 int rowCount(const QModelIndex& parent = QModelIndex()) const override;
158
159- Q_INVOKABLE void addSpecialCategory(QString const& categoryId, QString const& name, QString const& icon, QString const& rawTemplate, QObject* countObject) override;
160 Q_INVOKABLE bool overrideCategoryJson(QString const& categoryId, QString const& json) override;
161
162 private:

Subscribers

People subscribed via source and target branches