diff options
author | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2022-12-26 14:29:13 -0700 |
---|---|---|
committer | Rachel Powers <508861+Ryex@users.noreply.github.com> | 2022-12-26 14:50:15 -0700 |
commit | 3691f3a2963c77dbd7b469b4b90ca79b61014d43 (patch) | |
tree | 0808dcaec8ff3177367d048103874a17fed63acc /launcher/minecraft/mod/tasks/LocalShaderPackParseTask.cpp | |
parent | b2082bfde7149a5596fe8a467659699ad569f932 (diff) | |
download | PrismLauncher-3691f3a2963c77dbd7b469b4b90ca79b61014d43.tar.gz PrismLauncher-3691f3a2963c77dbd7b469b4b90ca79b61014d43.tar.bz2 PrismLauncher-3691f3a2963c77dbd7b469b4b90ca79b61014d43.zip |
fix: cleanup and suggested changes
Signed-off-by: Rachel Powers <508861+Ryex@users.noreply.github.com>
Diffstat (limited to 'launcher/minecraft/mod/tasks/LocalShaderPackParseTask.cpp')
-rw-r--r-- | launcher/minecraft/mod/tasks/LocalShaderPackParseTask.cpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/launcher/minecraft/mod/tasks/LocalShaderPackParseTask.cpp b/launcher/minecraft/mod/tasks/LocalShaderPackParseTask.cpp index 088853b9..a9949735 100644 --- a/launcher/minecraft/mod/tasks/LocalShaderPackParseTask.cpp +++ b/launcher/minecraft/mod/tasks/LocalShaderPackParseTask.cpp @@ -24,8 +24,8 @@ #include "FileSystem.h" #include <quazip/quazip.h> -#include <quazip/quazipfile.h> #include <quazip/quazipdir.h> +#include <quazip/quazipfile.h> namespace ShaderPackUtils { @@ -45,18 +45,18 @@ bool process(ShaderPack& pack, ProcessingLevel level) bool processFolder(ShaderPack& pack, ProcessingLevel level) { Q_ASSERT(pack.type() == ResourceType::FOLDER); - + QFileInfo shaders_dir_info(FS::PathCombine(pack.fileinfo().filePath(), "shaders")); if (!shaders_dir_info.exists() || !shaders_dir_info.isDir()) { - return false; // assets dir does not exists or isn't valid + return false; // assets dir does not exists or isn't valid } pack.setPackFormat(ShaderPackFormat::VALID); if (level == ProcessingLevel::BasicInfoOnly) { - return true; // only need basic info already checked + return true; // only need basic info already checked } - - return true; // all tests passed + + return true; // all tests passed } bool processZIP(ShaderPack& pack, ProcessingLevel level) @@ -65,19 +65,19 @@ bool processZIP(ShaderPack& pack, ProcessingLevel level) QuaZip zip(pack.fileinfo().filePath()); if (!zip.open(QuaZip::mdUnzip)) - return false; // can't open zip file + return false; // can't open zip file QuaZipFile file(&zip); QuaZipDir zipDir(&zip); if (!zipDir.exists("/shaders")) { - return false; // assets dir does not exists at zip root + return false; // assets dir does not exists at zip root } pack.setPackFormat(ShaderPackFormat::VALID); if (level == ProcessingLevel::BasicInfoOnly) { zip.close(); - return true; // only need basic info already checked + return true; // only need basic info already checked } zip.close(); @@ -85,7 +85,6 @@ bool processZIP(ShaderPack& pack, ProcessingLevel level) return true; } - bool validate(QFileInfo file) { ShaderPack sp{ file }; @@ -94,9 +93,7 @@ bool validate(QFileInfo file) } // namespace ShaderPackUtils -LocalShaderPackParseTask::LocalShaderPackParseTask(int token, ShaderPack& sp) - : Task(nullptr, false), m_token(token), m_shader_pack(sp) -{} +LocalShaderPackParseTask::LocalShaderPackParseTask(int token, ShaderPack& sp) : Task(nullptr, false), m_token(token), m_shader_pack(sp) {} bool LocalShaderPackParseTask::abort() { |