From 5e5c9c07291f6b09623d31c92b1fb61c4ede576e Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Thu, 22 Feb 2018 16:54:34 +0100 Subject: Applied clang-format on source --- src/selfupdater.h | 142 ++++++++++++++++++++++++++---------------------------- 1 file changed, 68 insertions(+), 74 deletions(-) (limited to 'src/selfupdater.h') diff --git a/src/selfupdater.h b/src/selfupdater.h index 4743f6a4..12b473bd 100644 --- a/src/selfupdater.h +++ b/src/selfupdater.h @@ -20,13 +20,14 @@ along with Mod Organizer. If not, see . #ifndef SELFUPDATER_H #define SELFUPDATER_H - -#include #include +#include class Archive; class NexusInterface; -namespace MOBase { class IPluginGame; } +namespace MOBase { +class IPluginGame; +} #include #include @@ -37,7 +38,6 @@ namespace MOBase { class IPluginGame; } class QNetworkReply; class QProgressDialog; - /** * @brief manages updates for Mod Organizer itself * This class is used to update the Mod Organizer @@ -57,94 +57,88 @@ class QProgressDialog; * * @todo use NexusBridge **/ -class SelfUpdater : public QObject -{ +class SelfUpdater : public QObject { - Q_OBJECT + Q_OBJECT public: - - /** - * @brief constructor - * - * @param nexusInterface interface to query information from nexus - * @param parent parent widget - * @todo passing the nexus interface is unneccessary - **/ - explicit SelfUpdater(NexusInterface *nexusInterface); - - virtual ~SelfUpdater(); - - void setUserInterface(QWidget *widget); - - /** - * @brief start the update process - * @note this should not be called if there is no update available - **/ - void startUpdate(); - - /** - * @return current version of Mod Organizer - **/ - MOBase::VersionInfo getVersion() const { return m_MOVersion; } + /** + * @brief constructor + * + * @param nexusInterface interface to query information from nexus + * @param parent parent widget + * @todo passing the nexus interface is unneccessary + **/ + explicit SelfUpdater(NexusInterface* nexusInterface); + + virtual ~SelfUpdater(); + + void setUserInterface(QWidget* widget); + + /** + * @brief start the update process + * @note this should not be called if there is no update available + **/ + void startUpdate(); + + /** + * @return current version of Mod Organizer + **/ + MOBase::VersionInfo getVersion() const { return m_MOVersion; } public slots: - /** - * @brief request information about the current version - **/ - void testForUpdate(); + /** + * @brief request information about the current version + **/ + void testForUpdate(); signals: - /** - * @brief emitted if a restart of the client is necessary to complete the update - **/ - void restart(); + /** + * @brief emitted if a restart of the client is necessary to complete the update + **/ + void restart(); - /** - * @brief emitted if an update is available - **/ - void updateAvailable(); + /** + * @brief emitted if an update is available + **/ + void updateAvailable(); - /** - * @brief emitted if a message of the day was received - **/ - void motdAvailable(const QString &motd); + /** + * @brief emitted if a message of the day was received + **/ + void motdAvailable(const QString& motd); private: - - void openOutputFile(const QString &fileName); - void download(const QString &downloadLink); - void installUpdate(); - void report7ZipError(const QString &errorMessage); - void showProgress(); - void closeProgress(); + void openOutputFile(const QString& fileName); + void download(const QString& downloadLink); + void installUpdate(); + void report7ZipError(const QString& errorMessage); + void showProgress(); + void closeProgress(); private slots: - void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); - void downloadReadyRead(); - void downloadFinished(); - void downloadCancel(); + void downloadProgress(qint64 bytesReceived, qint64 bytesTotal); + void downloadReadyRead(); + void downloadFinished(); + void downloadCancel(); private: - - QWidget *m_Parent; - MOBase::VersionInfo m_MOVersion; - NexusInterface *m_Interface; - QFile m_UpdateFile; - QNetworkReply *m_Reply; - QProgressDialog *m_Progress { nullptr }; - bool m_Canceled; - int m_Attempts; - - Archive *m_ArchiveHandler; - - GitHub m_GitHub; - QJsonObject m_UpdateCandidate; - + QWidget* m_Parent; + MOBase::VersionInfo m_MOVersion; + NexusInterface* m_Interface; + QFile m_UpdateFile; + QNetworkReply* m_Reply; + QProgressDialog* m_Progress{nullptr}; + bool m_Canceled; + int m_Attempts; + + Archive* m_ArchiveHandler; + + GitHub m_GitHub; + QJsonObject m_UpdateCandidate; }; - #endif // SELFUPDATER_H -- cgit v1.3.1