diff options
| author | Tannin <devnull@localhost> | 2013-05-22 20:48:23 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-05-22 20:48:23 +0200 |
| commit | 2c4ba2c62cc7acce44d89948e7fb669d5a59b968 (patch) | |
| tree | d757169f8b587842b16377d77d1544b4062edcc0 /src/mainwindow.cpp | |
| parent | f0ba6ce95c1f30524453ce996fa536a888f018da (diff) | |
| parent | 0ae7d4753cf607d5de11f0f2b53be478d021cfcd (diff) | |
Merge
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())); |
