From b0e3e86a61770c3d6c18161b05c745f30f1a2cb3 Mon Sep 17 00:00:00 2001 From: Tannin Date: Fri, 6 May 2016 23:39:08 +0200 Subject: moved plugins.txt reading/writing to game plugin --- src/pluginlist.h | 34 ++++++---------------------------- 1 file changed, 6 insertions(+), 28 deletions(-) (limited to 'src/pluginlist.h') diff --git a/src/pluginlist.h b/src/pluginlist.h index 9fe6eeac..2c2ba295 100644 --- a/src/pluginlist.h +++ b/src/pluginlist.h @@ -110,15 +110,11 @@ public: * * @param profileName name of the current profile * @param baseDirectory the root directory structure representing the virtual data directory - * @param pluginsFile file that stores the list of enabled plugins - * @param loadOrderFile file that stored the load order (not an official file but used by many tools for skyrim) * @param lockedOrderFile list of plugins that shouldn't change load order * @todo the profile is not used? If it was, we should pass the Profile-object instead **/ void refresh(const QString &profileName , const MOShared::DirectoryEntry &baseDirectory - , const QString &pluginsFile - , const QString &loadOrderFile , const QString &lockedOrderFile); /** @@ -164,26 +160,14 @@ public: **/ bool isEnabled(int index); - /** - * @brief update the plugin status (enabled/disabled) from the specified file - * - * @param fileName path of the file to load. the filename should be "plugin.txt" - * @todo it would make sense to move this into the Profile-class - **/ - void readEnabledFrom(const QString &fileName); - /** * @brief save the plugin status to the specified file * - * @param pluginFileName path of the plugin.txt to write to - * @param loadOrderFileName path of the loadorder.txt to write to * @param lockedOrderFileName path of the lockedorder.txt to write to * @param deleterFileName file to receive a list of files to hide from the virtual data tree. This is used to hide unchecked plugins if "hideUnchecked" is true * @param hideUnchecked if true, plugins that aren't enabled will be hidden from the virtual data directory **/ - void saveTo(const QString &pluginFileName - , const QString &loadOrderFileName - , const QString &lockedOrderFileName + void saveTo(const QString &lockedOrderFileName , const QString &deleterFileName , bool hideUnchecked) const; @@ -222,13 +206,16 @@ public: public: + virtual QStringList pluginNames() const override; virtual PluginStates state(const QString &name) const; + virtual void setState(const QString &name, PluginStates state) override; virtual int priority(const QString &name) const; virtual int loadOrder(const QString &name) const; + virtual bool onRefreshed(const std::function &callback); virtual bool isMaster(const QString &name) const; virtual QStringList masters(const QString &name) const; virtual QString origin(const QString &name) const; - virtual bool onRefreshed(const std::function &callback); + virtual void setLoadOrder(const QStringList &pluginList) override; virtual bool onPluginMoved(const std::function &func); virtual bool onPluginStateChanged(const std::function &func) override; @@ -309,10 +296,8 @@ private: void syncLoadOrder(); void updateIndices(); - void writePlugins(const QString &fileName, bool writeUnchecked) const; void writeLockedOrder(const QString &fileName) const; - bool readLoadOrder(const QString &fileName); void readLockedOrderFrom(const QString &fileName); void setPluginPriority(int row, int &newPriority); void changePluginPriority(std::vector rows, int newPriority); @@ -327,10 +312,6 @@ private: std::map m_ESPsByName; std::vector m_ESPsByPriority; - // maps esp names to the priority specified in loadorder.txt. The esp names are - // all lowercase!! This is to work around the fact that BOSS for some reason writes some file with - // capitalization that doesn't match the actual name - std::map m_ESPLoadOrder; std::map m_LockedOrder; std::map m_AdditionalInfo; // maps esp names to boss information @@ -338,16 +319,13 @@ private: QString m_CurrentProfile; QFontMetrics m_FontMetrics; - QTextCodec *m_Utf8Codec; - QTextCodec *m_LocalCodec; - SignalRefreshed m_Refreshed; SignalPluginMoved m_PluginMoved; SignalPluginStateChanged m_PluginStateChanged; QTemporaryFile m_TempFile; - MOBase::IPluginGame const *m_GamePlugin; + const MOBase::IPluginGame *m_GamePlugin; }; -- cgit v1.3.1