GH-1227 fix zlib nonsense on Windows
This commit is contained in:
parent
a1fd50e920
commit
db5816b0a2
@ -130,7 +130,7 @@ void OtherLogsPage::on_btnReload_clicked()
|
|||||||
if(file.fileName().endsWith(".gz"))
|
if(file.fileName().endsWith(".gz"))
|
||||||
{
|
{
|
||||||
QByteArray temp;
|
QByteArray temp;
|
||||||
if(!GZip::inflate(file.readAll(), temp))
|
if(!GZip::decompress(file.readAll(), temp))
|
||||||
{
|
{
|
||||||
ui->text->setPlainText(
|
ui->text->setPlainText(
|
||||||
tr("The file (%1) is not readable.").arg(file.fileName()));
|
tr("The file (%1) is not readable.").arg(file.fileName()));
|
||||||
|
@ -8,11 +8,7 @@ int wrap_inflate (z_streamp strm, int flush)
|
|||||||
return inflate(strm, flush);
|
return inflate(strm, flush);
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef inflate
|
bool GZip::decompress(const QByteArray &compressedBytes, QByteArray &uncompressedBytes)
|
||||||
#undef inflate
|
|
||||||
#endif
|
|
||||||
|
|
||||||
bool GZip::inflate(const QByteArray &compressedBytes, QByteArray &uncompressedBytes)
|
|
||||||
{
|
{
|
||||||
if (compressedBytes.size() == 0)
|
if (compressedBytes.size() == 0)
|
||||||
{
|
{
|
||||||
|
@ -6,6 +6,6 @@
|
|||||||
class MULTIMC_LOGIC_EXPORT GZip
|
class MULTIMC_LOGIC_EXPORT GZip
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
static bool inflate(const QByteArray &compressedBytes, QByteArray &uncompressedBytes);
|
static bool decompress(const QByteArray &compressedBytes, QByteArray &uncompressedBytes);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -175,7 +175,7 @@ static int64_t read_long (nbt::value& parent, const char * name, const int64_t &
|
|||||||
void World::parseLevelDat(QByteArray data)
|
void World::parseLevelDat(QByteArray data)
|
||||||
{
|
{
|
||||||
QByteArray output;
|
QByteArray output;
|
||||||
is_valid = GZip::inflate(data, output);
|
is_valid = GZip::decompress(data, output);
|
||||||
if(!is_valid)
|
if(!is_valid)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user