diff options
Diffstat (limited to 'src/mainwindow.cpp')
| -rw-r--r-- | src/mainwindow.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4ba3f2dc..3cf2846e 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2392,8 +2392,15 @@ void MainWindow::refreshFilters() ui->modList->setCurrentIndex(QModelIndex()); // save previous filter text so we can restore it later, in case the filter still exists then - QTreeWidgetItem *currentItem = ui->categoriesList->currentItem(); - QString previousFilter = currentItem != NULL ? currentItem->text(0) : tr("<All>"); +// QTreeWidgetItem *currentItem = ui->categoriesList->currentItem(); +// QString previousFilter = currentItem != NULL ? currentItem->text(0) : tr("<All>"); + + + QStringList selectedItems; + foreach (QTreeWidgetItem *item, ui->categoriesList->selectedItems()) { + selectedItems.append(item->text(0)); + } + ui->categoriesList->clear(); addFilterItem(NULL, tr("<Checked>"), CategoryFactory::CATEGORY_SPECIAL_CHECKED); @@ -2417,13 +2424,10 @@ void MainWindow::refreshFilters() addCategoryFilters(NULL, categoriesUsed, 0); - QList<QTreeWidgetItem*> matches = ui->categoriesList->findItems(previousFilter, Qt::MatchFixedString | Qt::MatchRecursive); - if (matches.size() > 0) { - QTreeWidgetItem *currentItem = matches.at(0); - ui->categoriesList->setCurrentItem(currentItem); - while (currentItem != NULL) { - currentItem->setExpanded(true); - currentItem = currentItem->parent(); + foreach (const QString &item, selectedItems) { + QList<QTreeWidgetItem*> matches = ui->categoriesList->findItems(item, Qt::MatchFixedString | Qt::MatchRecursive); + if (matches.size() > 0) { + matches.at(0)->setSelected(true); } } @@ -2434,10 +2438,6 @@ void MainWindow::refreshFilters() void MainWindow::renameMod_clicked() { try { -/* QModelIndex treeIdx = m_ModListGroupProxy->mapFromSource(m_ModListSortProxy->mapFromSource(m_ModList.index(m_ContextRow, 0))); - ui->modList->setCurrentIndex(treeIdx); - ui->modList->edit(treeIdx);*/ - ui->modList->edit(ui->modList->currentIndex()); } catch (const std::exception &e) { reportError(tr("failed to rename mod: %1").arg(e.what())); |
