diff options
| author | Tannin <devnull@localhost> | 2013-05-25 12:26:13 +0200 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2013-05-25 12:26:13 +0200 |
| commit | 3c21d1884a499066785e70dc44a869cb8b2d589d (patch) | |
| tree | f722d7ca296ddbefe2fbd4e32fbfce624794db5b /src/mainwindow.cpp | |
| parent | 16bda49e0667f77f4ebe1d8fa2682abf57aa6765 (diff) | |
| parent | 2c4ba2c62cc7acce44d89948e7fb669d5a59b968 (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 9c0559c7..4ac883e9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -2403,8 +2403,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); @@ -2428,13 +2435,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); } } @@ -2445,10 +2449,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())); |
