diff options
| author | Tannin <devnull@localhost> | 2015-01-03 15:58:52 +0100 |
|---|---|---|
| committer | Tannin <devnull@localhost> | 2015-01-03 15:58:52 +0100 |
| commit | a16e25380f088dc310fbed24d2dcef603357e99a (patch) | |
| tree | 40fc3b5254f2797eb20bfac1d54a22652d469fa2 /src/modinfo.h | |
| parent | 459816ab71ae6b350847cc93f1e03e49ecf75ade (diff) | |
| parent | f2f9e11fdd876821107cff0c1c5b9d8ecf66691f (diff) | |
Merge with branch1.2
Diffstat (limited to 'src/modinfo.h')
| -rw-r--r-- | src/modinfo.h | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/src/modinfo.h b/src/modinfo.h index 6fbab1a0..d532202b 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -81,6 +81,8 @@ public: CONTENT_STRING
};
+ static const int NUM_CONTENT_TYPES = CONTENT_STRING + 1;
+
enum EHighlight {
HIGHLIGHT_NONE = 0,
HIGHLIGHT_INVALID = 1,
@@ -182,6 +184,13 @@ public: */
static ModInfo::Ptr createFromPlugin(const QString &espName, const QStringList &bsaNames, MOShared::DirectoryEntry **directoryStructure);
+ /**
+ * @brief retieve a name for one of the CONTENT_ enums
+ * @param contentType the content value
+ * @return a display string
+ */
+ static QString getContentTypeName(int contentType);
+
virtual bool isRegular() const { return false; }
virtual bool isEmpty() const { return false; }
@@ -328,6 +337,13 @@ public: virtual QString name() const = 0;
/**
+ * @brief getter for an internal name. This is usually the same as the regular name, but with special mod types it might be
+ * this is used to distinguish between mods that have the same visible name
+ * @return internal mod name
+ */
+ virtual QString internalName() const { return name(); }
+
+ /**
* @brief getter for the mod path
*
* @return the (absolute) path to the mod
@@ -403,6 +419,11 @@ public: virtual std::vector<EContent> getContents() const { return std::vector<EContent>(); }
/**
+ * @return a list of content types contained in a mod
+ */
+ virtual std::vector<EContent> getContents() const { return std::vector<EContent>(); }
+
+ /**
* @brief test if the specified flag is set for this mod
* @param flag the flag to test
* @return true if the flag is set, false otherwise
@@ -410,6 +431,13 @@ public: bool hasFlag(EFlag flag) const;
/**
+ * @brief test if the mods contains the specified content
+ * @param content the content to test
+ * @return true if the content is there, false otherwise
+ */
+ bool hasContent(ModInfo::EContent content) const;
+
+ /**
* @return an indicator if and how this mod should be highlighted by the UI
*/
virtual int getHighlight() const { return HIGHLIGHT_NONE; }
@@ -513,6 +541,21 @@ public: */
virtual void saveMeta() {}
+ /**
+ * @return retrieve list of mods (as mod index) that are overwritten by this one. Updates may be delayed
+ */
+ virtual std::set<unsigned int> getModOverwrite() { return std::set<unsigned int>(); }
+
+ /**
+ * @return list of mods (as mod index) that overwrite this one. Updates may be delayed
+ */
+ virtual std::set<unsigned int> getModOverwritten() { return std::set<unsigned int>(); }
+
+ /**
+ * @brief update conflict information
+ */
+ virtual void doConflictCheck() const {}
+
signals:
/**
@@ -566,6 +609,13 @@ public: * @brief clear all caches held for this mod
*/
virtual void clearCaches();
+
+ virtual std::set<unsigned int> getModOverwrite() { return m_OverwriteList; }
+
+ virtual std::set<unsigned int> getModOverwritten() { return m_OverwrittenList; }
+
+ virtual void doConflictCheck() const;
+
private:
enum EConflictType {
@@ -595,6 +645,9 @@ private: mutable EConflictType m_CurrentConflictState;
mutable QTime m_LastConflictCheck;
+ mutable std::set<unsigned int> m_OverwriteList; // indices of mods overritten by this mod
+ mutable std::set<unsigned int> m_OverwrittenList; // indices of mods overwriting this mod
+
};
@@ -1024,6 +1077,10 @@ public: public:
+ static const char INT_IDENTIFIER[];
+
+public:
+
virtual bool updateAvailable() const { return false; }
virtual bool updateIgnored() const { return false; }
virtual bool downgradeAvailable() const { return false; }
@@ -1043,6 +1100,7 @@ public: virtual void endorse(bool) {}
virtual bool isEmpty() const { return false; }
virtual QString name() const;
+ virtual QString internalName() const { return name() + INT_IDENTIFIER; }
virtual QString notes() const { return ""; }
virtual QDateTime creationTime() const;
virtual QString absolutePath() const;
|
