diff options
| -rw-r--r-- | src/installationmanager.cpp | 6 | ||||
| -rw-r--r-- | src/mainwindow.cpp | 7 | ||||
| -rw-r--r-- | src/pluginlist.cpp | 9 | ||||
| -rw-r--r-- | src/pluginlist.h | 1 |
4 files changed, 16 insertions, 7 deletions
diff --git a/src/installationmanager.cpp b/src/installationmanager.cpp index c865d897..29914b65 100644 --- a/src/installationmanager.cpp +++ b/src/installationmanager.cpp @@ -266,9 +266,11 @@ QStringList InstallationManager::extractFiles(const QStringList &filesOrig, bool IPluginInstaller::EInstallResult InstallationManager::installArchive(GuessedValue<QString> &modName, const QString &archiveName)
{
- GuessedValue<QString> temp(modName);
+ // in earlier versions the modName was copied here and the copy passed to install. I don't know why I did this and it causes
+ // a problem if this is called by the bundle installer and the bundled installer adds additional names that then end up being used,
+ // because the caller will then not have the right name.
bool iniTweaks;
- if (install(archiveName, temp, iniTweaks)) {
+ if (install(archiveName, modName, iniTweaks)) {
return IPluginInstaller::RESULT_SUCCESS;
} else {
return IPluginInstaller::RESULT_FAILED;
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index dd70f9ab..d8e2a84c 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1393,8 +1393,11 @@ void MainWindow::spawnBinary(const QFileInfo &binary, const QString &arguments, this->setEnabled(true);
refreshDirectoryStructure();
+ // need to remove our stored load order because it may be outdated if a foreign tool changed the
+ // file time. After removing that file, refreshESPList will use the file time as the order
if (GameInfo::instance().getLoadOrderMechanism() == GameInfo::TYPE_FILETIME) {
QFile::remove(m_CurrentProfile->getLoadOrderFileName());
+ refreshESPList();
}
}
}
@@ -5485,11 +5488,13 @@ void MainWindow::on_bossButton_clicked() }
m_IntegratedBrowser.openUrl(url);
}
- refreshESPList();
+ // if the game specifies load order by file time, our own load order file needs to be removed because it's outdated.
+ // refreshESPList will then use the file time as the load order.
if (GameInfo::instance().getLoadOrderMechanism() == GameInfo::TYPE_FILETIME) {
QFile::remove(m_CurrentProfile->getLoadOrderFileName());
}
+ refreshESPList();
}
}
diff --git a/src/pluginlist.cpp b/src/pluginlist.cpp index 52d95f24..a2d0d04a 100644 --- a/src/pluginlist.cpp +++ b/src/pluginlist.cpp @@ -65,13 +65,14 @@ bool ByPriority(const PluginList::ESPInfo& LHS, const PluginList::ESPInfo& RHS) }
bool ByDate(const PluginList::ESPInfo& LHS, const PluginList::ESPInfo& RHS) {
- QString lhsExtension = LHS.m_Name.right(3).toLower();
+ return QFileInfo(LHS.m_FullPath).lastModified() < QFileInfo(RHS.m_FullPath).lastModified();
+/* QString lhsExtension = LHS.m_Name.right(3).toLower();
QString rhsExtension = RHS.m_Name.right(3).toLower();
if (lhsExtension != rhsExtension) {
return lhsExtension == "esm";
}
- return ::CompareFileTime(&LHS.m_Time, &RHS.m_Time) < 0;
+ return ::CompareFileTime(&LHS.m_Time, &RHS.m_Time) < 0;*/
}
PluginList::PluginList(QObject *parent)
@@ -1127,8 +1128,8 @@ bool PluginList::eventFilter(QObject *obj, QEvent *event) PluginList::ESPInfo::ESPInfo(const QString &name, bool enabled, FILETIME time,
const QString &originName, const QString &fullPath,
bool hasIni)
- : m_Name(name), m_Enabled(enabled), m_ForceEnabled(enabled),
- m_Priority(0), m_LoadOrder(-1), m_Time(time), m_OriginName(originName), m_HasIni(hasIni)
+ : m_Name(name), m_FullPath(fullPath), m_Enabled(enabled), m_ForceEnabled(enabled),
+ m_Priority(0), m_LoadOrder(-1), m_OriginName(originName), m_HasIni(hasIni)
{
try {
ESP::File file(ToWString(fullPath));
diff --git a/src/pluginlist.h b/src/pluginlist.h index b8e141fc..67d1b640 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -267,6 +267,7 @@ private: ESPInfo(const QString &name, bool enabled, FILETIME time, const QString &originName, const QString &fullPath, bool hasIni);
QString m_Name;
+ QString m_FullPath;
bool m_Enabled;
bool m_ForceEnabled;
int m_Priority;
|
