From a2a866669f8057ce2cc2431e023c0828b6c69cb1 Mon Sep 17 00:00:00 2001 From: Jeremy Borgman Date: Mon, 15 Mar 2021 17:45:59 -0500 Subject: [PATCH] Moved check to a more reasonable place, fixed issue where the api check could still happen from a constructor --- src/core/controller.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/core/controller.cpp b/src/core/controller.cpp index 9f05beab..1e5c16c0 100644 --- a/src/core/controller.cpp +++ b/src/core/controller.cpp @@ -104,7 +104,10 @@ Controller::Controller() qApp, [&]() { this->showRecentScreenshots(); }); #endif - getLatestAvailableVersion(); + + if (ConfigHandler().checkForUpdates()) { + getLatestAvailableVersion(); + } } Controller::~Controller() @@ -215,14 +218,11 @@ void Controller::handleReplyCheckUpdates(QNetworkReply* reply) void Controller::appUpdates() { - if (ConfigHandler().checkForUpdates()) { - - if (m_appLatestUrl.isEmpty()) { - m_showCheckAppUpdateStatus = true; - getLatestAvailableVersion(); - } else { - QDesktopServices::openUrl(QUrl(m_appLatestUrl)); - } + if (m_appLatestUrl.isEmpty()) { + m_showCheckAppUpdateStatus = true; + getLatestAvailableVersion(); + } else { + QDesktopServices::openUrl(QUrl(m_appLatestUrl)); } }