QSimpleUpdater.h
/*
* Copyright (c) 2014-2016 Alex Spataru <alex_spataru@outlook.com>
*
* This file is part of the QSimpleUpdater library, which is released under
* the DBAD license, you can read a copy of it below:
*
* DON'T BE A DICK PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING,
* DISTRIBUTION AND MODIFICATION:
*
* Do whatever you like with the original work, just don't be a dick.
* Being a dick includes - but is not limited to - the following instances:
*
* 1a. Outright copyright infringement - Don't just copy this and change the
* name.
* 1b. Selling the unmodified original with no work done what-so-ever, that's
* REALLY being a dick.
* 1c. Modifying the original work to contain hidden harmful content.
* That would make you a PROPER dick.
*
* If you become rich through modifications, related works/services, or
* supporting the original work, share the love.
* Only a dick would make loads off this work and not buy the original works
* creator(s) a pint.
*
* Code is provided with no warranty. Using somebody else's code and bitching
* when it goes wrong makes you a DONKEY dick.
* Fix the problem yourself. A non-dick would submit the fix back.
*/
#ifndef _QSIMPLEUPDATER_MAIN_H
#define _QSIMPLEUPDATER_MAIN_H
#include <QUrl>
#include <QList>
#include <QObject>
#if defined (QSU_SHARED)
#define QSU_DECL Q_DECL_EXPORT
#elif defined (QSU_IMPORT)
#define QSU_DECL Q_DECL_IMPORT
#else
#define QSU_DECL
#endif
class Updater;
class QSU_DECL QSimpleUpdater : public QObject {
Q_OBJECT
signals:
void checkingFinished (const QString& url);
void downloadFinished (const QString& url, const QString& filepath);
public:
static QSimpleUpdater* getInstance();
bool getNotifyOnUpdate (const QString& url) const;
bool getNotifyOnFinish (const QString& url) const;
bool getUpdateAvailable (const QString& url) const;
bool getDownloaderEnabled (const QString& url) const;
bool usesCustomInstallProcedures (const QString& url) const;
QString getChangelog (const QString& url) const;
QString getModuleName (const QString& url) const;
QString getDownloadUrl (const QString& url) const;
QString getPlatformKey (const QString& url) const;
QString getLatestVersion (const QString& url) const;
QString getModuleVersion (const QString& url) const;
public slots:
void checkForUpdates (const QString& url);
void setModuleName (const QString& url, const QString& name);
void setNotifyOnUpdate (const QString& url, const bool& notify);
void setNotifyOnFinish (const QString& url, const bool& notify);
void setPlatformKey (const QString& url, const QString& platform);
void setModuleVersion (const QString& url, const QString& version);
void setDownloaderEnabled (const QString& url, const bool& enabled);
void setUseCustomInstallProcedures (const QString& url, const bool& custom);
protected:
~QSimpleUpdater();
private:
Updater* getUpdater (const QString& url) const;
};
#endif
Updater
Downloads and interprests the update definition file.
Definition: Updater.h:45
QSimpleUpdater
Manages the updater instances.
Definition: QSimpleUpdater.h:66