+void EffectsListView::slotUpdateSearch(QTreeWidgetItem *item, bool hidden)
+{
+ if (!hidden) {
+ if (item->data(0, Qt::UserRole).toInt() == type_combo->currentIndex()) {
+ if (item->parent())
+ item->parent()->setHidden(false);
+ } else {
+ if (type_combo->currentIndex() != 0)
+ item->setHidden(true);
+ }
+ }
+}
+
+void EffectsListView::slotAutoExpand(QString text)
+{
+ search_effect->updateSearch();
+
+ for (int i = 0; i < m_effectsList->topLevelItemCount(); ++i) {
+ QTreeWidgetItem *folder = m_effectsList->topLevelItem(i);
+ bool expandFolder = false;
+ /*if (folder->isHidden())
+ continue;*/
+ if (!text.isEmpty()) {
+ for (int j = 0; j < folder->childCount(); j++) {
+ QTreeWidgetItem *item = folder->child(j);
+ if (!item->isHidden())
+ expandFolder = true;
+ }
+ }
+ folder->setExpanded(expandFolder);
+ }
+}
+