From 0104c18332bdbe0a2589e0f6d8a235553a4109df Mon Sep 17 00:00:00 2001 From: Alex Spataru Date: Fri, 21 Nov 2014 23:05:00 -0600 Subject: [PATCH] iOS support --- .../src/dialogs/download_dialog.cpp | 5 ++ QSimpleUpdater/src/dialogs/download_dialog.h | 6 +- QSimpleUpdater/src/qsimpleupdater.cpp | 7 +- QSimpleUpdater/src/qsimpleupdater.h | 81 +++++++++---------- 4 files changed, 53 insertions(+), 46 deletions(-) diff --git a/QSimpleUpdater/src/dialogs/download_dialog.cpp b/QSimpleUpdater/src/dialogs/download_dialog.cpp index c6d70ad..9d2508d 100644 --- a/QSimpleUpdater/src/dialogs/download_dialog.cpp +++ b/QSimpleUpdater/src/dialogs/download_dialog.cpp @@ -195,7 +195,12 @@ void DownloadDialog::updateProgress (qint64 received, qint64 total) { } void DownloadDialog::ignoreSslErrors (QNetworkReply *reply, const QList &error) { +#ifndef Q_OS_IOS reply->ignoreSslErrors (error); +#else + Q_UNUSED (reply); + Q_UNUSED (error); +#endif } float DownloadDialog::roundNumber (const float &input) { diff --git a/QSimpleUpdater/src/dialogs/download_dialog.h b/QSimpleUpdater/src/dialogs/download_dialog.h index 4338422..b6d1d83 100644 --- a/QSimpleUpdater/src/dialogs/download_dialog.h +++ b/QSimpleUpdater/src/dialogs/download_dialog.h @@ -13,13 +13,11 @@ #include -namespace Ui -{ +namespace Ui { class DownloadDialog; } -class DownloadDialog : public QWidget -{ +class DownloadDialog : public QWidget { Q_OBJECT public: diff --git a/QSimpleUpdater/src/qsimpleupdater.cpp b/QSimpleUpdater/src/qsimpleupdater.cpp index db14d32..7771b11 100644 --- a/QSimpleUpdater/src/qsimpleupdater.cpp +++ b/QSimpleUpdater/src/qsimpleupdater.cpp @@ -193,5 +193,10 @@ void QSimpleUpdater::processDownloadedChangelog (QNetworkReply *reply) { } void QSimpleUpdater::ignoreSslErrors (QNetworkReply *reply, const QList &error) { +#ifndef Q_OS_IOS reply->ignoreSslErrors (error); -} \ No newline at end of file +#else + Q_UNUSED (reply); + Q_UNUSED (error); +#endif +} diff --git a/QSimpleUpdater/src/qsimpleupdater.h b/QSimpleUpdater/src/qsimpleupdater.h index 7844f31..09d595c 100644 --- a/QSimpleUpdater/src/qsimpleupdater.h +++ b/QSimpleUpdater/src/qsimpleupdater.h @@ -16,62 +16,61 @@ #include "dialogs/download_dialog.h" -class QSimpleUpdater : public QObject -{ +class QSimpleUpdater : public QObject { Q_OBJECT public: QSimpleUpdater (QObject *parent = 0); - /// Returns the downloaded change log + /// Returns the downloaded change log QString changeLog() const; - - /// Returns the downloaded version string - QString latestVersion() const; - - /// Returns the local version, referenced by - /// the setApplicationVersion() function + + /// Returns the downloaded version string + QString latestVersion() const; + + /// Returns the local version, referenced by + /// the setApplicationVersion() function QString installedVersion() const; - - /// Returns \c true if there's a newer version available - bool newerVersionAvailable() const; - - /// Checks for updates and calls the appropriate - /// signals when finished + + /// Returns \c true if there's a newer version available + bool newerVersionAvailable() const; + + /// Checks for updates and calls the appropriate + /// signals when finished void checkForUpdates(); - - /// Opens the download URL in a a web browser. - /// The URL is referenced by the \c setDownloadUrl() function + + /// Opens the download URL in a a web browser. + /// The URL is referenced by the \c setDownloadUrl() function void openDownloadLink(); - - /// Shows a dialog that downloads the file in the - /// URL referenced by the \c setDownloadUrl() function + + /// Shows a dialog that downloads the file in the + /// URL referenced by the \c setDownloadUrl() function void downloadLatestVersion(); public slots: - - /// Changes the URL that we can open in a web browser or - /// download. Its recommended to use fixed URLs if you - /// want to automatically download and install your updates + + /// Changes the URL that we can open in a web browser or + /// download. Its recommended to use fixed URLs if you + /// want to automatically download and install your updates void setDownloadUrl (const QString &url); - - /// Changes the reference URL, which contains ONLY the latest - /// version of your application as a plain text file. - /// Examples include: - /// - 1.2.3 - /// - 5.4.0 - /// - 0.1.2 - /// - etc. + + /// Changes the reference URL, which contains ONLY the latest + /// version of your application as a plain text file. + /// Examples include: + /// - 1.2.3 + /// - 5.4.0 + /// - 0.1.2 + /// - etc. void setReferenceUrl (const QString &url); - - /// Changes the change log URL, which contains the change log - /// of your application. The change log can be any file you - /// like, however, its recommended to write it in plain text, - /// such as TXT, HTML and RTF files. + + /// Changes the change log URL, which contains the change log + /// of your application. The change log can be any file you + /// like, however, its recommended to write it in plain text, + /// such as TXT, HTML and RTF files. void setChangelogUrl (const QString &url); - - /// Tells the updater the version of the installed - /// copy of your application. + + /// Tells the updater the version of the installed + /// copy of your application. void setApplicationVersion (const QString &version); private slots: