on xenial help sign in
Make activate more close to what real plugin does
99470c3Albert Astals
tests/mocks/Unity/fake_scopesoverview.cpp+6−2
@@ -44,8 +44,12 @@ void ScopesOverview::setSearchQuery(const QString& search_query)
44Q_INVOKABLE void ScopesOverview::activate(QVariant const& result)
44Q_INVOKABLE void ScopesOverview::activate(QVariant const& result)
45{
45{
46 Scopes *scopes = dynamic_cast<Scopes*>(parent());
46 Scopes *scopes = dynamic_cast<Scopes*>(parent());
47+ if (scopes->getScope(result.toString())) {
48+ Q_EMIT gotoScope(result.toString());
49+ } else {
47− m_openScope = scopes->getScopeFromAll(result.toString());
50+ m_openScope = scopes->getScopeFromAll(result.toString());
48− Q_EMIT openScope(m_openScope);
51+ Q_EMIT openScope(m_openScope);
52+ }
49}
53}
50
54
51void ScopesOverview::setFavorite(Scope *scope, bool favorite)
55void ScopesOverview::setFavorite(Scope *scope, bool favorite)