Minor code changes

This commit is contained in:
Alex Spataru 2014-12-22 02:26:51 -06:00
parent df6feef57f
commit 6d84e02980
4 changed files with 25 additions and 25 deletions

View File

@ -26,7 +26,7 @@ DownloadDialog::DownloadDialog (QWidget *parent)
SLOT (ignoreSslErrors (QNetworkReply *, QList<QSslError>))); SLOT (ignoreSslErrors (QNetworkReply *, QList<QSslError>)));
} }
DownloadDialog::~DownloadDialog() { DownloadDialog::~DownloadDialog(void) {
delete ui; delete ui;
} }
@ -54,7 +54,7 @@ void DownloadDialog::beginDownload (const QUrl& url) {
showNormal(); showNormal();
} }
void DownloadDialog::openDownload() { void DownloadDialog::openDownload(void) {
if (!m_path.isEmpty()) { if (!m_path.isEmpty()) {
QString url = m_path; QString url = m_path;
@ -71,7 +71,7 @@ void DownloadDialog::openDownload() {
qWarning() << "QSimpleUpdater: cannot open downloaded file!"; qWarning() << "QSimpleUpdater: cannot open downloaded file!";
} }
void DownloadDialog::cancelDownload() { void DownloadDialog::cancelDownload(void) {
if (!m_reply->isFinished()) { if (!m_reply->isFinished()) {
QMessageBox _message; QMessageBox _message;
_message.setWindowTitle (tr ("Updater")); _message.setWindowTitle (tr ("Updater"));
@ -89,7 +89,7 @@ void DownloadDialog::cancelDownload() {
hide(); hide();
} }
void DownloadDialog::downloadFinished() { void DownloadDialog::downloadFinished(void) {
ui->stopButton->setText (tr ("Close")); ui->stopButton->setText (tr ("Close"));
ui->downloadLabel->setText (tr ("Download complete!")); ui->downloadLabel->setText (tr ("Download complete!"));
ui->timeLabel->setText (tr ("The installer will open in a separate window...")); ui->timeLabel->setText (tr ("The installer will open in a separate window..."));

View File

@ -22,14 +22,14 @@ class DownloadDialog : public QWidget {
public: public:
explicit DownloadDialog (QWidget *parent = 0); explicit DownloadDialog (QWidget *parent = 0);
~DownloadDialog(); ~DownloadDialog(void);
void beginDownload (const QUrl& url); void beginDownload (const QUrl& url);
private slots: private slots:
void openDownload(); void openDownload(void);
void cancelDownload(); void cancelDownload(void);
void downloadFinished(); void downloadFinished(void);
void updateProgress (qint64 received, qint64 total); void updateProgress (qint64 received, qint64 total);
void ignoreSslErrors (QNetworkReply *reply, const QList<QSslError>& error); void ignoreSslErrors (QNetworkReply *reply, const QList<QSslError>& error);

View File

@ -16,7 +16,7 @@ QSimpleUpdater::QSimpleUpdater (QObject *parent)
m_downloadDialog = new DownloadDialog(); m_downloadDialog = new DownloadDialog();
} }
QString QSimpleUpdater::changeLog() const { QString QSimpleUpdater::changeLog(void) const {
if (m_changelog.isEmpty()) { if (m_changelog.isEmpty()) {
qDebug() << "QSimpleUpdater: change log is empty," qDebug() << "QSimpleUpdater: change log is empty,"
<< "did you call setChangelogUrl() and checkForUpdates()?"; << "did you call setChangelogUrl() and checkForUpdates()?";
@ -25,7 +25,7 @@ QString QSimpleUpdater::changeLog() const {
return m_changelog; return m_changelog;
} }
void QSimpleUpdater::checkForUpdates() { void QSimpleUpdater::checkForUpdates(void) {
if (!m_reference_url.isEmpty()) { if (!m_reference_url.isEmpty()) {
QNetworkAccessManager *_manager = new QNetworkAccessManager (this); QNetworkAccessManager *_manager = new QNetworkAccessManager (this);
@ -42,7 +42,7 @@ void QSimpleUpdater::checkForUpdates() {
qDebug() << "QSimpleUpdater: Invalid reference URL"; qDebug() << "QSimpleUpdater: Invalid reference URL";
} }
void QSimpleUpdater::openDownloadLink() { void QSimpleUpdater::openDownloadLink(void) {
if (!m_download_url.isEmpty()) if (!m_download_url.isEmpty())
QDesktopServices::openUrl (m_download_url); QDesktopServices::openUrl (m_download_url);
@ -52,7 +52,7 @@ void QSimpleUpdater::openDownloadLink() {
} }
} }
QString QSimpleUpdater::latestVersion() const { QString QSimpleUpdater::latestVersion(void) const {
if (m_latest_version.isEmpty()) { if (m_latest_version.isEmpty()) {
qDebug() << "QSimpleUpdater: latest version is empty," qDebug() << "QSimpleUpdater: latest version is empty,"
<< "did you call checkForUpdates() and setReferenceUrl()?"; << "did you call checkForUpdates() and setReferenceUrl()?";
@ -61,7 +61,7 @@ QString QSimpleUpdater::latestVersion() const {
return m_latest_version; return m_latest_version;
} }
QString QSimpleUpdater::installedVersion() const { QString QSimpleUpdater::installedVersion(void) const {
if (m_installed_version.isEmpty()) { if (m_installed_version.isEmpty()) {
qDebug() << "QSimpleUpdater: installed version is empty," qDebug() << "QSimpleUpdater: installed version is empty,"
<< "did you call setApplicationVersion()?"; << "did you call setApplicationVersion()?";
@ -70,7 +70,7 @@ QString QSimpleUpdater::installedVersion() const {
return m_installed_version; return m_installed_version;
} }
void QSimpleUpdater::downloadLatestVersion() { void QSimpleUpdater::downloadLatestVersion(void) {
if (!m_download_url.isEmpty()) if (!m_download_url.isEmpty())
m_downloadDialog->beginDownload (m_download_url); m_downloadDialog->beginDownload (m_download_url);
@ -80,7 +80,7 @@ void QSimpleUpdater::downloadLatestVersion() {
} }
} }
bool QSimpleUpdater::newerVersionAvailable() const { bool QSimpleUpdater::newerVersionAvailable(void) const {
return m_new_version_available; return m_new_version_available;
} }

View File

@ -23,29 +23,29 @@ public:
QSimpleUpdater (QObject *parent = 0); QSimpleUpdater (QObject *parent = 0);
/// Returns the downloaded change log /// Returns the downloaded change log
QString changeLog() const; QString changeLog(void) const;
/// Returns the downloaded version string /// Returns the downloaded version string
QString latestVersion() const; QString latestVersion(void) const;
/// Returns the local version, referenced by /// Returns the local version, referenced by
/// the setApplicationVersion() function /// the setApplicationVersion() function
QString installedVersion() const; QString installedVersion(void) const;
/// Returns \c true if there's a newer version available /// Returns \c true if there's a newer version available
bool newerVersionAvailable() const; bool newerVersionAvailable(void) const;
/// Checks for updates and calls the appropriate /// Checks for updates and calls the appropriate
/// signals when finished /// signals when finished
void checkForUpdates(); void checkForUpdates(void);
/// Opens the download URL in a a web browser. /// Opens the download URL in a a web browser.
/// The URL is referenced by the \c setDownloadUrl() function /// The URL is referenced by the \c setDownloadUrl() function
void openDownloadLink(); void openDownloadLink(void);
/// Shows a dialog that downloads the file in the /// Shows a dialog that downloads the file in the
/// URL referenced by the \c setDownloadUrl() function /// URL referenced by the \c setDownloadUrl() function
void downloadLatestVersion(); void downloadLatestVersion(void);
public slots: public slots:
@ -79,9 +79,9 @@ private slots:
void ignoreSslErrors (QNetworkReply *reply, const QList<QSslError>& error); void ignoreSslErrors (QNetworkReply *reply, const QList<QSslError>& error);
signals: signals:
void checkingFinished(); void checkingFinished(void);
void versionCheckFinished(); void versionCheckFinished(void);
void changelogDownloadFinished(); void changelogDownloadFinished(void);
private: private:
QString m_changelog; QString m_changelog;