diff options
author | flow <flowlnlnln@gmail.com> | 2022-11-20 11:04:10 -0300 |
---|---|---|
committer | flow <flowlnlnln@gmail.com> | 2022-11-20 11:10:26 -0300 |
commit | df0f9259c0bf79e10b27ad5b429b53559ffd15f0 (patch) | |
tree | 0f0d061fb8cc8017de86403e61e2abdcaf732c42 /launcher/minecraft/mod/tasks/LocalTexturePackParseTask.h | |
parent | d92ae530d7c585eb859d852ba1877230a82d867e (diff) | |
download | PrismLauncher-df0f9259c0bf79e10b27ad5b429b53559ffd15f0.tar.gz PrismLauncher-df0f9259c0bf79e10b27ad5b429b53559ffd15f0.tar.bz2 PrismLauncher-df0f9259c0bf79e10b27ad5b429b53559ffd15f0.zip |
refactor: move RP/TP validation to their respective utils
This makes it easier to validate individual resources, and allows the
logic to be used in other places in the future, if we need to.
Signed-off-by: flow <flowlnlnln@gmail.com>
Diffstat (limited to 'launcher/minecraft/mod/tasks/LocalTexturePackParseTask.h')
-rw-r--r-- | launcher/minecraft/mod/tasks/LocalTexturePackParseTask.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/launcher/minecraft/mod/tasks/LocalTexturePackParseTask.h b/launcher/minecraft/mod/tasks/LocalTexturePackParseTask.h index cb0e404a..9f7aab75 100644 --- a/launcher/minecraft/mod/tasks/LocalTexturePackParseTask.h +++ b/launcher/minecraft/mod/tasks/LocalTexturePackParseTask.h @@ -27,13 +27,19 @@ #include "tasks/Task.h" namespace TexturePackUtils { -bool process(TexturePack& pack); -void processZIP(TexturePack& pack); -void processFolder(TexturePack& pack); +enum class ProcessingLevel { Full, BasicInfoOnly }; + +bool process(TexturePack& pack, ProcessingLevel level = ProcessingLevel::Full); + +void processZIP(TexturePack& pack, ProcessingLevel level = ProcessingLevel::Full); +void processFolder(TexturePack& pack, ProcessingLevel level = ProcessingLevel::Full); void processPackTXT(TexturePack& pack, QByteArray&& raw_data); void processPackPNG(TexturePack& pack, QByteArray&& raw_data); + +/** Checks whether a file is valid as a texture pack or not. */ +bool validate(QFileInfo file); } // namespace TexturePackUtils class LocalTexturePackParseTask : public Task { |