diff options
author | flow <flowlnlnln@gmail.com> | 2022-06-19 14:26:15 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-07-17 11:33:43 -0300 |
commit | fd6755c93f3f3f7551f9b7c11d1bbbb48c22e210 (patch) | |
tree | 4a5e101deaede01b79f4fa04f5b2c4421b481089 /launcher/modplatform/packwiz/Packwiz.h | |
parent | a53ee2e35cafd36964663d632877badcf53d8786 (diff) | |
download | PrismLauncher-fd6755c93f3f3f7551f9b7c11d1bbbb48c22e210.tar.gz PrismLauncher-fd6755c93f3f3f7551f9b7c11d1bbbb48c22e210.tar.bz2 PrismLauncher-fd6755c93f3f3f7551f9b7c11d1bbbb48c22e210.zip |
change: mod metadata improvements
- Use slug instead of name
- Keep temporary status before having local details
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/modplatform/packwiz/Packwiz.h')
-rw-r--r-- | launcher/modplatform/packwiz/Packwiz.h | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/launcher/modplatform/packwiz/Packwiz.h b/launcher/modplatform/packwiz/Packwiz.h index 9d643703..3ec80377 100644 --- a/launcher/modplatform/packwiz/Packwiz.h +++ b/launcher/modplatform/packwiz/Packwiz.h @@ -40,6 +40,7 @@ auto intEntry(toml_table_t* parent, const char* entry_name) -> int; class V1 { public: struct Mod { + QString slug {}; QString name {}; QString filename {}; // FIXME: make side an enum @@ -58,7 +59,7 @@ class V1 { public: // This is a totally heuristic, but should work for now. - auto isValid() const -> bool { return !name.isEmpty() && !project_id.isNull(); } + auto isValid() const -> bool { return !slug.isEmpty() && !project_id.isNull(); } // Different providers can use different names for the same thing // Modrinth-specific @@ -71,9 +72,9 @@ class V1 { * */ static auto createModFormat(QDir& index_dir, ModPlatform::IndexedPack& mod_pack, ModPlatform::IndexedVersion& mod_version) -> Mod; /* Generates the object representing the information in a mod.pw.toml file via - * its common representation in the launcher. + * its common representation in the launcher, plus a necessary slug. * */ - static auto createModFormat(QDir& index_dir, ::Mod& internal_mod) -> Mod; + static auto createModFormat(QDir& index_dir, ::Mod& internal_mod, QString slug) -> Mod; /* Updates the mod index for the provided mod. * This creates a new index if one does not exist already @@ -81,16 +82,16 @@ class V1 { * */ static void updateModIndex(QDir& index_dir, Mod& mod); - /* Deletes the metadata for the mod with the given name. If the metadata doesn't exist, it does nothing. */ - static void deleteModIndex(QDir& index_dir, QString& mod_name); + /* Deletes the metadata for the mod with the given slug. If the metadata doesn't exist, it does nothing. */ + static void deleteModIndex(QDir& index_dir, QString& mod_slug); /* Deletes the metadata for the mod with the given id. If the metadata doesn't exist, it does nothing. */ static void deleteModIndex(QDir& index_dir, QVariant& mod_id); - /* Gets the metadata for a mod with a particular name. + /* Gets the metadata for a mod with a particular file name. * If the mod doesn't have a metadata, it simply returns an empty Mod object. * */ - static auto getIndexForMod(QDir& index_dir, QString& index_file_name) -> Mod; + static auto getIndexForMod(QDir& index_dir, QString slug) -> Mod; /* Gets the metadata for a mod with a particular id. * If the mod doesn't have a metadata, it simply returns an empty Mod object. |