mirror of
https://github.com/nextcloud/desktop.git
synced 2024-10-26 06:15:48 +03:00
Logger: Guard zlib usage by ZLIB_FOUND
Similar to the use for the checksum. I know that zlib is required in principle, but i don't have it in one of my test building environment, and it is easier to just disable it.
This commit is contained in:
parent
b1dc14977f
commit
7969067f80
1 changed files with 6 additions and 0 deletions
|
@ -23,7 +23,9 @@
|
||||||
|
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
|
#ifdef ZLIB_FOUND
|
||||||
#include <zlib.h>
|
#include <zlib.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_WIN
|
#ifdef Q_OS_WIN
|
||||||
#include <io.h> // for stdout
|
#include <io.h> // for stdout
|
||||||
|
@ -261,6 +263,7 @@ void Logger::disableTemporaryFolderLogDir()
|
||||||
|
|
||||||
static bool compressLog(const QString &originalName, const QString &targetName)
|
static bool compressLog(const QString &originalName, const QString &targetName)
|
||||||
{
|
{
|
||||||
|
#ifdef ZLIB_FOUND
|
||||||
QFile original(originalName);
|
QFile original(originalName);
|
||||||
if (!original.open(QIODevice::ReadOnly))
|
if (!original.open(QIODevice::ReadOnly))
|
||||||
return false;
|
return false;
|
||||||
|
@ -279,6 +282,9 @@ static bool compressLog(const QString &originalName, const QString &targetName)
|
||||||
}
|
}
|
||||||
gzclose(compressed);
|
gzclose(compressed);
|
||||||
return true;
|
return true;
|
||||||
|
#else
|
||||||
|
return false;
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void Logger::enterNextLogFile()
|
void Logger::enterNextLogFile()
|
||||||
|
|
Loading…
Reference in a new issue