diff options
author | flow <thiagodonato300@gmail.com> | 2022-04-17 11:40:41 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-05-23 14:42:28 -0300 |
commit | d7f6b3699074b268fd554bd1eb9da68f1e533355 (patch) | |
tree | df9a4e34bc4c851040e80c933cf8858c26503ca5 /launcher/modplatform/packwiz/Packwiz.h | |
parent | 4439666e67573a6a36af981fdc68410fdf9e4f9f (diff) | |
download | PrismLauncher-d7f6b3699074b268fd554bd1eb9da68f1e533355.tar.gz PrismLauncher-d7f6b3699074b268fd554bd1eb9da68f1e533355.tar.bz2 PrismLauncher-d7f6b3699074b268fd554bd1eb9da68f1e533355.zip |
test+fix: add basic tests and fix issues with it
Diffstat (limited to 'launcher/modplatform/packwiz/Packwiz.h')
-rw-r--r-- | launcher/modplatform/packwiz/Packwiz.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/launcher/modplatform/packwiz/Packwiz.h b/launcher/modplatform/packwiz/Packwiz.h index 777a365f..69125dbc 100644 --- a/launcher/modplatform/packwiz/Packwiz.h +++ b/launcher/modplatform/packwiz/Packwiz.h @@ -33,8 +33,13 @@ class V1 { QVariant project_id {}; public: - // This is a heuristic, but should work for now. - auto isValid() const -> bool { return !name.isEmpty(); } + // This is a totally heuristic, but should work for now. + auto isValid() const -> bool { return !name.isEmpty() && !project_id.isNull(); } + + // Different providers can use different names for the same thing + // Modrinth-specific + auto mod_id() -> QVariant& { return project_id; } + auto version() -> QVariant& { return file_id; } }; /* Generates the object representing the information in a mod.toml file via @@ -58,7 +63,7 @@ class V1 { /* Gets the metadata for a mod with a particular name. * If the mod doesn't have a metadata, it simply returns an empty Mod object. * */ - static auto getIndexForMod(QDir& index_dir, QString& mod_name) -> Mod; + static auto getIndexForMod(QDir& index_dir, QString& index_file_name) -> Mod; }; } // namespace Packwiz |