From 9a5965afa73077e541c4d8bdc49f0729b42c482d Mon Sep 17 00:00:00 2001 From: Tannin Date: Tue, 7 Jul 2015 20:52:46 +0200 Subject: bugfix: invalidation bsa wasn't created when switching to a profile that needed it invalidation bsa is now always placed as the first bsa --- src/mainwindow.cpp | 11 ++++++++++- src/organizercore.cpp | 6 ++++++ 2 files changed, 16 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 4ffa044b..466fb1c0 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -67,6 +67,7 @@ along with Mod Organizer. If not, see . #include #include #include +#include #include #include #include @@ -1312,15 +1313,23 @@ void MainWindow::updateBSAList(const QStringList &defaultArchives, const QString std::vector> items; + IPluginGame *gamePlugin = qApp->property("managed_game").value(); + + BSAInvalidation *invalidation = gamePlugin->feature(); + for (FileEntry::Ptr current : m_OrganizerCore.directoryStructure()->getFiles()) { QFileInfo fileInfo(ToQString(current->getName().c_str())); if (fileInfo.suffix().toLower() == "bsa") { - int index = activeArchives.indexOf(fileInfo.fileName()); + int index = activeArchives.indexOf(fileInfo.fileName()) + 2; if (index == -1) { index = 0xFFFF; } + if ((invalidation != nullptr) && invalidation->isInvalidationBSA(fileInfo.fileName())) { + index = 1; + } + QString basename = fileInfo.baseName(); int originId = current->getOrigin(); FilesOrigin &origin = m_OrganizerCore.directoryStructure()->getOriginByID(originId); diff --git a/src/organizercore.cpp b/src/organizercore.cpp index fa1f372c..8b2a755d 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -529,6 +529,12 @@ void OrganizerCore::setCurrentProfile(const QString &profileName) m_CurrentProfile = newProfile; m_ModList.setProfile(newProfile); + if (m_CurrentProfile->invalidationActive(nullptr)) { + m_CurrentProfile->activateInvalidation(); + } else { + m_CurrentProfile->deactivateInvalidation(); + } + connect(m_CurrentProfile, SIGNAL(modStatusChanged(uint)), this, SLOT(modStatusChanged(uint))); refreshDirectoryStructure(); } -- cgit v1.3.1