From ea6292168a6acd4c263913f0ccd7dd64daf4f5cf Mon Sep 17 00:00:00 2001 From: Sandro Jäckel Date: Fri, 23 Feb 2018 01:45:58 +0100 Subject: Revert "Applied clang-format on source" This reverts commit 5e5c9c07291f6b09623d31c92b1fb61c4ede576e. --- src/selfupdater.h | 142 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 74 insertions(+), 68 deletions(-) (limited to 'src/selfupdater.h') diff --git a/src/selfupdater.h b/src/selfupdater.h index 12b473bd..4743f6a4 100644 --- a/src/selfupdater.h +++ b/src/selfupdater.h @@ -20,14 +20,13 @@ 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 @@ -38,6 +37,7 @@ class IPluginGame; class QNetworkReply; class QProgressDialog; + /** * @brief manages updates for Mod Organizer itself * This class is used to update the Mod Organizer @@ -57,88 +57,94 @@ 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