presentation/AboutInfo.cpp
| Line | Branch | Exec | Source |
|---|---|---|---|
| 1 | #include "presentation/AboutInfo.h" | ||
| 2 | |||
| 3 | #include "build_info.h" | ||
| 4 | #include "version.h" | ||
| 5 | |||
| 6 | #include <QFile> | ||
| 7 | #include <QtGlobal> | ||
| 8 | |||
| 9 | 36 | QString AboutInfo::version() { return QStringLiteral(MAILJD_VERSION_FULL); } | |
| 10 | |||
| 11 | 64 | QString AboutInfo::commit() { return QStringLiteral(MAILJD_SOURCE_COMMIT); } | |
| 12 | |||
| 13 | 16 | QString AboutInfo::qtVersion() { | |
| 14 |
1/1✓ Branch 3 → 4 taken 16 times.
|
16 | const QString runtime = QString::fromLatin1(qVersion()); |
| 15 | 16 | const QString build = QStringLiteral(QT_VERSION_STR); | |
| 16 |
3/11✓ Branch 9 → 10 taken 16 times.
✗ Branch 9 → 11 not taken.
✗ Branch 14 → 15 not taken.
✗ Branch 16 → 17 not taken.
✓ Branch 16 → 18 taken 16 times.
✗ Branch 18 → 19 not taken.
✓ Branch 18 → 20 taken 16 times.
✗ Branch 26 → 27 not taken.
✗ Branch 26 → 28 not taken.
✗ Branch 30 → 31 not taken.
✗ Branch 30 → 32 not taken.
|
32 | return runtime == build ? runtime : QStringLiteral("%1 (built with %2)").arg(runtime, build); |
| 17 | 16 | } | |
| 18 | |||
| 19 | ✗ | QUrl AboutInfo::websiteUrl() { return QUrl(QStringLiteral("https://mailjd.jdsoft.de/")); } | |
| 20 | |||
| 21 | ✗ | QUrl AboutInfo::sourceUrl() { return QUrl(QStringLiteral("https://git.jdsoft.de/jens/qmailjd")); } | |
| 22 | |||
| 23 | ✗ | QUrl AboutInfo::issuesUrl() { return QUrl(QStringLiteral("https://git.jdsoft.de/jens/qmailjd/-/issues")); } | |
| 24 | |||
| 25 | 2 | QString AboutInfo::versionReport() { | |
| 26 |
2/2✓ Branch 6 → 7 taken 2 times.
✓ Branch 7 → 8 taken 2 times.
|
4 | QString report = QStringLiteral("MailJD %1\n").arg(version()); |
| 27 |
2/3✓ Branch 11 → 12 taken 2 times.
✓ Branch 14 → 15 taken 2 times.
✗ Branch 14 → 27 not taken.
|
2 | if (!commit().isEmpty()) |
| 28 |
3/3✓ Branch 19 → 20 taken 2 times.
✓ Branch 20 → 21 taken 2 times.
✓ Branch 21 → 22 taken 2 times.
|
4 | report += QStringLiteral("Commit: %1\n").arg(commit()); |
| 29 |
3/3✓ Branch 31 → 32 taken 2 times.
✓ Branch 32 → 33 taken 2 times.
✓ Branch 33 → 34 taken 2 times.
|
4 | report += QStringLiteral("Qt: %1\n").arg(qtVersion()); |
| 30 |
3/3✓ Branch 42 → 43 taken 2 times.
✓ Branch 43 → 44 taken 2 times.
✓ Branch 44 → 45 taken 2 times.
|
4 | report += QStringLiteral("License: %1\n").arg(license()); |
| 31 | 2 | return report; | |
| 32 | ✗ | } | |
| 33 | |||
| 34 | 2 | QString AboutInfo::thirdPartyNotices() { | |
| 35 |
1/1✓ Branch 5 → 6 taken 2 times.
|
2 | QFile file(QStringLiteral(":/about/THIRD-PARTY-NOTICES.md")); |
| 36 |
2/3✓ Branch 9 → 10 taken 2 times.
✗ Branch 10 → 11 not taken.
✓ Branch 10 → 32 taken 2 times.
|
2 | if (!file.open(QIODevice::ReadOnly | QIODevice::Text)) |
| 37 | ✗ | return QStringLiteral("The third-party notices are missing from this build. " | |
| 38 | "They are published at %1.") | ||
| 39 | ✗ | .arg(sourceUrl().toString() + QStringLiteral("/-/blob/main/THIRD-PARTY-NOTICES.md")); | |
| 40 |
2/2✓ Branch 32 → 33 taken 2 times.
✓ Branch 33 → 34 taken 2 times.
|
2 | return QString::fromUtf8(file.readAll()); |
| 41 | 2 | } | |
| 42 |