Moved check to a more reasonable place, fixed issue where the api check could still happen from a constructor

This commit is contained in:
Jeremy Borgman
2021-03-15 17:45:59 -05:00
committed by borgmanJeremy
parent b3aa917bb0
commit a2a866669f

View File

@@ -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));
}
}