@@ -198,20 +198,20 @@ void Scopes::setFavorite(const QString& scopeId, bool favorite)
201−void Scopes::moveFavoriteTo(const QString& scopeId, int index)
201+void Scopes::moveFavoriteTo(const QString& scopeId, int to)
203− int origIndex = -1;
203+ int from = -1;
204 for (int i = 0; i < m_scopes.count(); ++i) {
204 for (int i = 0; i < m_scopes.count(); ++i) {
205 if (m_scopes[i]->id() == scopeId) {
205 if (m_scopes[i]->id() == scopeId) {
206− origIndex = i;
206+ from = i;
210− Q_ASSERT(origIndex != -1);
210+ Q_ASSERT(from != -1);
211− beginMoveRows(QModelIndex(), origIndex, origIndex, QModelIndex(), index);
211+ beginMoveRows(QModelIndex(), from, from, QModelIndex(), to + (to > from ? 1 : 0));
212− m_scopes.move(origIndex, index);
212+ m_scopes.move(from, to);
213 endMoveRows();
213 endMoveRows();
214− m_scopesOverview->moveFavoriteTo(m_scopes[index], index);
214+ m_scopesOverview->moveFavoriteTo(m_scopes[to], to);
217QList<Scope*> Scopes::favScopes() const
217QList<Scope*> Scopes::favScopes() const