diff options
author | flow <thiagodonato300@gmail.com> | 2022-05-14 21:50:54 -0300 |
---|---|---|
committer | flow <thiagodonato300@gmail.com> | 2022-05-14 21:50:54 -0300 |
commit | 365cc198ba1e4e8129c95291e60e2c3c7ffbbf7a (patch) | |
tree | 4aef1abf94b287f03080d478a82dd15b03badc25 /launcher | |
parent | 9899a0e098e5cfb76a754fa9da2f73be46cc880a (diff) | |
download | PrismLauncher-365cc198ba1e4e8129c95291e60e2c3c7ffbbf7a.tar.gz PrismLauncher-365cc198ba1e4e8129c95291e60e2c3c7ffbbf7a.tar.bz2 PrismLauncher-365cc198ba1e4e8129c95291e60e2c3c7ffbbf7a.zip |
refactor: some random improvements
Diffstat (limited to 'launcher')
-rw-r--r-- | launcher/InstanceImportTask.cpp | 8 | ||||
-rw-r--r-- | launcher/ui/pages/modplatform/ImportPage.cpp | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/launcher/InstanceImportTask.cpp b/launcher/InstanceImportTask.cpp index ec0f58e0..29e3a26c 100644 --- a/launcher/InstanceImportTask.cpp +++ b/launcher/InstanceImportTask.cpp @@ -504,16 +504,16 @@ void InstanceImportTask::processModrinth() { QJsonObject hashes = Json::requireObject(obj, "hashes"); QString hash; QCryptographicHash::Algorithm hashAlgorithm; - hash = Json::ensureString(hashes, "sha256"); - hashAlgorithm = QCryptographicHash::Sha256; + hash = Json::ensureString(hashes, "sha1"); + hashAlgorithm = QCryptographicHash::Sha1; if (hash.isEmpty()) { hash = Json::ensureString(hashes, "sha512"); hashAlgorithm = QCryptographicHash::Sha512; if (hash.isEmpty()) { - hash = Json::ensureString(hashes, "sha1"); - hashAlgorithm = QCryptographicHash::Sha1; + hash = Json::ensureString(hashes, "sha256"); + hashAlgorithm = QCryptographicHash::Sha256; if (hash.isEmpty()) { throw JSONValidationError("No hash found for: " + file.path); diff --git a/launcher/ui/pages/modplatform/ImportPage.cpp b/launcher/ui/pages/modplatform/ImportPage.cpp index 3b65de9d..c86d02ca 100644 --- a/launcher/ui/pages/modplatform/ImportPage.cpp +++ b/launcher/ui/pages/modplatform/ImportPage.cpp @@ -110,7 +110,10 @@ void ImportPage::updateState() // FIXME: actually do some validation of what's inside here... this is fake AF QFileInfo fi(input); // mrpack is a modrinth pack - if(fi.exists() && (fi.suffix() == "zip" || fi.suffix() == "mrpack")) + + // Allow non-latin people to use ZIP files! + auto zip = QMimeDatabase().mimeTypeForUrl(url).suffixes().contains("zip"); + if(fi.exists() && (zip || fi.suffix() == "mrpack")) { QFileInfo fi(url.fileName()); dialog->setSuggestedPack(fi.completeBaseName(), new InstanceImportTask(url)); |