Read mcmod.info first, forgeversion.properties second

This commit is contained in:
Sky 2013-11-05 23:46:06 +00:00
parent 4186623d0d
commit 605423b8e4

View File

@ -56,34 +56,34 @@ void Mod::repath(const QFileInfo &file)
return; return;
QuaZipFile file(&zip); QuaZipFile file(&zip);
for (bool more = zip.goToFirstFile(); more; more = zip.goToNextFile())
if (zip.setCurrentFile("mcmod.info"))
{ {
QString name = zip.getCurrentFileName(); if(!file.open(QIODevice::ReadOnly))
if (name == "mcmod.info")
{ {
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(); zip.close();
return; 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(); zip.close();
} }
else if (m_type == MOD_FOLDER) else if (m_type == MOD_FOLDER)