on xenial help sign in
Removed mock-setup C++ code. All this is now set up by demo-assets gsettings schema override.
c4d05caPawel Stolowski
plugins/Unity/scopes.cpp−42
@@ -119,48 +119,6 @@ void Scopes::onScopesReordered(const unity::dash::Scopes::ScopeList& scopes)
119 //TODO
119 //TODO
120}
120}
121
121
122−void Scopes::loadMocks()
123−{
124− /* FIXME: this is temporary code that is required on mobile to order
125− the lenses according to the design.
126− */
127− QStringList staticScopes;
128− staticScopes << "mockmusic.lens" << "people.lens" << "home.lens" << "applications.lens" << "mockvideos.lens";
129−
130− // not all the lenses are guaranteed to go into the model (only if their UnitCore counterparts exist);
131− // so build up a list of the valid ones, then add them later.
132− QList<unity::dash::Scope::Ptr> added_scopes;
133−
134− // add statically ordered lenses
135− Q_FOREACH(QString lensId, staticScopes) {
136− unity::dash::Scope::Ptr lens = m_unityScopes->GetScope(lensId.toStdString());
137− if (lens != NULL) {
138− added_scopes << lens;
139− }
140− }
141−
142− // add remaining lenses
143− unity::dash::Scopes::ScopeList scopesList = m_unityScopes->GetScopes();
144− for(auto it = scopesList.begin(); it != scopesList.end(); ++it) {
145− unity::dash::Scope::Ptr scope = (*it);
146− if (!staticScopes.contains(QString::fromStdString(scope->id))) {
147− added_scopes << scope;
148− }
149− }
150−
151− if (added_scopes.count() > 0) {
152− int index = rowCount();
153− beginInsertRows(QModelIndex(), index, index+added_scopes.count()-1);
154− Q_FOREACH(unity::dash::Scope::Ptr scope, added_scopes) {
155− addUnityScope(scope);
156− }
157− endInsertRows();
158− }
159−
160− m_loaded = true;
161− Q_EMIT loadedChanged(m_loaded);
162−}
163−
164void Scopes::onScopePropertyChanged()
122void Scopes::onScopePropertyChanged()
165{
123{
166 QModelIndex scopeIndex = index(m_scopes.indexOf(qobject_cast<Scope*>(sender())));
124 QModelIndex scopeIndex = index(m_scopes.indexOf(qobject_cast<Scope*>(sender())));
plugins/Unity/scopes.h−1
@@ -72,7 +72,6 @@ Q_SIGNALS:
72 void loadedChanged(bool loaded);
72 void loadedChanged(bool loaded);
73
73
74private Q_SLOTS:
74private Q_SLOTS:
75− void loadMocks();
76 void onScopeAdded(const unity::dash::Scope::Ptr& scope, int position);
75 void onScopeAdded(const unity::dash::Scope::Ptr& scope, int position);
77 void onScopeRemoved(const unity::dash::Scope::Ptr& scope);
76 void onScopeRemoved(const unity::dash::Scope::Ptr& scope);
78 void onScopesReordered(const unity::dash::Scopes::ScopeList& scopes);
77 void onScopesReordered(const unity::dash::Scopes::ScopeList& scopes);