@@ -109,25 +109,15 @@ void Categories::onCategoryOrderChanged(std::vector<unsigned int> cat_order)
109109 }
110110
111111 if (static_cast<int>(pos) != old_pos) {
112− m_categoryOrder.move(old_pos, pos);
113112 int target_pos = pos;
114− //if (pos > old_pos)
115− // target_pos = target_pos - old_pos;
116− bool status = beginMoveRows(QModelIndex(), old_pos, old_pos, QModelIndex(), target_pos);
117− if (status != true)
118− qWarning("!!!!!!!!!!!!!!!!!!!!!!!");
119−
120− qDebug() << "Moving category" << cat <<
121− DeeListModel::data(createIndex(cat, 0),CategoryColumn::DISPLAY_NAME).toString()
122− << ":" << old_pos << "->" << pos << target_pos << "g";
113+ const bool status = beginMoveRows(QModelIndex(), old_pos, old_pos, QModelIndex(), target_pos);
114+ if (status)
115+ m_categoryOrder.move(old_pos, pos);
116+ else
117+ qWarning("beginMoveRows failed");
123118 endMoveRows();
124119 }
125120 }
126−
127− Q_FOREACH(auto cat, m_categoryOrder)
128− {
129− qDebug() << "Category" << DeeListModel::data(createIndex(cat, 0),CategoryColumn::DISPLAY_NAME).toString();
130− }
131121}
132122
133123void
@@ -150,7 +140,6 @@ Categories::onCountChanged()
150140 if (results) {
151141 if (!m_updatedCategories.contains(results->categoryIndex())) {
152142 m_updatedCategories << results->categoryIndex();
153− qDebug() << "Updated count of" << results->categoryIndex();
154143 }
155144 m_timer.start();
156145 }
@@ -158,7 +147,6 @@ Categories::onCountChanged()
158147
159148void Categories::onRowCountChanged()
160149{
161− qDebug() << "Overriden model updated";
162150 QAbstractItemModel* model = qobject_cast<QAbstractItemModel*>(sender());
163151 // find the corresponding category index
164152 for (auto iter = m_overriddenCategories.begin(); iter != m_overriddenCategories.end(); ++iter) {
@@ -170,7 +158,6 @@ void Categories::onRowCountChanged()
170158 QVector<int> roles;
171159 roles.append(RoleCount);
172160 QModelIndex changedIndex = index(i);
173− qDebug() << "Overriden model" << id << "count update at index" << i;
174161 Q_EMIT dataChanged(changedIndex, changedIndex, roles);
175162 break;
176163 }
@@ -295,11 +282,9 @@ Categories::data(const QModelIndex& index, int role) const
295282 auto id = DeeListModel::data(realIndex, CategoryColumn::ID).toString();
296283 if (m_overriddenCategories.find(id) != m_overriddenCategories.end())
297284 {
298− qDebug() << "Get count of overriden cat" << realRow << id << "at pos" << index.row() << "Count=" << m_overriddenCategories[id]->rowCount();
299285 return QVariant::fromValue(m_overriddenCategories[id]->rowCount());
300286 }
301287 }
302− qDebug() << "Get count of cat" << DeeListModel::data(realIndex, CategoryColumn::ID).toString() << realRow << "at pos" << index.row() << "Count=" << getResults(realIndex.row())->rowCount();
303288 return QVariant::fromValue(getResults(realRow)->rowCount());
304289 default:
305290 return QVariant();