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