diff options
| author | 2015-01-30 17:00:24 -0500 | |
|---|---|---|
| committer | 2015-01-30 17:00:24 -0500 | |
| commit | e4767514ed04e6a0bddf3f4a47f5f0b09e65e0ee (patch) | |
| tree | 86cadc2137831d44fa29fd40a2964f7fb1326de4 /SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h | |
| parent | 26ddfe11c2b7fac52e5f57dcd9f5223a50b2a9a7 (diff) | |
| parent | 016003905ca0e8e459e3dc33e786beda8ec92f45 (diff) | |
Merge tag 'upstream/3.0.2'
Upstream version 3.0.2
# gpg: Signature made Fri 30 Jan 2015 05:00:11 PM EST using RSA key ID EBE9BD91
# gpg: Good signature from "Unit 193 <unit193@gmail.com>"
# gpg: aka "Unit 193 <unit193@ninthfloor.org>"
# gpg: aka "Unit 193 <unit193@ubuntu.com>"
Diffstat (limited to 'SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h')
| -rw-r--r-- | SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h b/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h index fcf1203..c8da6f9 100644 --- a/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h +++ b/SQLiteStudio3/coreSQLiteStudio/services/extralicensemanager.h @@ -8,14 +8,38 @@ class API_EXPORT ExtraLicenseManager { public: + enum class Type + { + FILE, + CONTENTS + }; + + struct License + { + QString title; + QString data; + Type type; + QString violationMessage; + bool violated = false; + }; + ExtraLicenseManager(); + virtual ~ExtraLicenseManager(); bool addLicense(const QString& title, const QString& filePath); + bool addLicenseContents(const QString& title, const QString& contents); + void setViolatedLicense(const QString& title, const QString& violationMessage); + void unsetViolatedLicense(const QString& title); + bool isViolatedLicense(const QString& title); + QString getViolationMessage(const QString& title); bool removeLicense(const QString& title); - const QHash<QString,QString>& getLicenses() const; + QHash<QString,QString> getLicensesContents() const; private: - QHash<QString,QString> licenses; + bool addLicense(const QString& title, const QString& data, Type type); + QString readLicenseFile(const QString& path) const; + + QHash<QString,License*> licenses; }; #endif // EXTRALISENCEMANAGER_H |
