Revise Utils::Gzip::decompress

Rename from uncompress to decompress
Change signature
Use proper casting
Use larger buffer for the output of inflate()
Reserve 1 MBytes for output buffer
Change function signature
This commit is contained in:
Chocobo1
2017-04-17 17:37:37 +08:00
parent 302c8ba850
commit 617f19e599
4 changed files with 44 additions and 40 deletions

View File

@@ -416,8 +416,10 @@ void GeoIPManager::downloadFinished(const QString &url, QByteArray data)
{
Q_UNUSED(url);
if (!Utils::Gzip::uncompress(data, data)) {
Logger::instance()->addMessage(tr("Could not uncompress GeoIP database file."), Log::WARNING);
bool ok = false;
data = Utils::Gzip::decompress(data, &ok);
if (!ok) {
Logger::instance()->addMessage(tr("Could not decompress GeoIP database file."), Log::WARNING);
return;
}