| 85 | } |
| 86 | |
| 87 | void ModListViewActions::installMod(const QString& archivePath, |
| 88 | const QModelIndex& index) const |
| 89 | { |
| 90 | try { |
| 91 | QString path = archivePath; |
| 92 | if (path.isEmpty()) { |
| 93 | QStringList extensions = m_core.installationManager()->getSupportedExtensions(); |
| 94 | for (auto iter = extensions.begin(); iter != extensions.end(); ++iter) { |
| 95 | *iter = "*." + *iter; |
| 96 | } |
| 97 | |
| 98 | path = FileDialogMemory::getOpenFileName( |
| 99 | "installMod", m_parent, tr("Choose Mod"), QString(), |
| 100 | tr("Mod Archive").append(QString(" (%1)").arg(extensions.join(" ")))); |
| 101 | } |
| 102 | |
| 103 | if (path.isEmpty()) { |
| 104 | return; |
| 105 | } else { |
| 106 | m_core.installMod(path, findInstallPriority(index), false, nullptr, QString()); |
| 107 | } |
| 108 | } catch (const std::exception& e) { |
| 109 | reportError(e.what()); |
| 110 | } |
| 111 | } |
| 112 | |
| 113 | void ModListViewActions::createEmptyMod(const QModelIndex& index) const |
| 114 | { |
no test coverage detected