Manager/CMake: More thoroughly disable the update checker when no build number is present

This commit is contained in:
Alexander Babikov
2025-07-30 23:50:48 +05:00
parent 8915fa9263
commit 37481032ed
4 changed files with 25 additions and 13 deletions

View File

@@ -187,14 +187,6 @@ add_library(ui STATIC
qt_mediahistorymanager.cpp
qt_mediahistorymanager.hpp
qt_updatecheck.cpp
qt_updatecheck.hpp
qt_updatecheckdialog.cpp
qt_updatecheckdialog.hpp
qt_updatecheckdialog.ui
qt_updatedetails.cpp
qt_updatedetails.hpp
qt_updatedetails.ui
qt_downloader.cpp
qt_downloader.hpp
@@ -245,6 +237,19 @@ add_library(ui STATIC
qt_iconindicators.cpp
)
if(EMU_BUILD_NUM)
target_sources(ui PRIVATE
qt_updatecheck.cpp
qt_updatecheck.hpp
qt_updatecheckdialog.cpp
qt_updatecheckdialog.hpp
qt_updatecheckdialog.ui
qt_updatedetails.cpp
qt_updatedetails.hpp
qt_updatedetails.ui
)
endif()
if(RTMIDI)
target_compile_definitions(ui PRIVATE USE_RTMIDI)
endif()

View File

@@ -18,8 +18,6 @@
#ifndef QT_VMMANAGER_MAIN_H
#define QT_VMMANAGER_MAIN_H
#include "qt_updatecheck.hpp"
#include <QWidget>
#include "qt_vmmanager_model.hpp"
#include "qt_vmmanager_details.hpp"
@@ -31,6 +29,9 @@ extern "C" {
#include <86box/86box.h> // for vmm_path
}
#if EMU_BUILD_NUM != 0
# include "qt_updatecheck.hpp"
#endif
QT_BEGIN_NAMESPACE
namespace Ui { class VMManagerMain; }

View File

@@ -19,7 +19,9 @@
#include "qt_vmmanager_main.hpp"
#include "qt_vmmanager_preferences.hpp"
#include "ui_qt_vmmanager_mainwindow.h"
#include "qt_updatecheckdialog.hpp"
#if EMU_BUILD_NUM != 0
# include "qt_updatecheckdialog.hpp"
#endif
#include <QLineEdit>
#include <QStringListModel>
@@ -171,16 +173,18 @@ VMManagerMainWindow::setStatusRight(const QString &text) const
statusRight->setText(text);
}
#if EMU_BUILD_NUM != 0
void
VMManagerMainWindow::checkForUpdatesTriggered()
{
auto updateChannel = UpdateCheck::UpdateChannel::CI;
#ifdef RELEASE_BUILD
# ifdef RELEASE_BUILD
updateChannel = UpdateCheck::UpdateChannel::Stable;
#endif
# endif
const auto updateCheck = new UpdateCheckDialog(updateChannel);
updateCheck->exec();
}
#endif
void VMManagerMainWindow::on_actionExit_triggered()
{

View File

@@ -50,7 +50,9 @@ public slots:
private slots:
void vmmSelectionChanged(const QModelIndex &currentSelection, QProcess::ProcessState processState) const;
void preferencesTriggered();
#if EMU_BUILD_NUM != 0
static void checkForUpdatesTriggered();
#endif
void on_actionExit_triggered();