on xenial help sign in
Make activate more close to what real plugin does
commit99470c3a65f248a8433c6aaa9809fbfc0d8c1afc authorAlbert Astals <albert.astals@canonical.com> dateFri 26 Sep 2014, 16:17 (12 years ago) parent0d3d9b4
1 file changed+6−2
tests/mocks/Unity/fake_scopesoverview.cpp+6−2
tests/mocks/Unity/fake_scopesoverview.cpp+6−2
@@ -44,8 +44,12 @@ void ScopesOverview::setSearchQuery(const QString& search_query)
4444Q_INVOKABLE void ScopesOverview::activate(QVariant const& result)
4545{
4646 Scopes *scopes = dynamic_cast<Scopes*>(parent());
47− m_openScope = scopes->getScopeFromAll(result.toString());
48− Q_EMIT openScope(m_openScope);
47+ if (scopes->getScope(result.toString())) {
48+ Q_EMIT gotoScope(result.toString());
49+ } else {
50+ m_openScope = scopes->getScopeFromAll(result.toString());
51+ Q_EMIT openScope(m_openScope);
52+ }
4953}
5054
5155void ScopesOverview::setFavorite(Scope *scope, bool favorite)