Fixed travis build for TDESKTOP_DISABLE_AUTOUPDATE case.

This commit is contained in:
John Preston 2016-10-18 10:56:38 +03:00
parent 086f754a96
commit fc7c5d0ab3
31 changed files with 89 additions and 87 deletions

View File

@ -2671,7 +2671,7 @@ namespace {
void setProxySettings(QNetworkAccessManager &manager) { void setProxySettings(QNetworkAccessManager &manager) {
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
manager.setProxy(getHttpProxySettings()); manager.setProxy(getHttpProxySettings());
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
} }
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
@ -2687,7 +2687,7 @@ namespace {
} }
return QNetworkProxy(QNetworkProxy::DefaultProxy); return QNetworkProxy(QNetworkProxy::DefaultProxy);
} }
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
void setProxySettings(QTcpSocket &socket) { void setProxySettings(QTcpSocket &socket) {
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
@ -2697,7 +2697,7 @@ namespace {
} else { } else {
socket.setProxy(QNetworkProxy(QNetworkProxy::NoProxy)); socket.setProxy(QNetworkProxy(QNetworkProxy::NoProxy));
} }
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
} }
QImage **cornersMask(ImageRoundRadius radius) { QImage **cornersMask(ImageRoundRadius radius) {

View File

@ -276,7 +276,7 @@ namespace App {
void setProxySettings(QNetworkAccessManager &manager); void setProxySettings(QNetworkAccessManager &manager);
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
QNetworkProxy getHttpProxySettings(); QNetworkProxy getHttpProxySettings();
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
void setProxySettings(QTcpSocket &socket); void setProxySettings(QTcpSocket &socket);
QImage **cornersMask(ImageRoundRadius radius); QImage **cornersMask(ImageRoundRadius radius);

View File

@ -118,7 +118,7 @@ Application::Application(int &argc, char **argv) : QApplication(argc, argv) {
connect(&_updateCheckTimer, SIGNAL(timeout()), this, SLOT(updateCheck())); connect(&_updateCheckTimer, SIGNAL(timeout()), this, SLOT(updateCheck()));
connect(this, SIGNAL(updateFailed()), this, SLOT(onUpdateFailed())); connect(this, SIGNAL(updateFailed()), this, SLOT(onUpdateFailed()));
connect(this, SIGNAL(updateReady()), this, SLOT(onUpdateReady())); connect(this, SIGNAL(updateReady()), this, SLOT(onUpdateReady()));
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
if (cManyInstance()) { if (cManyInstance()) {
LOG(("Many instance allowed, starting...")); LOG(("Many instance allowed, starting..."));
@ -210,7 +210,7 @@ void Application::socketError(QLocalSocket::LocalSocketError e) {
DEBUG_LOG(("Application Info: installing update instead of starting app...")); DEBUG_LOG(("Application Info: installing update instead of starting app..."));
return App::quit(); return App::quit();
} }
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
singleInstanceChecked(); singleInstanceChecked();
} }
@ -359,7 +359,7 @@ void Application::closeApplication() {
_updateThread->quit(); _updateThread->quit();
} }
_updateThread = 0; _updateThread = 0;
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
} }
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
@ -510,7 +510,7 @@ void Application::startUpdateCheck(bool forceWait) {
} }
} }
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
inline Application *application() { inline Application *application() {
return qobject_cast<Application*>(QApplication::instance()); return qobject_cast<Application*>(QApplication::instance());
@ -633,7 +633,7 @@ namespace Sandbox {
} }
} }
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
void connect(const char *signal, QObject *object, const char *method) { void connect(const char *signal, QObject *object, const char *method) {
if (Application *a = application()) { if (Application *a = application()) {
@ -796,7 +796,7 @@ AppClass::AppClass() : QObject()
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
QNetworkProxyFactory::setUseSystemConfiguration(true); QNetworkProxyFactory::setUseSystemConfiguration(true);
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
if (state != Local::ReadMapPassNeeded) { if (state != Local::ReadMapPassNeeded) {
checkMapVersion(); checkMapVersion();

View File

@ -99,7 +99,7 @@ private:
QThread *_updateThread = nullptr; QThread *_updateThread = nullptr;
UpdateChecker *_updateChecker = nullptr; UpdateChecker *_updateChecker = nullptr;
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
}; };
namespace Sandbox { namespace Sandbox {
@ -129,7 +129,7 @@ namespace Sandbox {
void updateFailed(); void updateFailed();
void updateReady(); void updateReady();
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
void connect(const char *signal, QObject *object, const char *method); void connect(const char *signal, QObject *object, const char *method);

View File

@ -42,10 +42,10 @@ Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
typedef DWORD VerInt; typedef DWORD VerInt;
typedef WCHAR VerChar; typedef WCHAR VerChar;
#else #else // Q_OS_WIN
typedef int VerInt; typedef int VerInt;
typedef wchar_t VerChar; typedef wchar_t VerChar;
#endif #endif // Q_OS_WIN
UpdateChecker::UpdateChecker(QThread *thread, const QString &url) : reply(0), already(0), full(0) { UpdateChecker::UpdateChecker(QThread *thread, const QString &url) : reply(0), already(0), full(0) {
updateUrl = url; updateUrl = url;
@ -248,9 +248,9 @@ void UpdateChecker::unpackUpdate() {
#ifdef Q_OS_WIN // use Lzma SDK for win #ifdef Q_OS_WIN // use Lzma SDK for win
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = LZMA_PROPS_SIZE, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hPropsLen + hOriginalSizeLen; // header const int32 hSigLen = 128, hShaLen = 20, hPropsLen = LZMA_PROPS_SIZE, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hPropsLen + hOriginalSizeLen; // header
#else #else // Q_OS_WIN
const int32 hSigLen = 128, hShaLen = 20, hPropsLen = 0, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hOriginalSizeLen; // header const int32 hSigLen = 128, hShaLen = 20, hPropsLen = 0, hOriginalSizeLen = sizeof(int32), hSize = hSigLen + hShaLen + hOriginalSizeLen; // header
#endif #endif // Q_OS_WIN
QByteArray compressed = outputFile.readAll(); QByteArray compressed = outputFile.readAll();
int32 compressedLen = compressed.size() - hSize; int32 compressedLen = compressed.size() - hSize;
@ -315,7 +315,7 @@ void UpdateChecker::unpackUpdate() {
LOG(("Update Error: could not uncompress lzma, code: %1").arg(uncompressRes)); LOG(("Update Error: could not uncompress lzma, code: %1").arg(uncompressRes));
return fatalFail(); return fatalFail();
} }
#else #else // Q_OS_WIN
lzma_stream stream = LZMA_STREAM_INIT; lzma_stream stream = LZMA_STREAM_INIT;
lzma_ret ret = lzma_stream_decoder(&stream, UINT64_MAX, LZMA_CONCATENATED); lzma_ret ret = lzma_stream_decoder(&stream, UINT64_MAX, LZMA_CONCATENATED);
@ -358,7 +358,7 @@ void UpdateChecker::unpackUpdate() {
LOG(("Error in decompression: %1 (error code %2)").arg(msg).arg(res)); LOG(("Error in decompression: %1 (error code %2)").arg(msg).arg(res));
return fatalFail(); return fatalFail();
} }
#endif #endif // Q_OS_WIN
tempDir.mkdir(tempDir.absolutePath()); tempDir.mkdir(tempDir.absolutePath());
@ -410,7 +410,7 @@ void UpdateChecker::unpackUpdate() {
stream >> relativeName >> fileSize >> fileInnerData; stream >> relativeName >> fileSize >> fileInnerData;
#if defined Q_OS_MAC || defined Q_OS_LINUX #if defined Q_OS_MAC || defined Q_OS_LINUX
stream >> executable; stream >> executable;
#endif #endif // Q_OS_MAC || Q_OS_LINUX
if (stream.status() != QDataStream::Ok) { if (stream.status() != QDataStream::Ok) {
LOG(("Update Error: cant read file from downloaded stream, status: %1").arg(stream.status())); LOG(("Update Error: cant read file from downloaded stream, status: %1").arg(stream.status()));
return fatalFail(); return fatalFail();
@ -534,13 +534,13 @@ bool checkReadyUpdate() {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
QString curUpdater = (cExeDir() + qsl("Updater.exe")); QString curUpdater = (cExeDir() + qsl("Updater.exe"));
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater.exe")); QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater.exe"));
#elif defined Q_OS_MAC #elif defined Q_OS_MAC // Q_OS_WIN
QString curUpdater = (cExeDir() + cExeName() + qsl("/Contents/Frameworks/Updater")); QString curUpdater = (cExeDir() + cExeName() + qsl("/Contents/Frameworks/Updater"));
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Telegram.app/Contents/Frameworks/Updater")); QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Telegram.app/Contents/Frameworks/Updater"));
#elif defined Q_OS_LINUX #elif defined Q_OS_LINUX // Q_OS_MAC
QString curUpdater = (cExeDir() + qsl("Updater")); QString curUpdater = (cExeDir() + qsl("Updater"));
QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater")); QFileInfo updater(cWorkingDir() + qsl("tupdates/temp/Updater"));
#endif #endif // Q_OS_LINUX
if (!updater.exists()) { if (!updater.exists()) {
QFileInfo current(curUpdater); QFileInfo current(curUpdater);
if (!current.exists()) { if (!current.exists()) {
@ -567,23 +567,23 @@ bool checkReadyUpdate() {
UpdateChecker::clearAll(); UpdateChecker::clearAll();
return false; return false;
} }
#elif defined Q_OS_MAC #elif defined Q_OS_MAC // Q_OS_WIN
QDir().mkpath(QFileInfo(curUpdater).absolutePath()); QDir().mkpath(QFileInfo(curUpdater).absolutePath());
DEBUG_LOG(("Update Info: moving %1 to %2...").arg(updater.absoluteFilePath()).arg(curUpdater)); DEBUG_LOG(("Update Info: moving %1 to %2...").arg(updater.absoluteFilePath()).arg(curUpdater));
if (!objc_moveFile(updater.absoluteFilePath(), curUpdater)) { if (!objc_moveFile(updater.absoluteFilePath(), curUpdater)) {
UpdateChecker::clearAll(); UpdateChecker::clearAll();
return false; return false;
} }
#elif defined Q_OS_LINUX #elif defined Q_OS_LINUX // Q_OS_MAC
if (!linuxMoveFile(QFile::encodeName(updater.absoluteFilePath()).constData(), QFile::encodeName(curUpdater).constData())) { if (!linuxMoveFile(QFile::encodeName(updater.absoluteFilePath()).constData(), QFile::encodeName(curUpdater).constData())) {
UpdateChecker::clearAll(); UpdateChecker::clearAll();
return false; return false;
} }
#endif #endif // Q_OS_LINUX
return true; return true;
} }
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
QString countBetaVersionSignature(uint64 version) { // duplicated in packer.cpp QString countBetaVersionSignature(uint64 version) { // duplicated in packer.cpp
if (cBetaPrivateKey().isEmpty()) { if (cBetaPrivateKey().isEmpty()) {

View File

@ -116,7 +116,7 @@ void AboutBox::dragEnterEvent(QDragEnterEvent *e) {
e->setDropAction(Qt::CopyAction); e->setDropAction(Qt::CopyAction);
e->accept(); e->accept();
} }
#endif #endif // !TDESKTOP_DISABLE_CRASH_REPORTS
} }
void AboutBox::dropEvent(QDropEvent *e) { void AboutBox::dropEvent(QDropEvent *e) {

View File

@ -192,7 +192,7 @@ void ConnectionBox::onSave() {
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
QNetworkProxyFactory::setUseSystemConfiguration(false); QNetworkProxyFactory::setUseSystemConfiguration(false);
QNetworkProxyFactory::setUseSystemConfiguration(true); QNetworkProxyFactory::setUseSystemConfiguration(true);
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
} }
if (cPlatform() == dbipWindows && Global::TryIPv6() != _tryIPv6.checked()) { if (cPlatform() == dbipWindows && Global::TryIPv6() != _tryIPv6.checked()) {
Global::SetTryIPv6(_tryIPv6.checked()); Global::SetTryIPv6(_tryIPv6.checked());

View File

@ -60,7 +60,7 @@ IntroWidget::IntroWidget(QWidget *parent) : TWidget(parent)
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
Sandbox::startUpdateCheck(); Sandbox::startUpdateCheck();
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
} }
void IntroWidget::langChangeTo(int32 langId) { void IntroWidget::langChangeTo(int32 langId) {

View File

@ -1079,9 +1079,11 @@ bool _readSetting(quint32 blockId, QDataStream &stream, int version) {
if (!_checkStreamStatus(stream)) return false; if (!_checkStreamStatus(stream)) return false;
cSetAutoUpdate(v == 1); cSetAutoUpdate(v == 1);
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
if (!cAutoUpdate()) { if (!cAutoUpdate()) {
Sandbox::stopUpdate(); Sandbox::stopUpdate();
} }
#endif // !TDESKTOP_DISABLE_AUTOUPDATE
} break; } break;
case dbiLastUpdateCheck: { case dbiLastUpdateCheck: {

View File

@ -592,8 +592,8 @@ void _moveOldDataFiles(const QString &wasDir) {
} }
if (!tdataConfig.exists() || tdataConfig.remove()) { if (!tdataConfig.exists() || tdataConfig.remove()) {
LOG(("Removed 'tdata/config'")); LOG(("Removed 'tdata/config'"));
LOG(("Could not remove 'tdata/config'"));
} else { } else {
LOG(("Could not remove 'tdata/config'"));
} }
QDir().rmdir(wasDir + "tdata"); QDir().rmdir(wasDir + "tdata");
} }

View File

@ -57,7 +57,7 @@ int main(int argc, char *argv[]) {
DEBUG_LOG(("Application Info: executing updater to install update...")); DEBUG_LOG(("Application Info: executing updater to install update..."));
psExecUpdater(); psExecUpdater();
} else } else
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
if (cRestarting()) { if (cRestarting()) {
DEBUG_LOG(("Application Info: executing Telegram, because of restart...")); DEBUG_LOG(("Application Info: executing Telegram, because of restart..."));
psExecTelegram(); psExecTelegram();

View File

@ -171,7 +171,7 @@ MainWidget::MainWidget(MainWindow *window) : TWidget(window)
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
Sandbox::startUpdateCheck(); Sandbox::startUpdateCheck();
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
} }
bool MainWidget::onForward(const PeerId &peer, ForwardWhatMessages what) { bool MainWidget::onForward(const PeerId &peer, ForwardWhatMessages what) {

View File

@ -1751,7 +1751,7 @@ LastCrashedWindow::LastCrashedWindow()
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
, _updatingCheck(this) , _updatingCheck(this)
, _updatingSkip(this, false) , _updatingSkip(this, false)
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
{ {
excludeReportUsername(); excludeReportUsername();
@ -1846,12 +1846,12 @@ LastCrashedWindow::LastCrashedWindow()
cSetLastUpdateCheck(0); cSetLastUpdateCheck(0);
Sandbox::startUpdateCheck(); Sandbox::startUpdateCheck();
#else #else // !TDESKTOP_DISABLE_AUTOUPDATE
_updating.setText(qsl("Please check if there is a new version available.")); _updating.setText(qsl("Please check if there is a new version available."));
if (_sendingState != SendingNoReport) { if (_sendingState != SendingNoReport) {
_sendingState = SendingNone; _sendingState = SendingNone;
} }
#endif #endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
_pleaseSendReport.setText(qsl("Please send us a crash report.")); _pleaseSendReport.setText(qsl("Please send us a crash report."));
_yourReportName.setText(qsl("Your Report Tag: %1\nYour User Tag: %2").arg(QString(_minidumpName).replace(".dmp", "")).arg(Sandbox::UserTag(), 0, 16)); _yourReportName.setText(qsl("Your Report Tag: %1\nYour User Tag: %2").arg(QString(_minidumpName).replace(".dmp", "")).arg(Sandbox::UserTag(), 0, 16));
@ -2308,7 +2308,7 @@ void LastCrashedWindow::updateControls() {
_updatingSkip.hide(); _updatingSkip.hide();
} }
} }
#else #else // !TDESKTOP_DISABLE_AUTOUPDATE
h += _networkSettings.height() + padding; h += _networkSettings.height() + padding;
h += padding + _send.height() + padding; h += padding + _send.height() + padding;
if (_sendingState == SendingNoReport) { if (_sendingState == SendingNoReport) {
@ -2380,7 +2380,7 @@ void LastCrashedWindow::updateControls() {
_getApp.show(); _getApp.show();
h += _networkSettings.height() + padding; h += _networkSettings.height() + padding;
#endif #endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
QRect scr(QApplication::primaryScreen()->availableGeometry()); QRect scr(QApplication::primaryScreen()->availableGeometry());
QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h); QSize s(2 * padding + QFontMetrics(_label.font()).width(qsl("Last time Telegram Desktop was not closed properly.")) + padding + _networkSettings.width(), h);
@ -2409,7 +2409,7 @@ void LastCrashedWindow::onNetworkSettingsSaved(QString host, quint32 port, QStri
cSetLastUpdateCheck(0); cSetLastUpdateCheck(0);
Sandbox::startUpdateCheck(); Sandbox::startUpdateCheck();
} else } else
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
if (_sendingState == SendingFail || _sendingState == SendingProgress) { if (_sendingState == SendingFail || _sendingState == SendingProgress) {
onSendReport(); onSendReport();
} }
@ -2500,7 +2500,7 @@ void LastCrashedWindow::onUpdateReady() {
void LastCrashedWindow::onUpdateFailed() { void LastCrashedWindow::onUpdateFailed() {
setUpdatingState(UpdatingFail); setUpdatingState(UpdatingFail);
} }
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
void LastCrashedWindow::onContinue() { void LastCrashedWindow::onContinue() {
if (SignalHandlers::restart() == SignalHandlers::CantOpen) { if (SignalHandlers::restart() == SignalHandlers::CantOpen) {
@ -2591,7 +2591,7 @@ void LastCrashedWindow::resizeEvent(QResizeEvent *e) {
_updatingCheck.move(width() - padding - _updatingCheck.width(), height() - padding - _updatingCheck.height()); _updatingCheck.move(width() - padding - _updatingCheck.width(), height() - padding - _updatingCheck.height());
_updatingSkip.move(width() - padding - _updatingCheck.width() - padding - _updatingSkip.width(), height() - padding - _updatingSkip.height()); _updatingSkip.move(width() - padding - _updatingCheck.width() - padding - _updatingSkip.width(), height() - padding - _updatingSkip.height());
} }
#else #else // !TDESKTOP_DISABLE_AUTOUPDATE
_getApp.move((width() - _getApp.width()) / 2, _updating.y() + _updating.height() + padding); _getApp.move((width() - _getApp.width()) / 2, _updating.y() + _updating.height() + padding);
_pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2); _pleaseSendReport.move(padding, padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding + (_showReport.height() - _pleaseSendReport.height()) / 2);
@ -2600,7 +2600,7 @@ void LastCrashedWindow::resizeEvent(QResizeEvent *e) {
_includeUsername.move(padding, _yourReportName.y() + _yourReportName.height() + padding); _includeUsername.move(padding, _yourReportName.y() + _yourReportName.height() + padding);
_networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding); _networkSettings.move(padding * 2 + _pleaseSendReport.width(), padding * 2 + _networkSettings.height() + _networkSettings.height() + padding + _getApp.height() + padding);
#endif #endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
if (_reportUsername.isEmpty()) { if (_reportUsername.isEmpty()) {
_report.setGeometry(padding, _yourReportName.y() + _yourReportName.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5); _report.setGeometry(padding, _yourReportName.y() + _yourReportName.height() + padding, width() - 2 * padding, _pleaseSendReport.height() * 12.5);
} else { } else {

View File

@ -387,7 +387,7 @@ public slots:
void onUpdateDownloading(qint64 ready, qint64 total); void onUpdateDownloading(qint64 ready, qint64 total);
void onUpdateReady(); void onUpdateReady();
void onUpdateFailed(); void onUpdateFailed();
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
protected: protected:
@ -450,7 +450,7 @@ private:
void setUpdatingState(UpdatingState state, bool force = false); void setUpdatingState(UpdatingState state, bool force = false);
void setDownloadProgress(qint64 ready, qint64 total); void setDownloadProgress(qint64 ready, qint64 total);
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
QString getReportField(const QLatin1String &name, const QLatin1String &prefix); QString getReportField(const QLatin1String &name, const QLatin1String &prefix);
void addReportFieldPart(const QLatin1String &name, const QLatin1String &prefix, QHttpMultiPart *multipart); void addReportFieldPart(const QLatin1String &name, const QLatin1String &prefix, QHttpMultiPart *multipart);

View File

@ -37,7 +37,7 @@ AutoConnection::AutoConnection(QThread *thread) : AbstractTCPConnection(thread)
manager.moveToThread(thread); manager.moveToThread(thread);
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
manager.setProxy(QNetworkProxy(QNetworkProxy::DefaultProxy)); manager.setProxy(QNetworkProxy(QNetworkProxy::DefaultProxy));
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
httpStartTimer.moveToThread(thread); httpStartTimer.moveToThread(thread);
httpStartTimer.setSingleShot(true); httpStartTimer.setSingleShot(true);
@ -50,7 +50,7 @@ AutoConnection::AutoConnection(QThread *thread) : AbstractTCPConnection(thread)
sock.moveToThread(thread); sock.moveToThread(thread);
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
sock.setProxy(QNetworkProxy(QNetworkProxy::NoProxy)); sock.setProxy(QNetworkProxy(QNetworkProxy::NoProxy));
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
connect(&sock, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError))); connect(&sock, SIGNAL(error(QAbstractSocket::SocketError)), this, SLOT(socketError(QAbstractSocket::SocketError)));
connect(&sock, SIGNAL(connected()), this, SLOT(onSocketConnected())); connect(&sock, SIGNAL(connected()), this, SLOT(onSocketConnected()));
connect(&sock, SIGNAL(disconnected()), this, SLOT(onSocketDisconnected())); connect(&sock, SIGNAL(disconnected()), this, SLOT(onSocketDisconnected()));

View File

@ -769,7 +769,7 @@ void reinitWebLoadManager() {
if (webLoadManager()) { if (webLoadManager()) {
webLoadManager()->setProxySettings(App::getHttpProxySettings()); webLoadManager()->setProxySettings(App::getHttpProxySettings());
} }
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
} }
void stopWebLoadManager() { void stopWebLoadManager() {
@ -792,7 +792,7 @@ void WebLoadManager::setProxySettings(const QNetworkProxy &proxy) {
_proxySettings = proxy; _proxySettings = proxy;
emit proxyApplyDelayed(); emit proxyApplyDelayed();
} }
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
WebLoadManager::WebLoadManager(QThread *thread) { WebLoadManager::WebLoadManager(QThread *thread) {
moveToThread(thread); moveToThread(thread);
@ -1024,7 +1024,7 @@ void WebLoadManager::proxyApply() {
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
QMutexLocker lock(&_loaderPointersMutex); QMutexLocker lock(&_loaderPointersMutex);
_manager.setProxy(_proxySettings); _manager.setProxy(_proxySettings);
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
} }
void WebLoadManager::finish() { void WebLoadManager::finish() {

View File

@ -331,7 +331,7 @@ public:
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
void setProxySettings(const QNetworkProxy &proxy); void setProxySettings(const QNetworkProxy &proxy);
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
void append(webFileLoader *loader, const QString &url); void append(webFileLoader *loader, const QString &url);
void stop(webFileLoader *reader); void stop(webFileLoader *reader);
@ -364,7 +364,7 @@ private:
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
QNetworkProxy _proxySettings; QNetworkProxy _proxySettings;
#endif #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
QNetworkAccessManager _manager; QNetworkAccessManager _manager;
typedef QMap<webFileLoader*, webFileLoaderPrivate*> LoaderPointers; typedef QMap<webFileLoader*, webFileLoaderPrivate*> LoaderPointers;
LoaderPointers _loaderPointers; LoaderPointers _loaderPointers;

View File

@ -209,7 +209,7 @@ f_g_slist_free g_slist_free = nullptr;
f_unity_launcher_entry_set_count unity_launcher_entry_set_count = nullptr; f_unity_launcher_entry_set_count unity_launcher_entry_set_count = nullptr;
f_unity_launcher_entry_set_count_visible unity_launcher_entry_set_count_visible = nullptr; f_unity_launcher_entry_set_count_visible unity_launcher_entry_set_count_visible = nullptr;
f_unity_launcher_entry_get_for_desktop_id unity_launcher_entry_get_for_desktop_id = nullptr; f_unity_launcher_entry_get_for_desktop_id unity_launcher_entry_get_for_desktop_id = nullptr;
#endif // TDESKTOP_DISABLE_UNITY_INTEGRATION #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
void start() { void start() {
DEBUG_LOG(("Loading libraries")); DEBUG_LOG(("Loading libraries"));
@ -279,7 +279,7 @@ void start() {
load(lib_unity, "unity_launcher_entry_set_count", unity_launcher_entry_set_count); load(lib_unity, "unity_launcher_entry_set_count", unity_launcher_entry_set_count);
load(lib_unity, "unity_launcher_entry_set_count_visible", unity_launcher_entry_set_count_visible); load(lib_unity, "unity_launcher_entry_set_count_visible", unity_launcher_entry_set_count_visible);
} }
#endif // TDESKTOP_DISABLE_UNITY_INTEGRATION #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
if (gtkLoaded) { if (gtkLoaded) {
startLibNotify(); startLibNotify();

View File

@ -30,7 +30,7 @@ extern "C" {
#ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION #ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION
#include <unity/unity/unity.h> #include <unity/unity/unity.h>
#endif // TDESKTOP_DISABLE_UNITY_INTEGRATION #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
namespace Platform { namespace Platform {
namespace Libs { namespace Libs {
@ -351,7 +351,7 @@ extern f_unity_launcher_entry_set_count_visible unity_launcher_entry_set_count_v
typedef UnityLauncherEntry* (*f_unity_launcher_entry_get_for_desktop_id)(const gchar* desktop_id); typedef UnityLauncherEntry* (*f_unity_launcher_entry_get_for_desktop_id)(const gchar* desktop_id);
extern f_unity_launcher_entry_get_for_desktop_id unity_launcher_entry_get_for_desktop_id; extern f_unity_launcher_entry_get_for_desktop_id unity_launcher_entry_get_for_desktop_id;
#endif // TDESKTOP_DISABLE_UNITY_INTEGRATION #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
} // namespace Libs } // namespace Libs
} // namespace Platform } // namespace Platform

View File

@ -173,7 +173,7 @@ static gboolean _trayIconCheck(gpointer/* pIn*/) {
#ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION #ifndef TDESKTOP_DISABLE_UNITY_INTEGRATION
UnityLauncherEntry *_psUnityLauncherEntry = nullptr; UnityLauncherEntry *_psUnityLauncherEntry = nullptr;
#endif // TDESKTOP_DISABLE_UNITY_INTEGRATION #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
} // namespace } // namespace
@ -326,7 +326,7 @@ void MainWindow::psUpdateCounter() {
Libs::unity_launcher_entry_set_count_visible(_psUnityLauncherEntry, FALSE); Libs::unity_launcher_entry_set_count_visible(_psUnityLauncherEntry, FALSE);
} }
} }
#endif // TDESKTOP_DISABLE_UNITY_INTEGRATION #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
if (noQtTrayIcon) { if (noQtTrayIcon) {
if (useAppIndicator) { if (useAppIndicator) {
@ -427,7 +427,7 @@ void MainWindow::LibsLoaded() {
if (useUnityCount) { if (useUnityCount) {
DEBUG_LOG(("Unity count api loaded!")); DEBUG_LOG(("Unity count api loaded!"));
} }
#endif // TDESKTOP_DISABLE_UNITY_INTEGRATION #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
} }
void MainWindow::psInitSize() { void MainWindow::psInitSize() {
@ -617,7 +617,7 @@ void MainWindow::psFirstShow() {
} else { } else {
LOG(("Not using Unity Launcher count.")); LOG(("Not using Unity Launcher count."));
} }
#endif // TDESKTOP_DISABLE_UNITY_INTEGRATION #endif // !TDESKTOP_DISABLE_UNITY_INTEGRATION
psUpdateMargins(); psUpdateMargins();

View File

@ -422,11 +422,11 @@ namespace {
} }
void psRegisterCustomScheme() { void psRegisterCustomScheme() {
#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME #ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
QString home(_psHomeDir()); QString home(_psHomeDir());
if (home.isEmpty() || cBetaVersion()) return; // don't update desktop file for beta version if (home.isEmpty() || cBetaVersion()) return; // don't update desktop file for beta version
#ifndef TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION #ifndef TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
DEBUG_LOG(("App Info: placing .desktop file")); DEBUG_LOG(("App Info: placing .desktop file"));
if (QDir(home + qsl(".local/")).exists()) { if (QDir(home + qsl(".local/")).exists()) {
QString apps = home + qsl(".local/share/applications/"); QString apps = home + qsl(".local/share/applications/");
@ -473,7 +473,7 @@ void psRegisterCustomScheme() {
LOG(("App Error: Could not open '%1' for write").arg(file)); LOG(("App Error: Could not open '%1' for write").arg(file));
} }
} }
#endif // TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION #endif // !TDESKTOP_DISABLE_DESKTOP_FILE_GENERATION
DEBUG_LOG(("App Info: registerting for Gnome")); DEBUG_LOG(("App Info: registerting for Gnome"));
if (_psRunCommand("gconftool-2 -t string -s /desktop/gnome/url-handlers/tg/command " + escapeShell(escapeShell(QFile::encodeName(cExeDir() + cExeName())) + " -- %s"))) { if (_psRunCommand("gconftool-2 -t string -s /desktop/gnome/url-handlers/tg/command " + escapeShell(escapeShell(QFile::encodeName(cExeDir() + cExeName())) + " -- %s"))) {
@ -512,7 +512,7 @@ void psRegisterCustomScheme() {
LOG(("App Error: Could not open '%1' for write").arg(file)); LOG(("App Error: Could not open '%1' for write").arg(file));
} }
} }
#endif #endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
} }
void psNewVersion() { void psNewVersion() {

View File

@ -914,10 +914,10 @@ void objc_finish() {
} }
void objc_registerCustomScheme() { void objc_registerCustomScheme() {
#ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME #ifndef TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
OSStatus result = LSSetDefaultHandlerForURLScheme(CFSTR("tg"), (CFStringRef)[[NSBundle mainBundle] bundleIdentifier]); OSStatus result = LSSetDefaultHandlerForURLScheme(CFSTR("tg"), (CFStringRef)[[NSBundle mainBundle] bundleIdentifier]);
DEBUG_LOG(("App Info: set default handler for 'tg' scheme result: %1").arg(result)); DEBUG_LOG(("App Info: set default handler for 'tg' scheme result: %1").arg(result));
#endif #endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
} }
BOOL _execUpdater(BOOL update = YES, const QString &crashreport = QString()) { BOOL _execUpdater(BOOL update = YES, const QString &crashreport = QString()) {

View File

@ -809,7 +809,7 @@ void RegisterCustomScheme() {
if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open", &rkey)) return; if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open", &rkey)) return;
if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open\\command", &rkey)) return; if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open\\command", &rkey)) return;
if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return; if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return;
#endif #endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
} }
void psNewVersion() { void psNewVersion() {

View File

@ -2264,7 +2264,7 @@ void RegisterCustomScheme() {
//if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open", &rkey)) return; //if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open", &rkey)) return;
//if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open\\command", &rkey)) return; //if (!_psOpenRegKey(L"Software\\Classes\\tg\\shell\\open\\command", &rkey)) return;
//if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return; //if (!_psSetKeyValue(rkey, 0, '"' + exe + qsl("\" -workdir \"") + cWorkingDir() + qsl("\" -- \"%1\""))) return;
#endif #endif // !TDESKTOP_DISABLE_REGISTER_CUSTOM_SCHEME
} }
void psNewVersion() { void psNewVersion() {

View File

@ -37,7 +37,7 @@ AdvancedWidget::AdvancedWidget(QWidget *parent, UserData *self) : BlockWidget(pa
subscribe(Global::RefConnectionTypeChanged(), [this]() { subscribe(Global::RefConnectionTypeChanged(), [this]() {
connectionTypeUpdated(); connectionTypeUpdated();
}); });
#endif // TDESKTOP_DISABLE_NETWORK_PROXY #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
} }
void AdvancedWidget::createControls() { void AdvancedWidget::createControls() {
@ -47,7 +47,7 @@ void AdvancedWidget::createControls() {
style::margins marginLocalStorage = ([&marginSmall, &marginLarge]() { style::margins marginLocalStorage = ([&marginSmall, &marginLarge]() {
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
return marginSmall; return marginSmall;
#else // TDESKTOP_DISABLE_NETWORK_PROXY #else // !TDESKTOP_DISABLE_NETWORK_PROXY
return marginLarge; return marginLarge;
#endif // TDESKTOP_DISABLE_NETWORK_PROXY #endif // TDESKTOP_DISABLE_NETWORK_PROXY
})(); })();
@ -58,7 +58,7 @@ void AdvancedWidget::createControls() {
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
addChildRow(_connectionType, marginLarge, lang(lng_connection_type), lang(lng_connection_auto_connecting), LabeledLink::Type::Primary, SLOT(onConnectionType())); addChildRow(_connectionType, marginLarge, lang(lng_connection_type), lang(lng_connection_auto_connecting), LabeledLink::Type::Primary, SLOT(onConnectionType()));
connectionTypeUpdated(); connectionTypeUpdated();
#endif // TDESKTOP_DISABLE_NETWORK_PROXY #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
if (self()) { if (self()) {
addChildRow(_askQuestion, marginSmall, lang(lng_settings_ask_question), SLOT(onAskQuestion())); addChildRow(_askQuestion, marginSmall, lang(lng_settings_ask_question), SLOT(onAskQuestion()));
@ -95,7 +95,7 @@ void AdvancedWidget::connectionTypeUpdated() {
void AdvancedWidget::onConnectionType() { void AdvancedWidget::onConnectionType() {
Ui::showLayer(new ConnectionBox()); Ui::showLayer(new ConnectionBox());
} }
#endif // TDESKTOP_DISABLE_NETWORK_PROXY #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
void AdvancedWidget::onAskQuestion() { void AdvancedWidget::onAskQuestion() {
ConfirmBox *box = new ConfirmBox(lang(lng_settings_ask_sure), lang(lng_settings_ask_ok), st::defaultBoxButton, lang(lng_settings_faq_button)); ConfirmBox *box = new ConfirmBox(lang(lng_settings_ask_sure), lang(lng_settings_ask_ok), st::defaultBoxButton, lang(lng_settings_faq_button));

View File

@ -35,7 +35,7 @@ private slots:
void onManageLocalStorage(); void onManageLocalStorage();
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
void onConnectionType(); void onConnectionType();
#endif // TDESKTOP_DISABLE_NETWORK_PROXY #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
void onAskQuestion(); void onAskQuestion();
void onAskQuestionSure(); void onAskQuestionSure();
void onTelegramFAQ(); void onTelegramFAQ();
@ -45,13 +45,13 @@ private:
void createControls(); void createControls();
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
void connectionTypeUpdated(); void connectionTypeUpdated();
#endif // TDESKTOP_DISABLE_NETWORK_PROXY #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
void supportGot(const MTPhelp_Support &support); void supportGot(const MTPhelp_Support &support);
ChildWidget<LinkButton> _manageLocalStorage = { nullptr }; ChildWidget<LinkButton> _manageLocalStorage = { nullptr };
#ifndef TDESKTOP_DISABLE_NETWORK_PROXY #ifndef TDESKTOP_DISABLE_NETWORK_PROXY
ChildWidget<LabeledLink> _connectionType = { nullptr }; ChildWidget<LabeledLink> _connectionType = { nullptr };
#endif // TDESKTOP_DISABLE_NETWORK_PROXY #endif // !TDESKTOP_DISABLE_NETWORK_PROXY
ChildWidget<LinkButton> _askQuestion = { nullptr }; ChildWidget<LinkButton> _askQuestion = { nullptr };
ChildWidget<LinkButton> _telegramFAQ = { nullptr }; ChildWidget<LinkButton> _telegramFAQ = { nullptr };
ChildWidget<LinkButton> _logOut = { nullptr }; ChildWidget<LinkButton> _logOut = { nullptr };

View File

@ -165,7 +165,7 @@ void UpdateStateRow::onReady() {
void UpdateStateRow::onFailed() { void UpdateStateRow::onFailed() {
setState(State::Fail); setState(State::Fail);
} }
#endif // TDESKTOP_DISABLE_AUTOUPDATE #endif // !TDESKTOP_DISABLE_AUTOUPDATE
GeneralWidget::GeneralWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_general)) GeneralWidget::GeneralWidget(QWidget *parent, UserData *self) : BlockWidget(parent, self, lang(lng_settings_section_general))
, _changeLanguage(this, lang(lng_settings_change_lang), st::defaultBoxLinkButton) { , _changeLanguage(this, lang(lng_settings_change_lang), st::defaultBoxLinkButton) {
@ -196,7 +196,7 @@ void GeneralWidget::refreshControls() {
if (!cAutoUpdate()) { if (!cAutoUpdate()) {
_updateRow->hideFast(); _updateRow->hideFast();
} }
#endif // TDESKTOP_DISABLE_AUTOUPDATE #endif // !TDESKTOP_DISABLE_AUTOUPDATE
if (cPlatform() == dbipWindows || cSupportTray()) { if (cPlatform() == dbipWindows || cSupportTray()) {
addChildRow(_enableTrayIcon, marginSmall, lang(lng_settings_workmode_tray), SLOT(onEnableTrayIcon()), (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray)); addChildRow(_enableTrayIcon, marginSmall, lang(lng_settings_workmode_tray), SLOT(onEnableTrayIcon()), (cWorkMode() == dbiwmTrayOnly || cWorkMode() == dbiwmWindowAndTray));
@ -269,10 +269,10 @@ void GeneralWidget::onRestart() {
cSetRestarting(true); cSetRestarting(true);
cSetRestartingToSettings(true); cSetRestartingToSettings(true);
} }
#else #else // !TDESKTOP_DISABLE_AUTOUPDATE
cSetRestarting(true); cSetRestarting(true);
cSetRestartingToSettings(true); cSetRestartingToSettings(true);
#endif #endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
App::quit(); App::quit();
} }
@ -288,7 +288,7 @@ void GeneralWidget::onUpdateAutomatically() {
Sandbox::stopUpdate(); Sandbox::stopUpdate();
} }
} }
#endif // TDESKTOP_DISABLE_AUTOUPDATE #endif // !TDESKTOP_DISABLE_AUTOUPDATE
void GeneralWidget::onEnableTrayIcon() { void GeneralWidget::onEnableTrayIcon() {
if ((!_enableTrayIcon->checked() || cPlatform() != dbipWindows) && _enableTaskbarIcon && !_enableTaskbarIcon->checked()) { if ((!_enableTrayIcon->checked() || cPlatform() != dbipWindows) && _enableTaskbarIcon && !_enableTaskbarIcon->checked()) {

View File

@ -80,7 +80,7 @@ private:
QString _downloadText; QString _downloadText;
}; };
#endif // TDESKTOP_DISABLE_AUTOUPDATE #endif // !TDESKTOP_DISABLE_AUTOUPDATE
class GeneralWidget : public BlockWidget { class GeneralWidget : public BlockWidget {
Q_OBJECT Q_OBJECT
@ -97,7 +97,7 @@ private slots:
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
void onUpdateAutomatically(); void onUpdateAutomatically();
#endif // TDESKTOP_DISABLE_AUTOUPDATE #endif // !TDESKTOP_DISABLE_AUTOUPDATE
void onEnableTrayIcon(); void onEnableTrayIcon();
void onEnableTaskbarIcon(); void onEnableTaskbarIcon();
@ -118,7 +118,7 @@ private:
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
ChildWidget<Checkbox> _updateAutomatically = { nullptr }; ChildWidget<Checkbox> _updateAutomatically = { nullptr };
ChildWidget<Ui::WidgetSlideWrap<UpdateStateRow>> _updateRow = { nullptr }; ChildWidget<Ui::WidgetSlideWrap<UpdateStateRow>> _updateRow = { nullptr };
#endif // TDESKTOP_DISABLE_AUTOUPDATE #endif // !TDESKTOP_DISABLE_AUTOUPDATE
ChildWidget<Checkbox> _enableTrayIcon = { nullptr }; ChildWidget<Checkbox> _enableTrayIcon = { nullptr };
ChildWidget<Checkbox> _enableTaskbarIcon = { nullptr }; ChildWidget<Checkbox> _enableTaskbarIcon = { nullptr };
ChildWidget<Checkbox> _autoStart = { nullptr }; ChildWidget<Checkbox> _autoStart = { nullptr };

View File

@ -118,9 +118,9 @@ void ScaleWidget::scaleChanged() {
void ScaleWidget::onRestartNow() { void ScaleWidget::onRestartNow() {
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
bool updateReady = (Sandbox::updatingState() == Application::UpdatingReady); bool updateReady = (Sandbox::updatingState() == Application::UpdatingReady);
#else #else // !TDESKTOP_DISABLE_AUTOUPDATE
bool updateReady = false; bool updateReady = false;
#endif #endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
if (updateReady) { if (updateReady) {
cSetRestartingUpdate(true); cSetRestartingUpdate(true);
} else { } else {

View File

@ -138,7 +138,7 @@ UpdateBtn::UpdateBtn(QWidget *parent) : SysBtn(parent, st::sysUpd, lang(lng_menu
if (Sandbox::updatingState() == Application::UpdatingReady) { if (Sandbox::updatingState() == Application::UpdatingReady) {
cSetRestartingUpdate(true); cSetRestartingUpdate(true);
} else } else
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
{ {
cSetRestarting(true); cSetRestarting(true);
cSetRestartingToSettings(false); cSetRestartingToSettings(false);

View File

@ -99,7 +99,7 @@ TitleWidget::TitleWidget(QWidget *parent) : TWidget(parent)
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
Sandbox::connect(SIGNAL(updateReady()), this, SLOT(updateControlsVisibility())); Sandbox::connect(SIGNAL(updateReady()), this, SLOT(updateControlsVisibility()));
#endif #endif // !TDESKTOP_DISABLE_AUTOUPDATE
subscribe(Adaptive::Changed(), [this]() { updateAdaptiveLayout(); }); subscribe(Adaptive::Changed(), [this]() { updateAdaptiveLayout(); });
if (Media::Player::exists()) { if (Media::Player::exists()) {
@ -248,9 +248,9 @@ void TitleWidget::updateControlsVisibility() {
void TitleWidget::updateRestartButtonVisibility() { void TitleWidget::updateRestartButtonVisibility() {
#ifndef TDESKTOP_DISABLE_AUTOUPDATE #ifndef TDESKTOP_DISABLE_AUTOUPDATE
bool updateReady = (Sandbox::updatingState() == Application::UpdatingReady); bool updateReady = (Sandbox::updatingState() == Application::UpdatingReady);
#else #else // !TDESKTOP_DISABLE_AUTOUPDATE
bool updateReady = false; bool updateReady = false;
#endif #endif // else for !TDESKTOP_DISABLE_AUTOUPDATE
auto scaleRestarting = cEvalScale(cConfigScale()) != cEvalScale(cRealScale()); auto scaleRestarting = cEvalScale(cConfigScale()) != cEvalScale(cRealScale());
auto updateVisible = _cancel.isHidden() && (updateReady || scaleRestarting); auto updateVisible = _cancel.isHidden() && (updateReady || scaleRestarting);