presentation/AboutInfo.h
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #pragma once | ||
| 2 | |||
| 3 | #include <QObject> | ||
| 4 | #include <QString> | ||
| 5 | #include <QUrl> | ||
| 6 | |||
| 7 | // What the About tab and `mailjd --version` show: version, source commit, | ||
| 8 | // Qt versions, license and project links. The license is GPL-3.0-only | ||
| 9 | // (LICENSE); the notices text is THIRD-PARTY-NOTICES.md, compiled into the | ||
| 10 | // resources under :/about/. | ||
| 11 | class AboutInfo final : public QObject { | ||
| 12 | Q_OBJECT | ||
| 13 | Q_PROPERTY(QString version READ version CONSTANT) | ||
| 14 | Q_PROPERTY(QString commit READ commit CONSTANT) | ||
| 15 | Q_PROPERTY(QString qtVersion READ qtVersion CONSTANT) | ||
| 16 | Q_PROPERTY(QString license READ license CONSTANT) | ||
| 17 | Q_PROPERTY(QUrl websiteUrl READ websiteUrl CONSTANT) | ||
| 18 | Q_PROPERTY(QUrl sourceUrl READ sourceUrl CONSTANT) | ||
| 19 | Q_PROPERTY(QUrl issuesUrl READ issuesUrl CONSTANT) | ||
| 20 | public: | ||
| 21 | 861 | explicit AboutInfo(QObject *parent = nullptr) : QObject(parent) {} | |
| 22 | |||
| 23 | static QString version(); | ||
| 24 | // Short commit id, or an empty string for builds without git metadata. | ||
| 25 | static QString commit(); | ||
| 26 | // Runtime Qt version, followed by the build version when they differ. | ||
| 27 | static QString qtVersion(); | ||
| 28 | 4 | static QString license() { return QStringLiteral("GPL-3.0-only"); } | |
| 29 | static QUrl websiteUrl(); | ||
| 30 | static QUrl sourceUrl(); | ||
| 31 | static QUrl issuesUrl(); | ||
| 32 | |||
| 33 | // Multi-line text printed by `mailjd --version`. | ||
| 34 | static QString versionReport(); | ||
| 35 | // THIRD-PARTY-NOTICES.md as Markdown; an explicit message when the | ||
| 36 | // resource is missing (never an empty page). | ||
| 37 | Q_INVOKABLE static QString thirdPartyNotices(); | ||
| 38 | }; | ||
| 39 |