Add git revision in about components and debug info

This adds a new "Kdenlive" component in the About Dialog showing the git revision and package type.
It also makes it available in the debug info.

![image](/uploads/899eecb53f86a8e9284fa430dff10224/image.png){width=540 height=528}
This commit is contained in:
Jean-Baptiste Mardelle
2025-10-04 12:33:53 +02:00
parent c0ad186e46
commit 82ddf32211
4 changed files with 10 additions and 18 deletions

View File

@@ -201,7 +201,7 @@ endif()
# Get current version.
set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION}")
if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
if(EXISTS ${CMAKE_SOURCE_DIR}/.git)
# Probably a Git workspace; determine the revision.
find_package(Git QUIET)
if(GIT_FOUND)
@@ -209,7 +209,7 @@ if(NOT RELEASE_BUILD AND EXISTS ${CMAKE_SOURCE_DIR}/.git)
ARGS "log -n 1 --pretty=format:\"%h\""
OUTPUT_VARIABLE KDENLIVE_GIT_REVISION)
message(STATUS "Kdenlive Git revision: ${KDENLIVE_GIT_REVISION}")
set(KDENLIVE_VERSION_STRING "${KDENLIVE_VERSION} (rev. ${KDENLIVE_GIT_REVISION})")
set(KDENLIVE_FULL_VERSION_STRING "${KDENLIVE_VERSION} - rev. ${KDENLIVE_GIT_REVISION}")
else()
message(STATUS "Kdenlive Git revision could not be determined")
endif()

View File

@@ -2,6 +2,7 @@
#define CONFIG_H
#define KDENLIVE_VERSION "@KDENLIVE_VERSION_STRING@"
#define KDENLIVE_FULL_VERSION_STRING "@KDENLIVE_FULL_VERSION_STRING@"
#define MLT_PREFIX "@MLT_PREFIX@"
#define MLT_MIN_MAJOR_VERSION @MLT_MIN_MAJOR_VERSION@

View File

@@ -279,20 +279,6 @@ int main(int argc, char *argv[])
QString otherText = i18n("Please report bugs to <a href=\"%1\">%2</a>", QStringLiteral("https://bugs.kde.org/enter_bug.cgi?product=kdenlive"),
QStringLiteral("https://bugs.kde.org/"));
switch (packageType) {
case LinuxPackageType::AppImage:
otherText.prepend(i18n("You are using the AppImage.<br>"));
break;
case LinuxPackageType::Flatpak:
otherText.prepend(i18n("You are using the Flatpak.<br>"));
break;
case LinuxPackageType::Snap:
otherText.prepend(i18n("You are using the Snap package.<br>"));
break;
default:
break;
}
KAboutData aboutData(QByteArray("kdenlive"), i18n("Kdenlive"), KDENLIVE_VERSION, i18n("An open source video editor."), KAboutLicense::GPL_V3,
i18n("Copyright © 20072025 Kdenlive authors"), otherText, QStringLiteral("https://kdenlive.org"));
// main developers (alphabetical)
@@ -317,6 +303,8 @@ int main(int argc, char *argv[])
aboutData.setTranslator(i18n("NAME OF TRANSLATORS"), i18n("EMAIL OF TRANSLATORS"));
aboutData.setOrganizationDomain(QByteArray("kde.org"));
aboutData.addComponent(aboutData.displayName(), QString(), KDENLIVE_FULL_VERSION_STRING, aboutData.homepage());
aboutData.addComponent(i18n("MLT"), i18n("Open source multimedia framework."), mlt_version_get_string(),
QStringLiteral("https://mltframework.org") /*, KAboutLicense::LGPL_V2_1*/);
aboutData.addComponent(i18n("FFmpeg"), i18n("A complete, cross-platform solution to record, convert and stream audio and video."), QString(),

View File

@@ -5037,7 +5037,7 @@ void MainWindow::slotCopyDebugInfo()
{
// General note for this function: since the information targets developers, we don't want it to be translated
QString debuginfo = QStringLiteral("Kdenlive: %1\n").arg(KAboutData::applicationData().version());
QString debuginfo;
QString packageType;
switch (pCore->packageType()) {
case LinuxPackageType::AppImage:
@@ -5053,8 +5053,11 @@ void MainWindow::slotCopyDebugInfo()
packageType = QStringLiteral("Unknown/Default");
break;
}
QList<KAboutComponent> components = KAboutData::applicationData().components();
for (auto &c : components) {
debuginfo.append(QStringLiteral("%1: %2\n").arg(c.name(), c.version()));
}
debuginfo.append(QStringLiteral("Package Type: %1\n").arg(packageType));
debuginfo.append(QStringLiteral("MLT: %1\n").arg(mlt_version_get_string()));
debuginfo.append(QStringLiteral("Qt: %1 (built against %2 %3)\n").arg(QString::fromLocal8Bit(qVersion()), QT_VERSION_STR, QSysInfo::buildAbi()));
debuginfo.append(QStringLiteral("Frameworks: %2\n").arg(KCoreAddons::versionString()));
debuginfo.append(QStringLiteral("System: %1\n").arg(QSysInfo::prettyProductName()));