mirror of
https://git.citron-emu.org/citron/emulator
synced 2026-01-07 02:13:53 +00:00
fix: resolve Qt MOC generation for conditionally compiled UpdaterDialog
Move UpdaterDialog class declaration outside #ifdef _WIN32 to ensure Qt's MOC can see the Q_OBJECT macro. Add stub implementations for non-Windows platforms to satisfy linker. Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
@@ -1,8 +1,9 @@
|
||||
#ifdef _WIN32
|
||||
// SPDX-FileCopyrightText: Copyright 2025 citron Emulator Project
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
#include "citron/updater/updater_dialog.h"
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "ui_updater_dialog.h"
|
||||
|
||||
#include <QApplication>
|
||||
@@ -353,4 +354,45 @@ QString UpdaterDialog::GetUpdateMessage(Updater::UpdaterService::UpdateResult re
|
||||
|
||||
#include "updater_dialog.moc"
|
||||
|
||||
#else // _WIN32
|
||||
|
||||
// Forward declarations for non-Windows platforms
|
||||
namespace Updater {
|
||||
struct UpdateInfo {};
|
||||
class UpdaterService {
|
||||
public:
|
||||
enum class UpdateResult { Success };
|
||||
};
|
||||
}
|
||||
|
||||
// Stub implementations for non-Windows platforms
|
||||
UpdaterDialog::UpdaterDialog(QWidget* parent) : QDialog(parent) {}
|
||||
UpdaterDialog::~UpdaterDialog() = default;
|
||||
void UpdaterDialog::CheckForUpdates(const std::string&) {}
|
||||
void UpdaterDialog::ShowUpdateAvailable(const Updater::UpdateInfo&) {}
|
||||
void UpdaterDialog::ShowUpdateChecking() {}
|
||||
void UpdaterDialog::OnUpdateCheckCompleted(bool, const Updater::UpdateInfo&) {}
|
||||
void UpdaterDialog::OnUpdateDownloadProgress(int, qint64, qint64) {}
|
||||
void UpdaterDialog::OnUpdateInstallProgress(int, const QString&) {}
|
||||
void UpdaterDialog::OnUpdateCompleted(Updater::UpdaterService::UpdateResult, const QString&) {}
|
||||
void UpdaterDialog::OnUpdateError(const QString&) {}
|
||||
void UpdaterDialog::OnDownloadButtonClicked() {}
|
||||
void UpdaterDialog::OnCancelButtonClicked() {}
|
||||
void UpdaterDialog::OnCloseButtonClicked() {}
|
||||
void UpdaterDialog::OnRestartButtonClicked() {}
|
||||
void UpdaterDialog::SetupUI() {}
|
||||
void UpdaterDialog::ShowCheckingState() {}
|
||||
void UpdaterDialog::ShowNoUpdateState() {}
|
||||
void UpdaterDialog::ShowUpdateAvailableState() {}
|
||||
void UpdaterDialog::ShowDownloadingState() {}
|
||||
void UpdaterDialog::ShowInstallingState() {}
|
||||
void UpdaterDialog::ShowCompletedState() {}
|
||||
void UpdaterDialog::ShowErrorState() {}
|
||||
void UpdaterDialog::UpdateDownloadProgress(int, qint64, qint64) {}
|
||||
void UpdaterDialog::UpdateInstallProgress(int, const QString&) {}
|
||||
QString UpdaterDialog::FormatBytes(qint64) const { return QString(); }
|
||||
QString UpdaterDialog::GetUpdateMessage(Updater::UpdaterService::UpdateResult) const { return QString(); }
|
||||
|
||||
#include "updater_dialog.moc"
|
||||
|
||||
#endif // _WIN32
|
||||
|
||||
@@ -3,10 +3,10 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef _WIN32
|
||||
|
||||
#include <memory>
|
||||
#include <QDialog>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <QProgressBar>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
@@ -14,6 +14,13 @@
|
||||
#include <QTimer>
|
||||
|
||||
#include "citron/updater/updater_service.h"
|
||||
#else
|
||||
// Forward declarations for non-Windows platforms
|
||||
namespace Updater {
|
||||
struct UpdateInfo;
|
||||
class UpdaterService;
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace Ui {
|
||||
class UpdaterDialog;
|
||||
@@ -64,6 +71,7 @@ private:
|
||||
QString GetUpdateMessage(Updater::UpdaterService::UpdateResult result) const;
|
||||
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
std::unique_ptr<Ui::UpdaterDialog> ui;
|
||||
std::unique_ptr<Updater::UpdaterService> updater_service;
|
||||
|
||||
@@ -85,6 +93,5 @@ private:
|
||||
qint64 total_download_size = 0;
|
||||
qint64 downloaded_bytes = 0;
|
||||
QTimer* progress_timer;
|
||||
};
|
||||
|
||||
#endif // _WIN32
|
||||
#endif // _WIN32
|
||||
};
|
||||
Reference in New Issue
Block a user