summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2015-09-10 00:02:02 +0200
committerPetr Mrázek <peterix@gmail.com>2015-09-10 00:02:02 +0200
commitdb5816b0a20aac63fb97188ea2034903db254bfa (patch)
tree56f45bfe3d74932dbaab4ff8c89da21544bcb10f
parenta1fd50e920eba0f198b898e5df4ff5f60424d355 (diff)
downloadMultiMC-db5816b0a20aac63fb97188ea2034903db254bfa.tar
MultiMC-db5816b0a20aac63fb97188ea2034903db254bfa.tar.gz
MultiMC-db5816b0a20aac63fb97188ea2034903db254bfa.tar.lz
MultiMC-db5816b0a20aac63fb97188ea2034903db254bfa.tar.xz
MultiMC-db5816b0a20aac63fb97188ea2034903db254bfa.zip
GH-1227 fix zlib nonsense on Windows
-rw-r--r--application/pages/OtherLogsPage.cpp2
-rw-r--r--logic/GZip.cpp6
-rw-r--r--logic/GZip.h2
-rw-r--r--logic/minecraft/World.cpp2
4 files changed, 4 insertions, 8 deletions
diff --git a/application/pages/OtherLogsPage.cpp b/application/pages/OtherLogsPage.cpp
index d59f0451..b3481bfb 100644
--- a/application/pages/OtherLogsPage.cpp
+++ b/application/pages/OtherLogsPage.cpp
@@ -130,7 +130,7 @@ void OtherLogsPage::on_btnReload_clicked()
if(file.fileName().endsWith(".gz"))
{
QByteArray temp;
- if(!GZip::inflate(file.readAll(), temp))
+ if(!GZip::decompress(file.readAll(), temp))
{
ui->text->setPlainText(
tr("The file (%1) is not readable.").arg(file.fileName()));
diff --git a/logic/GZip.cpp b/logic/GZip.cpp
index 96d58ea8..5207f3f0 100644
--- a/logic/GZip.cpp
+++ b/logic/GZip.cpp
@@ -8,11 +8,7 @@ int wrap_inflate (z_streamp strm, int flush)
return inflate(strm, flush);
}
-#ifdef inflate
- #undef inflate
-#endif
-
-bool GZip::inflate(const QByteArray &compressedBytes, QByteArray &uncompressedBytes)
+bool GZip::decompress(const QByteArray &compressedBytes, QByteArray &uncompressedBytes)
{
if (compressedBytes.size() == 0)
{
diff --git a/logic/GZip.h b/logic/GZip.h
index 7ccf1d38..30f4f9b5 100644
--- a/logic/GZip.h
+++ b/logic/GZip.h
@@ -6,6 +6,6 @@
class MULTIMC_LOGIC_EXPORT GZip
{
public:
- static bool inflate(const QByteArray &compressedBytes, QByteArray &uncompressedBytes);
+ static bool decompress(const QByteArray &compressedBytes, QByteArray &uncompressedBytes);
};
diff --git a/logic/minecraft/World.cpp b/logic/minecraft/World.cpp
index 3b66f113..142839d2 100644
--- a/logic/minecraft/World.cpp
+++ b/logic/minecraft/World.cpp
@@ -175,7 +175,7 @@ static int64_t read_long (nbt::value& parent, const char * name, const int64_t &
void World::parseLevelDat(QByteArray data)
{
QByteArray output;
- is_valid = GZip::inflate(data, output);
+ is_valid = GZip::decompress(data, output);
if(!is_valid)
{
return;