Fix effects not draggable when switching category and search is not empty

BUG: 356626
parent 60ca33bb
......@@ -231,10 +231,14 @@ void EffectsListView::filterList()
m_removeAction->setText(i18n("Delete effect"));
m_effectsList->setIndentation(0);
m_effectsList->setRootOnCustomFolder();
search_effect->updateSearch();
QString currentSearch = search_effect->text();
if (!currentSearch.isEmpty()) {
// There seems to be a problem with KTreeWidgetSearchLine when inserting items, so reset the search
search_effect->updateSearch(" ");
search_effect->updateSearch(currentSearch);
}
return;
}
m_effectsList->resetRoot();
if (pos == EffectsListWidget::EFFECT_FAVORITES) {
m_removeAction->setText(i18n("Remove from favorites"));
......@@ -253,11 +257,15 @@ void EffectsListView::filterList()
}
}
m_effectsList->createFavorites(favorites);
m_effectsList->setIndentation(0);
search_effect->updateSearch();
QString currentSearch = search_effect->text();
if (!currentSearch.isEmpty()) {
// There seems to be a problem with KTreeWidgetSearchLine when inserting items, so reset the search
search_effect->updateSearch(" ");
search_effect->updateSearch(currentSearch);
}
return;
}
m_effectsList->resetRoot();
// Normal tree view
if (m_effectsList->indentation() == 0) {
m_effectsList->setIndentation(10);
......
......@@ -486,19 +486,23 @@ void EffectsListWidget::createFavorites(QList <QTreeWidgetItem *>list)
// Favorites is a pseudo-folder used to store items, not visible to end user, so don't i18n its name
QTreeWidgetItem *misc = findFolder("Favorites");
if (misc == NULL) {
<<<<<<< HEAD
misc = new QTreeWidgetItem((QTreeWidget*)0, QStringList("Favorites"));
=======
misc = new QTreeWidgetItem(this, QStringList(QStringLiteral("Favorites")));
>>>>>>> 298c656... Fix effects not draggable when switching category and search is not empty
misc->setData(0, TypeRole, QString::number((int) EFFECT_FOLDER));
misc->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
insertTopLevelItem(0, misc);
}
else qDeleteAll(misc->takeChildren());
setRootIndex(indexFromItem(misc));
setIndentation(0);
misc->addChildren(list);
for (int j = 0; j < misc->childCount(); ++j) {
QTreeWidgetItem *child = misc->child(j);
child->setHidden(false);
child->setData(0, Qt::UserRole, EFFECT_FAVORITES);
}
setRootIndex(indexFromItem(misc));
}
void EffectsListWidget::resetFavorites()
......
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