diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2020-05-25 13:48:45 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-05-25 13:48:45 -0400 |
| commit | a721347fd130fcab19f2709892093f087bfac19e (patch) | |
| tree | ab4d6670668f519dd89066197cda349811f8978b /src/modinfo.h | |
| parent | 08ae9db2fd2a07acb2433275fc84c2ca47267a92 (diff) | |
| parent | 9212a7d2e9611994dfc5fa2066b8ecbe68b198a8 (diff) | |
Merge pull request #1079 from Holt59/moinfo-improvements
ModInfo improvements
Diffstat (limited to 'src/modinfo.h')
| -rw-r--r-- | src/modinfo.h | 36 |
1 files changed, 21 insertions, 15 deletions
diff --git a/src/modinfo.h b/src/modinfo.h index f582cc32..29e6124d 100644 --- a/src/modinfo.h +++ b/src/modinfo.h @@ -142,6 +142,7 @@ public: MOShared::DirectoryEntry **directoryStructure, PluginContainer *pluginContainer, bool displayForeign, + std::size_t refreshThreadCount, MOBase::IPluginGame const *game); static void clear() { s_Collection.clear(); s_ModsByName.clear(); s_ModsByModID.clear(); } @@ -702,7 +703,7 @@ public: /** * @return true if this mod is considered "valid", that is: it contains data used by the game **/ - virtual bool isValid() const { return m_Valid; } + virtual bool isValid() const = 0; /** * @return true if the file has been endorsed on nexus @@ -715,11 +716,6 @@ public: virtual ETrackedState trackedState() const { return TRACKED_FALSE; } /** - * @brief updates the valid-flag for this mod - */ - void testValid(); - - /** * @brief updates the mod to flag it as converted in order to ignore the alternate game warning */ virtual void markConverted(bool) {} @@ -801,6 +797,13 @@ public: **/ QUrl parseCustomURL() const; +public slots: + + /** + * @brief Notify this mod that the content of the disk may have changed. + */ + virtual void diskContentModified() = 0; + signals: /** @@ -812,17 +815,22 @@ signals: protected: + /** + * + */ ModInfo(PluginContainer *pluginContainer); - static void updateIndices(); - static bool ByName(const ModInfo::Ptr &LHS, const ModInfo::Ptr &RHS); - /** - * @brief check if the content of this mod is valid. + * @brief Prefetch content for this mod. * - * @return true if the content is valid, false otherwize. - **/ - virtual bool doTestValid() const = 0; + * This method can be used to prefetch content from the mod, e.g., for isValid() + * or getContents(). This method will only be called when first creating the mod + * using multiple threads for all the mods. + */ + virtual void prefetch() = 0; + + static void updateIndices(); + static bool ByName(const ModInfo::Ptr &LHS, const ModInfo::Ptr &RHS); private: @@ -848,8 +856,6 @@ private: static std::map<std::pair<QString, int>, std::vector<unsigned int> > s_ModsByModID; static int s_NextID; - bool m_Valid; - }; |
