summaryrefslogtreecommitdiff
path: root/src/modinfo.h
diff options
context:
space:
mode:
authorMikaël Capelle <capelle.mikael@gmail.com>2021-01-02 19:07:50 +0100
committerMikaël Capelle <capelle.mikael@gmail.com>2021-01-02 19:07:50 +0100
commitd96dcf02b131808a25045afc23667ed6a26274a6 (patch)
tree01a42a3c59ed664d2ea9e1e830565d3e2260ca8b /src/modinfo.h
parentc7abae79b3042cb5a9ab1174a9955d47e6e38fb8 (diff)
Refactoring of ModInfo to give access to the core. Remove ModInfo::remove() completely.
Diffstat (limited to 'src/modinfo.h')
-rw-r--r--src/modinfo.h34
1 files changed, 11 insertions, 23 deletions
diff --git a/src/modinfo.h b/src/modinfo.h
index f0c7bcb5..08ed94f8 100644
--- a/src/modinfo.h
+++ b/src/modinfo.h
@@ -23,6 +23,7 @@ along with Mod Organizer. If not, see <http://www.gnu.org/licenses/>.
#include "imodinterface.h"
#include "versioninfo.h"
+class OrganizerCore;
class PluginContainer;
class QDir;
class QDateTime;
@@ -107,12 +108,9 @@ public: // Static functions:
/**
* @brief Read the mod directory and Mod ModInfo objects for all subdirectories.
*/
- static void updateFromDisc(const QString &modDirectory,
- MOShared::DirectoryEntry **directoryStructure,
- PluginContainer *pluginContainer,
- bool displayForeign,
- std::size_t refreshThreadCount,
- MOBase::IPluginGame const *game);
+ static void updateFromDisc(
+ const QString &modDirectory, OrganizerCore& core,
+ bool displayForeign, std::size_t refreshThreadCount);
static void clear() { s_Collection.clear(); s_ModsByName.clear(); s_ModsByModID.clear(); }
@@ -467,14 +465,6 @@ public: // Mutable operations:
*/
virtual bool setName(const QString& name) = 0;
- /**
- * @brief Deletes the mod from the disc. This does not update the global ModInfo structure or
- * indices.
- *
- * @return true on success, false otherwise.
- */
- virtual bool remove() = 0;
-
public: // Methods after this do not come from IModInterface:
/**
@@ -945,7 +935,7 @@ protected:
/**
*
*/
- ModInfo(PluginContainer *pluginContainer);
+ ModInfo(OrganizerCore& core);
/**
* @brief Prefetch content for this mod.
@@ -959,6 +949,9 @@ protected:
protected:
+ // the mod list
+ OrganizerCore& m_Core;
+
// the index of the mod in s_Collection, only valid after updateIndices()
int m_Index;
@@ -978,9 +971,7 @@ protected:
*
* @return pointer to the info-structure of the newly created/added mod.
*/
- static ModInfo::Ptr createFrom(
- PluginContainer* pluginContainer, const MOBase::IPluginGame* game,
- const QDir& dir, MOShared::DirectoryEntry** directoryStructure);
+ static ModInfo::Ptr createFrom(const QDir& dir, OrganizerCore& core);
/**
* @brief Create a new "foreign-managed" mod from a tuple of plugin and archives.
@@ -992,12 +983,9 @@ protected:
*/
static ModInfo::Ptr createFromPlugin(
const QString& modName, const QString& espName, const QStringList& bsaNames,
- ModInfo::EModType modType, const MOBase::IPluginGame* game,
- MOShared::DirectoryEntry** directoryStructure, PluginContainer* pluginContainer);
+ ModInfo::EModType modType, OrganizerCore& core);
- static ModInfo::Ptr createFromOverwrite(PluginContainer* pluginContainer,
- const MOBase::IPluginGame* game,
- MOShared::DirectoryEntry** directoryStructure);
+ static ModInfo::Ptr createFromOverwrite(OrganizerCore& core);
// update the m_Index attribute of all mods and the various mapping
//