Move LZMA usage under TDESKTOP_DISABLE_AUTOUPDATE

This commit is contained in:
Ilya Fedin 2021-09-07 22:36:42 +04:00 committed by John Preston
parent 84cbb98000
commit 60fb2d7c1f
2 changed files with 7 additions and 1 deletions

View File

@ -39,11 +39,13 @@ extern "C" {
#include <openssl/err.h>
} // extern "C"
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
#if defined Q_OS_WIN && !defined DESKTOP_APP_USE_PACKAGED // use Lzma SDK for win
#include <LzmaLib.h>
#else // Q_OS_WIN && !DESKTOP_APP_USE_PACKAGED
#include <lzma.h>
#endif // else of Q_OS_WIN && !DESKTOP_APP_USE_PACKAGED
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
#ifdef Q_OS_UNIX
#include <unistd.h>
@ -263,6 +265,7 @@ QString ExtractFilename(const QString &url) {
}
bool UnpackUpdate(const QString &filepath) {
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
QFile input(filepath);
if (!input.open(QIODevice::ReadOnly)) {
LOG(("Update Error: cant read updates file!"));
@ -516,6 +519,9 @@ bool UnpackUpdate(const QString &filepath) {
input.remove();
return true;
#else // !TDESKTOP_DISABLE_AUTOUPDATE
return false;
#endif // TDESKTOP_DISABLE_AUTOUPDATE
}
template <typename Callback>

2
cmake

@ -1 +1 @@
Subproject commit 95ee188c7b86b4448acbcfb01a42ac139cee6388
Subproject commit 98c52815e90f049af4e97209a2283584bfecc913