diff options
author | kumquat-ir <66188216+kumquat-ir@users.noreply.github.com> | 2022-07-18 14:05:23 -0400 |
---|---|---|
committer | kumquat-ir <66188216+kumquat-ir@users.noreply.github.com> | 2022-07-18 14:05:23 -0400 |
commit | 20b1723e78149c1f2ac4072cbd46997e9c5160fa (patch) | |
tree | 7d97c8bc2edfe5cb41b91e6d04ba36da8aa163e6 /launcher/minecraft/mod/Mod.h | |
parent | be78afeee54a19cd0115e1d2ec63f3a3201a3940 (diff) | |
parent | dec81c4f274dd8388d442062cf9fa18600aa850d (diff) | |
download | PrismLauncher-20b1723e78149c1f2ac4072cbd46997e9c5160fa.tar.gz PrismLauncher-20b1723e78149c1f2ac4072cbd46997e9c5160fa.tar.bz2 PrismLauncher-20b1723e78149c1f2ac4072cbd46997e9c5160fa.zip |
merge origin/develop
Signed-off-by: kumquat-ir <66188216+kumquat-ir@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft/mod/Mod.h')
-rw-r--r-- | launcher/minecraft/mod/Mod.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/launcher/minecraft/mod/Mod.h b/launcher/minecraft/mod/Mod.h index 5f9c4684..7a13e44b 100644 --- a/launcher/minecraft/mod/Mod.h +++ b/launcher/minecraft/mod/Mod.h @@ -39,10 +39,12 @@ #include <QFileInfo> #include <QList> +#include "QObjectPtr.h" #include "ModDetails.h" -class Mod +class Mod : public QObject { + Q_OBJECT public: enum ModType { @@ -53,6 +55,8 @@ public: MOD_LITEMOD, //!< The mod is a litemod }; + using Ptr = shared_qobject_ptr<Mod>; + Mod() = default; Mod(const QFileInfo &file); explicit Mod(const QDir& mods_dir, const Metadata::ModStruct& metadata); @@ -77,12 +81,12 @@ public: auto metadata() const -> const std::shared_ptr<Metadata::ModStruct>; void setStatus(ModStatus status); - void setMetadata(Metadata::ModStruct* metadata); + void setMetadata(const Metadata::ModStruct& metadata); auto enable(bool value) -> bool; // delete all the files of this mod - auto destroy(QDir& index_dir) -> bool; + auto destroy(QDir& index_dir, bool preserve_metadata = false) -> bool; // change the mod's filesystem path (used by mod lists for *MAGIC* purposes) void repath(const QFileInfo &file); @@ -111,7 +115,7 @@ protected: std::shared_ptr<Metadata::ModStruct> m_temp_metadata; /* Set the mod status while it doesn't have local details just yet */ - ModStatus m_temp_status = ModStatus::NotInstalled; + ModStatus m_temp_status = ModStatus::NoMetadata; std::shared_ptr<ModDetails> m_localDetails; |