on xenial help sign in
Fixed whitespace.
d4c8a11Pawel Stolowski
plugins/Unity/categories.cpp+5−5
@@ -93,7 +93,7 @@ void Categories::onCategoriesModelChanged(unity::glib::Object<DeeModel> model)
93 delete model;
93 delete model;
94 }
94 }
95 m_results.clear();
95 m_results.clear();
96−
96+
97 setModel(model);
97 setModel(model);
98}
98}
99
99
@@ -108,14 +108,14 @@ void Categories::onCategoryOrderChanged(std::vector<unsigned int> cat_order)
108 qWarning() << "No such category index:" << cat;
108 qWarning() << "No such category index:" << cat;
109 continue;
109 continue;
110 }
110 }
111−
111+
112 if (static_cast<int>(pos) != old_pos) {
112 if (static_cast<int>(pos) != old_pos) {
113 int target_pos = pos;
113 int target_pos = pos;
114 const bool status = beginMoveRows(QModelIndex(), old_pos, old_pos, QModelIndex(), target_pos);
114 const bool status = beginMoveRows(QModelIndex(), old_pos, old_pos, QModelIndex(), target_pos);
115 if (status)
115 if (status)
116 m_categoryOrder.move(old_pos, pos);
116 m_categoryOrder.move(old_pos, pos);
117 else
117 else
118− qWarning("beginMoveRows failed");
118+ qWarning("beginMoveRows failed");
119 endMoveRows();
119 endMoveRows();
120 }
120 }
121 }
121 }
@@ -245,7 +245,7 @@ Categories::data(const QModelIndex& index, int role) const
245 qWarning() << "Invalid index" << index.row();
245 qWarning() << "Invalid index" << index.row();
246 return QVariant();
246 return QVariant();
247 }
247 }
248−
248+
249 const QModelIndex realIndex = createIndex(realRow, index.column());
249 const QModelIndex realIndex = createIndex(realRow, index.column());
250
250
251 switch (role) {
251 switch (role) {
@@ -282,7 +282,7 @@ Categories::data(const QModelIndex& index, int role) const
282 return QVariant::fromValue(m_overriddenCategories[id]);
282 return QVariant::fromValue(m_overriddenCategories[id]);
283 }
283 }
284 return QVariant::fromValue(getResults(realRow));
284 return QVariant::fromValue(getResults(realRow));
285− case RoleCount:
285+ case RoleCount:
286 if (m_overriddenCategories.size() > 0)
286 if (m_overriddenCategories.size() > 0)
287 {
287 {
288 auto id = DeeListModel::data(realIndex, CategoryColumn::ID).toString();
288 auto id = DeeListModel::data(realIndex, CategoryColumn::ID).toString();