on xenial help sign in
Fixed beginMoveRows.
86eccccPawel Stolowski
plugins/Unity/categories.cpp+3−1
@@ -108,11 +108,13 @@ void Categories::onCategoryOrderChanged(const std::vector<unsigned int>& cat_ord
108
108
109 if (static_cast<int>(pos) != old_pos) {
109 if (static_cast<int>(pos) != old_pos) {
110 int target_pos = pos;
110 int target_pos = pos;
111+ if (target_pos > old_pos)
112+ target_pos++;
111 const bool status = beginMoveRows(QModelIndex(), old_pos, old_pos, QModelIndex(), target_pos);
113 const bool status = beginMoveRows(QModelIndex(), old_pos, old_pos, QModelIndex(), target_pos);
112 if (status)
114 if (status)
113 m_categoryOrder.move(old_pos, pos);
115 m_categoryOrder.move(old_pos, pos);
114 else
116 else
115− qWarning("beginMoveRows failed");
117+ qWarning() << "beginMoveRows failed:" << old_pos << target_pos;
116 endMoveRows();
118 endMoveRows();
117 }
119 }
118 }
120 }