@@ -49,9 +49,9 @@ Scopes::~Scopes()
4949void Scopes::updateScopes()
5050{
5151 clear();
52− addScope(new Scope("MockScope1", "People", true, this));
5352 addScope(new Scope("MockScope2", "Music", false, this));
5453 addScope(new Scope("clickscope", "Apps", true, this));
54+ addScope(new Scope("MockScope1", "People", true, this));
5555 addScope(new Scope("MockScope5", "Videos", true, this));
5656 addScope(new Scope("SingleCategoryScope", "Single", true, this, 1));
5757 addScope(new Scope("MockScope4", "MS4", true, this));
@@ -198,6 +198,22 @@ void Scopes::setFavorite(const QString& scopeId, bool favorite)
198198 }
199199}
200200
201+void Scopes::moveFavoriteTo(const QString& scopeId, int index)
202+{
203+ int origIndex = -1;
204+ for (int i = 0; i < m_scopes.count(); ++i) {
205+ if (m_scopes[i]->id() == scopeId) {
206+ origIndex = i;
207+ break;
208+ }
209+ }
210+ Q_ASSERT(origIndex != -1);
211+ beginMoveRows(QModelIndex(), origIndex, origIndex, QModelIndex(), index);
212+ m_scopes.move(origIndex, index);
213+ endMoveRows();
214+ m_scopesOverview->moveFavoriteTo(m_scopes[index], index);
215+}
216+
201217QList<Scope*> Scopes::favScopes() const
202218{
203219 return m_scopes;