Commit fbdcf802 authored by Marco Martin's avatar Marco Martin

map rows to the source model

before comparing new and old row, map the new one to the source model

BUG:386454
parent 68420b50
......@@ -412,13 +412,17 @@ int SidebarMode::activeCategory() const
void SidebarMode::setActiveCategory(int cat)
{
if (d->activeCategory == cat) {
const QModelIndex idx = d->searchModel->index(cat, 0);
d->activeCategoryIndex = idx;
const int newCategoryRow = d->searchModel->mapToSource(idx).row();
if (d->activeCategory ==newCategoryRow) {
return;
}
const QModelIndex idx = d->searchModel->index(cat, 0);
d->activeCategoryIndex = idx;
d->activeCategory = d->searchModel->mapToSource(idx).row();
d->activeCategory = newCategoryRow;
changeModule(idx);
d->activeSubCategory = 0;
emit activeCategoryChanged();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment