iOS support

This commit is contained in:
Alex Spataru 2014-11-21 23:05:00 -06:00
parent 9ecad33138
commit 0104c18332
4 changed files with 53 additions and 46 deletions

View File

@ -195,7 +195,12 @@ void DownloadDialog::updateProgress (qint64 received, qint64 total) {
}
void DownloadDialog::ignoreSslErrors (QNetworkReply *reply, const QList<QSslError> &error) {
#ifndef Q_OS_IOS
reply->ignoreSslErrors (error);
#else
Q_UNUSED (reply);
Q_UNUSED (error);
#endif
}
float DownloadDialog::roundNumber (const float &input) {

View File

@ -13,13 +13,11 @@
#include <math.h>
namespace Ui
{
namespace Ui {
class DownloadDialog;
}
class DownloadDialog : public QWidget
{
class DownloadDialog : public QWidget {
Q_OBJECT
public:

View File

@ -193,5 +193,10 @@ void QSimpleUpdater::processDownloadedChangelog (QNetworkReply *reply) {
}
void QSimpleUpdater::ignoreSslErrors (QNetworkReply *reply, const QList<QSslError> &error) {
#ifndef Q_OS_IOS
reply->ignoreSslErrors (error);
}
#else
Q_UNUSED (reply);
Q_UNUSED (error);
#endif
}

View File

@ -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: