on xenial help sign in
More fixes
9a577b8Andrea Cimitan
tests/mocks/Unity/fake_previewmodel.cpp+3−2
@@ -88,6 +88,7 @@ void PreviewModel::setLoaded(bool loaded)
88
88
89void PreviewModel::triggeredSlot(QString const&, QString const&, QVariantMap const&) {
89void PreviewModel::triggeredSlot(QString const&, QString const&, QVariantMap const&) {
90 Scopes *scopes = dynamic_cast<Scopes*>(m_scope->parent());
90 Scopes *scopes = dynamic_cast<Scopes*>(m_scope->parent());
91+ Scope* scope = scopes->getScopeFromAll("MockScope9");
91− scopes->addTempScope(scopes->getScopeFromAll("MockScope9"));
92+ scopes->addTempScope(scope);
92− Q_EMIT m_scope->openScope(scopes->getScopeFromAll("MockScope9"));
93+ Q_EMIT m_scope->openScope(scope);
93}
94}
tests/mocks/Unity/fake_scopes.cpp+1−12
@@ -187,19 +187,10 @@ void Scopes::addTempScope(unity::shell::scopes::ScopeInterface* scope)
187
187
188void Scopes::closeScope(unity::shell::scopes::ScopeInterface* scope)
188void Scopes::closeScope(unity::shell::scopes::ScopeInterface* scope)
189{
189{
190+ Q_ASSERT(m_tempScopes.contains(scope));
190 m_tempScopes.remove(scope);
191 m_tempScopes.remove(scope);
191}
192}
192
193
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−
203void Scopes::setFavorite(const QString& scopeId, bool favorite)
194void Scopes::setFavorite(const QString& scopeId, bool favorite)
204{
195{
205 if (favorite) {
196 if (favorite) {
@@ -271,8 +262,6 @@ void Scopes::addScope(Scope* scope)
271 beginInsertRows(QModelIndex(), index, index);
262 beginInsertRows(QModelIndex(), index, index);
272 m_scopes.append(scope);
263 m_scopes.append(scope);
273 endInsertRows();
264 endInsertRows();
274− } else if (!m_tempScopes.contains(scope)) {
275− m_tempScopes.insert(scope);
276 }
265 }
277 m_allScopes.append(scope);
266 m_allScopes.append(scope);
278}
267}
tests/mocks/Unity/fake_scopesoverview.cpp+1
@@ -48,6 +48,7 @@ Q_INVOKABLE void ScopesOverview::activate(QVariant const& result)
48 Q_EMIT gotoScope(result.toString());
48 Q_EMIT gotoScope(result.toString());
49 } else {
49 } else {
50 m_openScope = scopes->getScopeFromAll(result.toString());
50 m_openScope = scopes->getScopeFromAll(result.toString());
51+ scopes->addTempScope(m_openScope);
51 Q_EMIT openScope(m_openScope);
52 Q_EMIT openScope(m_openScope);
52 }
53 }
53}
54}
tests/qmltests/Dash/tst_Dash.qml−1
@@ -483,7 +483,6 @@ Item {
483 var openButton = findChild(widget, "buttonopen_click");
483 var openButton = findChild(widget, "buttonopen_click");
484 mouseClick(openButton);
484 mouseClick(openButton);
485
485
486− //dashTempScopeItem.scope.activate("Result.2.2");
487 tryCompare(subPageLoader, "open", false);
486 tryCompare(subPageLoader, "open", false);
488 compare(dashTempScopeItem.scope.id, "MockScope9");
487 compare(dashTempScopeItem.scope.id, "MockScope9");
489
488