From 605423b8e486616677e88efafbcfaba1fb9f70e1 Mon Sep 17 00:00:00 2001 From: Sky Date: Tue, 5 Nov 2013 23:46:06 +0000 Subject: [PATCH] Read mcmod.info first, forgeversion.properties second --- logic/Mod.cpp | 44 ++++++++++++++++++++++---------------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/logic/Mod.cpp b/logic/Mod.cpp index f9647eea2..cff9467eb 100644 --- a/logic/Mod.cpp +++ b/logic/Mod.cpp @@ -56,34 +56,34 @@ void Mod::repath(const QFileInfo &file) return; QuaZipFile file(&zip); - for (bool more = zip.goToFirstFile(); more; more = zip.goToNextFile()) + + if (zip.setCurrentFile("mcmod.info")) { - QString name = zip.getCurrentFileName(); - if (name == "mcmod.info") + if(!file.open(QIODevice::ReadOnly)) { - if (!file.open(QIODevice::ReadOnly)) - { - zip.close(); - return; - } - ReadMCModInfo(file.readAll()); - file.close(); - zip.close(); - return; - } - else if (name == "forgeversion.properties") - { - if (!file.open(QIODevice::ReadOnly)) - { - zip.close(); - return; - } - ReadForgeInfo(file.readAll()); - file.close(); zip.close(); return; } + + ReadMCModInfo(file.readAll()); + file.close(); + zip.close(); + return; } + else if (zip.setCurrentFile("forgeversion.properties")) + { + if (!file.open(QIODevice::ReadOnly)) + { + zip.close(); + return; + } + + ReadForgeInfo(file.readAll()); + file.close(); + zip.close(); + return; + } + zip.close(); } else if (m_type == MOD_FOLDER)