mirror of
https://git.citron-emu.org/citron/emulator
synced 2025-12-19 10:43:33 +00:00
fix: resolve UpdaterService redefinition error with conditional compilation
Signed-off-by: Zephyron <zephyron@citron-emu.org>
This commit is contained in:
@@ -374,7 +374,11 @@ void UpdaterDialog::ShowUpdateChecking() {}
|
||||
void UpdaterDialog::OnUpdateCheckCompleted(bool, const Updater::UpdateInfo&) {}
|
||||
void UpdaterDialog::OnUpdateDownloadProgress(int, qint64, qint64) {}
|
||||
void UpdaterDialog::OnUpdateInstallProgress(int, const QString&) {}
|
||||
#ifdef _WIN32
|
||||
void UpdaterDialog::OnUpdateCompleted(Updater::UpdaterService::UpdateResult, const QString&) {}
|
||||
#else
|
||||
void UpdaterDialog::OnUpdateCompleted(int, const QString&) {}
|
||||
#endif
|
||||
void UpdaterDialog::OnUpdateError(const QString&) {}
|
||||
void UpdaterDialog::OnDownloadButtonClicked() {}
|
||||
void UpdaterDialog::OnCancelButtonClicked() {}
|
||||
@@ -391,7 +395,11 @@ void UpdaterDialog::ShowErrorState() {}
|
||||
void UpdaterDialog::UpdateDownloadProgress(int, qint64, qint64) {}
|
||||
void UpdaterDialog::UpdateInstallProgress(int, const QString&) {}
|
||||
QString UpdaterDialog::FormatBytes(qint64) const { return QString(); }
|
||||
#ifdef _WIN32
|
||||
QString UpdaterDialog::GetUpdateMessage(Updater::UpdaterService::UpdateResult) const { return QString(); }
|
||||
#else
|
||||
QString UpdaterDialog::GetUpdateMessage(int) const { return QString(); }
|
||||
#endif
|
||||
|
||||
#include "updater_dialog.moc"
|
||||
|
||||
|
||||
@@ -6,31 +6,19 @@
|
||||
#include <memory>
|
||||
#include <QDialog>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include <QProgressBar>
|
||||
#include <QLabel>
|
||||
#include <QPushButton>
|
||||
#include <QTextBrowser>
|
||||
#include <QTimer>
|
||||
|
||||
#ifdef _WIN32
|
||||
#include "citron/updater/updater_service.h"
|
||||
#else
|
||||
// Forward declarations for non-Windows platforms
|
||||
namespace Updater {
|
||||
struct UpdateInfo;
|
||||
class UpdaterService {
|
||||
public:
|
||||
enum class UpdateResult {
|
||||
Success,
|
||||
Failed,
|
||||
Cancelled,
|
||||
NetworkError,
|
||||
ExtractionError,
|
||||
PermissionError,
|
||||
InvalidArchive,
|
||||
NoUpdateAvailable
|
||||
};
|
||||
};
|
||||
class UpdaterService;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -58,7 +46,11 @@ private slots:
|
||||
void OnUpdateCheckCompleted(bool has_update, const Updater::UpdateInfo& update_info);
|
||||
void OnUpdateDownloadProgress(int percentage, qint64 bytes_received, qint64 bytes_total);
|
||||
void OnUpdateInstallProgress(int percentage, const QString& current_file);
|
||||
#ifdef _WIN32
|
||||
void OnUpdateCompleted(Updater::UpdaterService::UpdateResult result, const QString& message);
|
||||
#else
|
||||
void OnUpdateCompleted(int result, const QString& message);
|
||||
#endif
|
||||
void OnUpdateError(const QString& error_message);
|
||||
|
||||
void OnDownloadButtonClicked();
|
||||
@@ -80,7 +72,11 @@ private:
|
||||
void UpdateInstallProgress(int percentage, const QString& current_file);
|
||||
|
||||
QString FormatBytes(qint64 bytes) const;
|
||||
#ifdef _WIN32
|
||||
QString GetUpdateMessage(Updater::UpdaterService::UpdateResult result) const;
|
||||
#else
|
||||
QString GetUpdateMessage(int result) const;
|
||||
#endif
|
||||
|
||||
private:
|
||||
#ifdef _WIN32
|
||||
|
||||
Reference in New Issue
Block a user