From 4a5ff2f2320656366a4c931300626a68c49bd7b6 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Wed, 13 Jan 2021 12:59:57 +0100 Subject: Remove archive parsing attribute from core and use the one from settings directly. --- src/organizercore.h | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'src/organizercore.h') diff --git a/src/organizercore.h b/src/organizercore.h index 905fb111..4ff375b7 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -348,16 +348,6 @@ public: boost::signals2::connection onPluginEnabled(std::function const& func); boost::signals2::connection onPluginDisabled(std::function const& func); - bool getArchiveParsing() const - { - return m_ArchiveParsing; - } - - void setArchiveParsing(bool archiveParsing) - { - m_ArchiveParsing = archiveParsing; - } - public: // IPluginDiagnose interface virtual std::vector activeProblems() const; @@ -505,7 +495,6 @@ private: bool m_DirectoryUpdate; bool m_ArchivesInit; - bool m_ArchiveParsing{ m_Settings.archiveParsing() }; MOBase::DelayedFileWriter m_PluginListsWriter; UsvfsConnector m_USVFS; -- cgit v1.3.1 From 163b33f22817fda6ead29de8f9d9624434766be9 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Wed, 13 Jan 2021 13:00:34 +0100 Subject: Remove unused close() signal from OrganizerCore. Remove declarations without definitions. --- src/mainwindow.cpp | 1 - src/organizercore.h | 14 ++++---------- 2 files changed, 4 insertions(+), 11 deletions(-) (limited to 'src/organizercore.h') diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 70432377..c9824a24 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -436,7 +436,6 @@ MainWindow::MainWindow(Settings &settings connect(&m_PluginContainer, &PluginContainer::pluginUnregistered, this, &MainWindow::onPluginRegistrationChanged); connect(&m_OrganizerCore, &OrganizerCore::modInstalled, this, &MainWindow::modInstalled); - connect(&m_OrganizerCore, &OrganizerCore::close, this, &QMainWindow::close); m_CheckBSATimer.setSingleShot(true); connect(&m_CheckBSATimer, SIGNAL(timeout()), this, SLOT(checkBSAList())); diff --git a/src/organizercore.h b/src/organizercore.h index 4ff375b7..e8b42609 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -386,16 +386,14 @@ public slots: signals: - /** - * @brief emitted after a mod has been installed - * @node this is currently only used for tutorials - */ + // emitted after a mod has been installed + // void modInstalled(const QString &modName); + // emitted when the managed game changes + // void managedGameChanged(MOBase::IPluginGame const *gamePlugin); - void close(); - // emitted when the profile is changed, before notifying plugins // // the new profile can be stored but the old one is temporary and @@ -412,13 +410,9 @@ private: void saveCurrentProfile(); void storeSettings(); - bool queryApi(QString &apiKey); - void updateModActiveState(int index, bool active); void updateModsActiveState(const QList &modIndices, bool active); - bool testForSteam(bool *found, bool *access); - bool createDirectory(const QString &path); QString oldMO1HookDll() const; -- cgit v1.3.1 From c93cf33c8324052b321fc0428c394016abcee115 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Wed, 13 Jan 2021 13:00:54 +0100 Subject: Remove OrganizerCore::modsSortedByProfilePriority. --- src/modlist.cpp | 14 +++++++++++++- src/modlistviewactions.cpp | 4 ++-- src/organizercore.cpp | 16 ---------------- src/organizercore.h | 9 --------- 4 files changed, 15 insertions(+), 28 deletions(-) (limited to 'src/organizercore.h') diff --git a/src/modlist.cpp b/src/modlist.cpp index f820e4d1..d4ffbeff 100644 --- a/src/modlist.cpp +++ b/src/modlist.cpp @@ -900,7 +900,19 @@ QStringList ModList::allModsByProfilePriority(MOBase::IProfile* profile) const { Profile* mo2Profile = profile == nullptr ? m_Organizer->currentProfile() : static_cast(profile); - return m_Organizer->modsSortedByProfilePriority(mo2Profile); + + QStringList res; + for (int i = mo2Profile->getPriorityMinimum(); + i < mo2Profile->getPriorityMinimum() + (int)mo2Profile->numRegularMods(); + ++i) { + int modIndex = mo2Profile->modIndexByPriority(i); + auto modInfo = ModInfo::getByIndex(modIndex); + if (!modInfo->hasFlag(ModInfo::FLAG_OVERWRITE) && + !modInfo->hasFlag(ModInfo::FLAG_BACKUP)) { + res.push_back(ModInfo::getByIndex(modIndex)->internalName()); + } + } + return res; } MOBase::IModInterface* ModList::getMod(const QString& name) const diff --git a/src/modlistviewactions.cpp b/src/modlistviewactions.cpp index cc50f009..63d74192 100644 --- a/src/modlistviewactions.cpp +++ b/src/modlistviewactions.cpp @@ -547,7 +547,7 @@ void ModListViewActions::sendModsToSeparator(const QModelIndexList& index) const int newPriority = std::numeric_limits::max(); bool foundSection = false; - for (auto mod : m_core.modsSortedByProfilePriority(m_core.currentProfile())) { + for (auto mod : m_core.modList()->allModsByProfilePriority()) { unsigned int modIndex = ModInfo::getIndex(mod); ModInfo::Ptr modInfo = ModInfo::getByIndex(modIndex); if (!foundSection && result.compare(mod) == 0) { @@ -1128,7 +1128,7 @@ void ModListViewActions::moveOverwriteContentToExistingMod() const QString modAbsolutePath; - for (const auto& mod : m_core.modsSortedByProfilePriority(m_core.currentProfile())) { + for (const auto& mod : m_core.modList()->allModsByProfilePriority()) { if (result.compare(mod) == 0) { ModInfo::Ptr modInfo = ModInfo::getByIndex(ModInfo::getIndex(mod)); modAbsolutePath = modInfo->absolutePath(); diff --git a/src/organizercore.cpp b/src/organizercore.cpp index 3d730c23..bbf6029b 100644 --- a/src/organizercore.cpp +++ b/src/organizercore.cpp @@ -1016,22 +1016,6 @@ ModList *OrganizerCore::modList() return &m_ModList; } -QStringList OrganizerCore::modsSortedByProfilePriority(Profile *profile) const -{ - QStringList res; - for (int i = profile->getPriorityMinimum(); - i < profile->getPriorityMinimum() + (int)profile->numRegularMods(); - ++i) { - int modIndex = profile->modIndexByPriority(i); - auto modInfo = ModInfo::getByIndex(modIndex); - if (!modInfo->hasFlag(ModInfo::FLAG_OVERWRITE) && - !modInfo->hasFlag(ModInfo::FLAG_BACKUP)) { - res.push_back(ModInfo::getByIndex(modIndex)->internalName()); - } - } - return res; -} - bool OrganizerCore::previewFileWithAlternatives( QWidget* parent, QString fileName, int selectedOrigin) { diff --git a/src/organizercore.h b/src/organizercore.h index e8b42609..7ec4dda8 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -300,15 +300,6 @@ public: static void setGlobalCoreDumpType(env::CoreDumpTypes type); static std::wstring getGlobalCoreDumpPath(); - /** - * @brief Returns the name of all the mods in the priority order of the given profile. - * - * @param profile Profile to use for the mod order. - * - * @return the name of all the mods in the priority order of the given profile. - */ - QStringList modsSortedByProfilePriority(Profile* profile) const; - public: MOBase::IModRepositoryBridge *createNexusBridge() const; QString profileName() const; -- cgit v1.3.1 From ce95d8b1bdcfbf6504e0be1588a42bf0f3e78849 Mon Sep 17 00:00:00 2001 From: Mikaël Capelle Date: Wed, 13 Jan 2021 13:01:11 +0100 Subject: Minor cleaning for boost signal declarations in OrganizerCore. --- src/organizercore.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/organizercore.h') diff --git a/src/organizercore.h b/src/organizercore.h index 7ec4dda8..8add5542 100644 --- a/src/organizercore.h +++ b/src/organizercore.h @@ -65,7 +65,8 @@ private: struct SignalCombinerAnd { - typedef bool result_type; + using result_type = bool; + template bool operator()(InputIterator first, InputIterator last) const { @@ -81,14 +82,14 @@ private: private: - using SignalAboutToRunApplication = boost::signals2::signal; - using SignalFinishedRunApplication = boost::signals2::signal; - using SignalUserInterfaceInitialized = boost::signals2::signal; + using SignalAboutToRunApplication = boost::signals2::signal; + using SignalFinishedRunApplication = boost::signals2::signal; + using SignalUserInterfaceInitialized = boost::signals2::signal; using SignalProfileCreated = boost::signals2::signal; using SignalProfileRenamed = boost::signals2::signal; using SignalProfileRemoved = boost::signals2::signal; - using SignalProfileChanged = boost::signals2::signal; - using SignalPluginSettingChanged = boost::signals2::signal; + using SignalProfileChanged = boost::signals2::signal; + using SignalPluginSettingChanged = boost::signals2::signal; using SignalPluginEnabled = boost::signals2::signal; public: -- cgit v1.3.1