1
0
mirror of https://github.com/qTox/qTox.git synced 2024-03-22 14:00:36 +08:00

chore: disable broken autoupdater by default

This commit is contained in:
sudden6 2018-01-04 00:51:54 +01:00
parent a2feaf3fc6
commit 196529b8e8
No known key found for this signature in database
GPG Key ID: 279509B499E032B9
6 changed files with 19 additions and 11 deletions

View File

@ -9,6 +9,8 @@ set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)
option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra dependencies" ON) option(PLATFORM_EXTENSIONS "Enable platform specific extensions, requires extra dependencies" ON)
option(USE_FILTERAUDIO "Enable the echo canceling backend" ON) option(USE_FILTERAUDIO "Enable the echo canceling backend" ON)
# AUTOUPDATE is currently broken and thus disabled
option(AUTOUPDATE "Enable the auto updater" OFF)
if(NOT CMAKE_BUILD_TYPE) if(NOT CMAKE_BUILD_TYPE)
set(CMAKE_BUILD_TYPE Debug) set(CMAKE_BUILD_TYPE Debug)
@ -270,8 +272,6 @@ set(${PROJECT_NAME}_SOURCES
src/model/profile/iprofileinfo.h src/model/profile/iprofileinfo.h
src/model/profile/profileinfo.cpp src/model/profile/profileinfo.cpp
src/model/profile/profileinfo.h src/model/profile/profileinfo.h
src/net/autoupdate.cpp
src/net/autoupdate.h
src/net/avatarbroadcaster.cpp src/net/avatarbroadcaster.cpp
src/net/avatarbroadcaster.h src/net/avatarbroadcaster.h
src/net/toxme.cpp src/net/toxme.cpp
@ -568,6 +568,14 @@ if(${USE_FILTERAUDIO})
endif() endif()
endif() endif()
if(${AUTOUPDATE} AND (WIN32 OR APPLE))
add_definitions(-DAUTOUPDATE_ENABLED=1)
set(${PROJECT_NAME}_SOURCES ${${PROJECT_NAME}_SOURCES}
src/net/autoupdate.cpp
src/net/autoupdate.h)
message(STATUS "using autoupdater")
endif()
if (MINGW) if (MINGW)
STRING(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER) STRING(TOLOWER "${CMAKE_BUILD_TYPE}" CMAKE_BUILD_TYPE_LOWER)
if (CMAKE_BUILD_TYPE_LOWER MATCHES debug) if (CMAKE_BUILD_TYPE_LOWER MATCHES debug)

View File

@ -258,7 +258,7 @@ int main(int argc, char* argv[])
// Check whether we have an update waiting to be installed // Check whether we have an update waiting to be installed
#if AUTOUPDATE_ENABLED #ifdef AUTOUPDATE_ENABLED
if (AutoUpdater::isLocalUpdateReady()) if (AutoUpdater::isLocalUpdateReady())
AutoUpdater::installLocalUpdate(); ///< NORETURN AutoUpdater::installLocalUpdate(); ///< NORETURN
#endif #endif

View File

@ -28,14 +28,6 @@
#include <functional> #include <functional>
#include <sodium.h> #include <sodium.h>
#ifdef Q_OS_WIN
#define AUTOUPDATE_ENABLED 1
#elif defined(Q_OS_OSX)
#define AUTOUPDATE_ENABLED 1
#else
#define AUTOUPDATE_ENABLED 0
#endif
class AutoUpdater class AutoUpdater
{ {
public: public:

View File

@ -165,6 +165,7 @@ AboutForm::~AboutForm()
*/ */
void AboutForm::showUpdateProgress() void AboutForm::showUpdateProgress()
{ {
#ifdef AUTOUPDATE_ENABLED
QString version = AutoUpdater::getProgressVersion(); QString version = AutoUpdater::getProgressVersion();
int value = AutoUpdater::getProgressValue(); int value = AutoUpdater::getProgressValue();
@ -182,6 +183,7 @@ void AboutForm::showUpdateProgress()
bodyUI->updateProgress->setVisible(value != 0 && value != 100); bodyUI->updateProgress->setVisible(value != 0 && value != 100);
bodyUI->updateText->setVisible(value != 0); bodyUI->updateText->setVisible(value != 0);
} }
#endif
} }
void AboutForm::hideEvent(QHideEvent*) void AboutForm::hideEvent(QHideEvent*)

View File

@ -99,7 +99,11 @@ GeneralForm::GeneralForm(SettingsWidget* myParent)
Settings& s = Settings::getInstance(); Settings& s = Settings::getInstance();
#ifdef AUTOUPDATE_ENABLED
bodyUI->checkUpdates->setVisible(AUTOUPDATE_ENABLED); bodyUI->checkUpdates->setVisible(AUTOUPDATE_ENABLED);
#else
bodyUI->checkUpdates->setVisible(false);
#endif
bodyUI->checkUpdates->setChecked(s.getCheckUpdates()); bodyUI->checkUpdates->setChecked(s.getCheckUpdates());
for (int i = 0; i < locales.size(); ++i) { for (int i = 0; i < locales.size(); ++i) {

View File

@ -509,7 +509,9 @@ Widget::~Widget()
} }
Translator::unregister(this); Translator::unregister(this);
#ifdef AUTOUPDATE_ENABLED
AutoUpdater::abortUpdates(); AutoUpdater::abortUpdates();
#endif
if (icon) { if (icon) {
icon->hide(); icon->hide();
} }