From e76729ce62b0217991f912593a2297a153125c16 Mon Sep 17 00:00:00 2001 From: GriffinR Date: Tue, 6 Feb 2024 16:15:56 -0500 Subject: [PATCH] Limit update promoter to Windows/macOS --- src/mainwindow.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index bc259533..3d094be2 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -41,6 +41,12 @@ #include #include +// We only publish release binaries for Windows and macOS. +// This is relevant for the update promoter, which alerts users of a new release. +#if defined(Q_OS_WIN) || defined(Q_OS_MACOS) +#define RELEASE_PLATFORM +#endif + using OrderedJson = poryjson::Json; using OrderedJsonDoc = poryjson::JsonDoc; @@ -111,6 +117,10 @@ void MainWindow::initWindow() { this->initShortcuts(); this->restoreWindowState(); +#ifndef RELEASE_PLATFORM + ui->actionCheck_for_Updates->setVisible(false); +#endif + setWindowDisabled(true); } @@ -254,6 +264,7 @@ void MainWindow::on_actionCheck_for_Updates_triggered() { checkForUpdates(true); } +#ifdef RELEASE_PLATFORM void MainWindow::checkForUpdates(bool requestedByUser) { if (!this->networkAccessManager) this->networkAccessManager = new NetworkAccessManager(this); @@ -278,6 +289,9 @@ void MainWindow::checkForUpdates(bool requestedByUser) { this->updatePromoter->checkForUpdates(); porymapConfig.setLastUpdateCheckTime(QDateTime::currentDateTime()); } +#else +void MainWindow::checkForUpdates(bool) {} +#endif void MainWindow::initEditor() { this->editor = new Editor(ui);