MCPcopy Create free account
hub / github.com/ModOrganizer2/modorganizer / installMod

Method installMod

src/modlistviewactions.cpp:87–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

85}
86
87void 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
113void ModListViewActions::createEmptyMod(const QModelIndex& index) const
114{

Callers 1

reinstallModMethod · 0.45

Calls 7

QStringClass · 0.85
installationManagerMethod · 0.80
isEmptyMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected