Skip to content

Commit b66e432

Browse files
authored
Update installationmanager.cpp
1 parent 3da96c3 commit b66e432

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/installationmanager.cpp

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
3535
#include "settings.h"
3636
#include <scopeguard.h>
3737
#include <utility.h>
38+
#include "shared/util.h"
3839

3940
#include <QApplication>
4041
#include <QDateTime>
@@ -632,6 +633,7 @@ InstallationResult InstallationManager::install(const QString& fileName,
632633
});
633634

634635
QFileInfo fileInfo(fileName);
636+
QString url;
635637
if (!getSupportedExtensions().contains(fileInfo.suffix(), Qt::CaseInsensitive)) {
636638
reportError(tr("File format \"%1\" not supported").arg(fileInfo.suffix()));
637639
return InstallationResult(IPluginInstaller::RESULT_FAILED);
@@ -655,6 +657,7 @@ InstallationResult InstallationManager::install(const QString& fileName,
655657
QSettings metaFile(metaName, QSettings::IniFormat);
656658
gameName = metaFile.value("gameName", "").toString();
657659
modID = metaFile.value("modID", 0).toInt();
660+
url = metaFile.value("url", "").toString();
658661
QTextDocument doc;
659662
doc.setHtml(metaFile.value("name", "").toString());
660663
modName.update(doc.toPlainText(), GUESS_FALLBACK);
@@ -700,8 +703,14 @@ InstallationResult InstallationManager::install(const QString& fileName,
700703
// information
701704
QString guessedModName;
702705
int guessedModID = modID;
703-
NexusInterface::interpretNexusFileName(QFileInfo(fileName).fileName(),
704-
guessedModName, guessedModID, false);
706+
707+
if (isNxmLink(url))
708+
NexusInterface::interpretNexusFileName(QFileInfo(fileName).fileName(),
709+
guessedModName, guessedModID, false);
710+
else
711+
NexusInterface::interpretNonNexusFileName(QFileInfo(fileName).fileName(),
712+
guessedModName, guessedModID, false);
713+
705714
if ((modID == 0) && (guessedModID != -1)) {
706715
modID = guessedModID;
707716
} else if (modID != guessedModID) {

0 commit comments

Comments
 (0)