summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLostDragonist <lost.dragonist@gmail.com>2018-07-16 15:35:11 -0500
committerLostDragonist <lost.dragonist@gmail.com>2018-07-16 15:46:44 -0500
commit952f1fe8cd6dda5f97fd29fce9e7e8372093c3f4 (patch)
tree1a241688c88d71cb171bbbb49b50a98027e3b303 /src
parentb4530eb84321f684e0ad764ed3cdafbbd9e4315c (diff)
Allow "open in explorer" to work with multiple mods
Diffstat (limited to 'src')
-rw-r--r--src/mainwindow.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 5041f661..dc4ede28 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -2683,9 +2683,17 @@ void MainWindow::visitWebPage_clicked()
void MainWindow::openExplorer_clicked()
{
- ModInfo::Ptr modInfo = ModInfo::getByIndex(m_ContextRow);
-
- ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+ QItemSelectionModel *selection = ui->modList->selectionModel();
+ if (selection->hasSelection() && selection->selectedRows().count() > 1) {
+ for (QModelIndex idx : selection->selectedRows()) {
+ ModInfo::Ptr info = ModInfo::getByIndex(idx.data(Qt::UserRole + 1).toInt());
+ ::ShellExecuteW(nullptr, L"explore", ToWString(info->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+ }
+ }
+ else {
+ ModInfo::Ptr modInfo = ModInfo::getByIndex(m_ContextRow);
+ ::ShellExecuteW(nullptr, L"explore", ToWString(modInfo->absolutePath()).c_str(), nullptr, nullptr, SW_SHOWNORMAL);
+ }
}
void MainWindow::openExplorer_activated()