on xenial help sign in
More fixes
commit9a577b88adef00b06143443bfb99055743c6583d authorAndrea Cimitan <andrea.cimitan@gmail.com> dateThu 12 Feb 2015, 10:33 (12 years ago) parentbf1bba2
4 files changed+5−15
tests/mocks/Unity/fake_previewmodel.cpp+3−2 tests/mocks/Unity/fake_scopes.cpp+1−12 tests/mocks/Unity/fake_scopesoverview.cpp+1 tests/qmltests/Dash/tst_Dash.qml−1
tests/mocks/Unity/fake_previewmodel.cpp+3−2
@@ -88,6 +88,7 @@ void PreviewModel::setLoaded(bool loaded)
8888
8989void PreviewModel::triggeredSlot(QString const&, QString const&, QVariantMap const&) {
9090 Scopes *scopes = dynamic_cast<Scopes*>(m_scope->parent());
91− scopes->addTempScope(scopes->getScopeFromAll("MockScope9"));
92− Q_EMIT m_scope->openScope(scopes->getScopeFromAll("MockScope9"));
91+ Scope* scope = scopes->getScopeFromAll("MockScope9");
92+ scopes->addTempScope(scope);
93+ Q_EMIT m_scope->openScope(scope);
9394}
tests/mocks/Unity/fake_scopes.cpp+1−12
@@ -187,19 +187,10 @@ void Scopes::addTempScope(unity::shell::scopes::ScopeInterface* scope)
187187
188188void Scopes::closeScope(unity::shell::scopes::ScopeInterface* scope)
189189{
190+ Q_ASSERT(m_tempScopes.contains(scope));
190191 m_tempScopes.remove(scope);
191192}
192193
193−unity::shell::scopes::ScopeInterface* Scopes::findTempScope(QString const& id) const
194−{
195− for (auto s: m_tempScopes) {
196− if (s->id() == id) {
197− return s;
198− }
199− }
200− return nullptr;
201−}
202−
203194void Scopes::setFavorite(const QString& scopeId, bool favorite)
204195{
205196 if (favorite) {
@@ -271,8 +262,6 @@ void Scopes::addScope(Scope* scope)
271262 beginInsertRows(QModelIndex(), index, index);
272263 m_scopes.append(scope);
273264 endInsertRows();
274− } else if (!m_tempScopes.contains(scope)) {
275− m_tempScopes.insert(scope);
276265 }
277266 m_allScopes.append(scope);
278267}
tests/mocks/Unity/fake_scopesoverview.cpp+1
@@ -48,6 +48,7 @@ Q_INVOKABLE void ScopesOverview::activate(QVariant const& result)
4848 Q_EMIT gotoScope(result.toString());
4949 } else {
5050 m_openScope = scopes->getScopeFromAll(result.toString());
51+ scopes->addTempScope(m_openScope);
5152 Q_EMIT openScope(m_openScope);
5253 }
5354}
tests/qmltests/Dash/tst_Dash.qml−1
@@ -483,7 +483,6 @@ Item {
483483 var openButton = findChild(widget, "buttonopen_click");
484484 mouseClick(openButton);
485485
486− //dashTempScopeItem.scope.activate("Result.2.2");
487486 tryCompare(subPageLoader, "open", false);
488487 compare(dashTempScopeItem.scope.id, "MockScope9");
489488