[utilities/basket] /: Rely on basket_version.h for the project version
Pino Toscano <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 376f4363e0a20cd6677ff9c3d4d1766c87653f0c by Pino Toscano.
Committed on 07/08/2026 at 10:59.
Pushed by pino into branch 'master'.
Rely on basket_version.h for the project version
Thanks to ecm_setup_version(), there is a generated basket_version.h
with the application version. Hence switch to it in all the places that
need the version string, dropping the manual define in config.h.
The data is the same, so there is no behaviour change.
M +0 -4 config.h.cmake
M +2 -2 devtools/weaver/main.cpp
M +2 -2 src/aboutdata.cpp
M +4 -2 src/htmlexporter.cpp
https://invent.kde.org/utilities/basket/-/commit/376f4363e0a20cd6677ff9c3d4d1766c87653f0c
diff --git a/config.h.cmake b/config.h.cmake
index 1679bc74..06b098e9 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -3,7 +3,3 @@
/* Define if libgit2 is available */
#cmakedefine01 HAVE_LIBGIT2
-
-/* Version number of package */
-#define VERSION "@PROJECT_VERSION@"
-
diff --git a/devtools/weaver/main.cpp b/devtools/weaver/main.cpp
index 6ebd401e..9af2193c 100644
--- a/devtools/weaver/main.cpp
+++ b/devtools/weaver/main.cpp
@@ -6,7 +6,7 @@
#include "weaver.h"
-#include <config.h>
+#include <basket_version.h>
#include <KAboutData>
#include <KLocalizedString>
@@ -15,7 +15,7 @@ int main(int argc, char **argv)
{
QCoreApplication app(argc, argv);
- KAboutData aboutData(QStringLiteral("basketweaver"), i18n("basketweaver"), QStringLiteral(VERSION));
+ KAboutData aboutData(QStringLiteral("basketweaver"), i18n("basketweaver"), QStringLiteral(BASKET_VERSION_STRING));
aboutData.setShortDescription(i18n("Encodes and decodes .baskets files"));
KAboutData::setApplicationData(aboutData);
diff --git a/src/aboutdata.cpp b/src/aboutdata.cpp
index 76330db6..7aa11a15 100644
--- a/src/aboutdata.cpp
+++ b/src/aboutdata.cpp
@@ -4,7 +4,7 @@
*/
#include "aboutdata.h"
-#include <config.h>
+#include <basket_version.h>
#include <KLocalizedString>
#include <QApplication>
@@ -12,7 +12,7 @@
AboutData::AboutData()
: KAboutData(AboutData::componentName(),
AboutData::displayName(),
- QStringLiteral(VERSION),
+ QStringLiteral(BASKET_VERSION_STRING),
i18n("<p><b>Taking care of your ideas.</b></p>"
"<p>A note-taking application that makes it easy to record ideas as you think, and quickly find them later. "
"Organizing your notes has never been so easy.</p>"),
diff --git a/src/htmlexporter.cpp b/src/htmlexporter.cpp
index f5a6ad4b..9c857d4b 100644
--- a/src/htmlexporter.cpp
+++ b/src/htmlexporter.cpp
@@ -38,6 +38,8 @@
#include <QProgressDialog>
#include <QTextStream>
+#include <basket_version.h>
+
HTMLExporter::HTMLExporter(BasketScene *basket)
: dialog(new QProgressDialog())
{
@@ -250,7 +252,7 @@ void HTMLExporter::exportBasket(BasketScene *basket, bool isSubBasket)
" <head>\n"
" <meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">\n"
" <meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\"><meta name=\"Generator\" content=\""
- << QGuiApplication::applicationDisplayName() << " " << VERSION << " " << KAboutData::applicationData().homepage()
+ << QGuiApplication::applicationDisplayName() << " " << BASKET_VERSION_STRING << " " << KAboutData::applicationData().homepage()
<< "\">\n"
" <style type=\"text/css\">\n"
// " @media print {\n"
@@ -402,7 +404,7 @@ void HTMLExporter::exportBasket(BasketScene *basket, bool isSubBasket)
.arg(i18n("Made with <a href=\"%1\">%2</a> %3, a tool to take notes and keep information at hand.",
KAboutData::applicationData().homepage(),
QGuiApplication::applicationDisplayName(),
- QStringLiteral(VERSION)));
+ QStringLiteral(BASKET_VERSION_STRING)));
stream << " </body>\n"
"</html>\n";