From b579bf0cc20ece7602b2ff77b6941140a85a1f65 Mon Sep 17 00:00:00 2001 From: James Date: Tue, 31 Oct 2017 15:41:18 +1100 Subject: [PATCH] Fixed up method docs for updater --- src/citra_qt/updater/updater.cpp | 14 ++--- src/citra_qt/updater/updater.h | 89 +++++++++++++++++++++++++------- src/citra_qt/updater/updater_p.h | 2 +- 3 files changed, 77 insertions(+), 28 deletions(-) diff --git a/src/citra_qt/updater/updater.cpp b/src/citra_qt/updater/updater.cpp index 399300266..b5a448ca3 100644 --- a/src/citra_qt/updater/updater.cpp +++ b/src/citra_qt/updater/updater.cpp @@ -152,15 +152,15 @@ void UpdaterPrivate::StopUpdateCheck(int delay, bool async) { if (delay > 0) { main_process->terminate(); if (async) { - QTimer *timer = new QTimer(this); - timer->setSingleShot(true); + QTimer* timer = new QTimer(this); + timer->setSingleShot(true); - connect(timer, &QTimer::timeout, [=]() { - StopUpdateCheck(0, false); - timer->deleteLater(); - }); + connect(timer, &QTimer::timeout, [=]() { + StopUpdateCheck(0, false); + timer->deleteLater(); + }); - timer->start(delay); + timer->start(delay); } else { if (!main_process->waitForFinished(delay)) { main_process->kill(); diff --git a/src/citra_qt/updater/updater.h b/src/citra_qt/updater/updater.h index a7220dd91..e54590534 100644 --- a/src/citra_qt/updater/updater.h +++ b/src/citra_qt/updater/updater.h @@ -61,58 +61,107 @@ public: /// The update download size (in Bytes) quint64 size = 0; - /// Default Constructor + /** + * Default Constructor + */ UpdateInfo(); - /// Copy Constructor + + /** + * Copy Constructor + */ UpdateInfo(const UpdateInfo& other); - /// Constructor that takes name, version and size + + /** + * Constructor that takes name, version and size. + */ UpdateInfo(QString name, QString version, quint64 size); }; - /// Default constructor + /** + * Default constructor + **/ explicit Updater(QObject* parent = nullptr); - /// Constructor with an explicitly set path + + /** + * Constructor with an explicitly set path + **/ explicit Updater(const QString& maintenance_tool_path, QObject* parent = nullptr); - /// Destroys the updater and kills the update check (if running) + + /** + * Destroys the updater and kills the update check (if running) + **/ ~Updater(); - /// Returns `true`, if the updater exited normally + /** + * Returns `true`, if the updater exited normally + **/ bool ExitedNormally() const; - /// Returns the mainetancetools error code of the last update + + /** + * Returns the mainetancetools error code from the last update check, if any. + **/ int ErrorCode() const; - /// returns the error output (stderr) of the last update + + /** + * Returns the error output (stderr) of the last update + **/ QByteArray ErrorLog() const; - /// readAcFn{Updater::running} + /** + * Returns if a update check is running. + **/ bool IsRunning() const; - /// readAcFn{Updater::updateInfo} + + /** + * Returns the latest update information available, if any. + **/ QList LatestUpdateInfo() const; - /// Launches the updater UI formally + /** + * Launches the updater UI formally + **/ void LaunchUI(); - /// Silently updates the application in the background + /** + * Silently updates the application in the background + **/ void SilentlyUpdate(); - /// Checks to see if a updater application is available + /** + * Checks to see if a updater application is available + **/ bool HasUpdater() const; - /// Instead of silently updating, explictly open the UI on shutdown + /** + * Instead of silently updating, explictly open the UI on shutdown + **/ void LaunchUIOnExit(); public slots: - /// Starts checking for updates + /** + * Starts checking for updates + **/ bool CheckForUpdates(); - /// Aborts checking for updates + + /** + * Aborts checking for updates + **/ void AbortUpdateCheck(int max_delay = 5000, bool async = false); signals: - /// Will be emitted as soon as the updater finished checking for updates + /** + * Will be emitted as soon as the updater finished checking for updates + **/ void CheckUpdatesDone(bool has_updates, bool has_error); - /// notifyAcFn{Updater::running} + /** + * Emitted when a update check operation changes stage + **/ void RunningChanged(bool running); - /// notifyAcFn{Updater::updateInfo} + + /** + * Emitted when new update information has been found + **/ void UpdateInfoChanged(QList update_info); private: diff --git a/src/citra_qt/updater/updater_p.h b/src/citra_qt/updater/updater_p.h index 210400535..175a95623 100644 --- a/src/citra_qt/updater/updater_p.h +++ b/src/citra_qt/updater/updater_p.h @@ -29,6 +29,7 @@ public: bool HasUpdater() const; bool StartUpdateCheck(); + void StopUpdateCheck(int delay, bool async); void LaunchWithArguments(const QStringList& args); void LaunchUI(); @@ -37,7 +38,6 @@ public: void LaunchUIOnExit(); public slots: - void StopUpdateCheck(int delay, bool async); void UpdaterReady(int exit_code, QProcess::ExitStatus exit_status); void UpdaterError(QProcess::ProcessError error);