mirror of
https://github.com/vcmi/vcmi.git
synced 2024-11-24 08:32:34 +02:00
Add more logging to mod downloading process
This commit is contained in:
parent
fc6fc31a02
commit
e4aa981925
@ -764,10 +764,10 @@ void CModListView::installMods(QStringList archives)
|
||||
enableMod(mod);
|
||||
}
|
||||
|
||||
checkManagerErrors();
|
||||
|
||||
for(QString archive : archives)
|
||||
QFile::remove(archive);
|
||||
|
||||
checkManagerErrors();
|
||||
}
|
||||
|
||||
void CModListView::on_refreshButton_clicked()
|
||||
|
@ -39,6 +39,11 @@ QString detectModArchive(QString path, QString modName)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
logGlobal->error("Failed to detect mod path in archive!");
|
||||
logGlobal->debug("List of file in archive:");
|
||||
for(auto file : files)
|
||||
logGlobal->debug("%s", file.c_str());
|
||||
|
||||
return "";
|
||||
}
|
||||
|
@ -157,7 +157,15 @@ std::vector<std::string> ZipArchive::listFiles(const boost::filesystem::path & f
|
||||
|
||||
unzFile file = unzOpen2_64(filename.c_str(), FileStream::GetMinizipFilefunc());
|
||||
|
||||
if (unzGoToFirstFile(file) == UNZ_OK)
|
||||
if (file == nullptr)
|
||||
{
|
||||
logGlobal->error("Failed to open file '%s'! Unable to list files!", filename.string());
|
||||
return {};
|
||||
}
|
||||
|
||||
int result = unzGoToFirstFile(file);
|
||||
|
||||
if (result == UNZ_OK)
|
||||
{
|
||||
do
|
||||
{
|
||||
@ -171,9 +179,21 @@ std::vector<std::string> ZipArchive::listFiles(const boost::filesystem::path & f
|
||||
unzGetCurrentFileInfo64(file, &info, zipFilename.data(), static_cast<uLong>(zipFilename.size()), nullptr, 0, nullptr, 0);
|
||||
|
||||
ret.emplace_back(zipFilename.data(), zipFilename.size());
|
||||
|
||||
result = unzGoToNextFile(file);
|
||||
}
|
||||
while (result == UNZ_OK);
|
||||
|
||||
if (result != UNZ_OK && result != UNZ_END_OF_LIST_OF_FILE)
|
||||
{
|
||||
logGlobal->error("Failed to list file from '%s'! Error code %d", filename.string(), result);
|
||||
}
|
||||
while (unzGoToNextFile(file) == UNZ_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
logGlobal->error("Failed to list files from '%s'! Error code %d", filename.string(), result);
|
||||
}
|
||||
|
||||
unzClose(file);
|
||||
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user