From c013966f4b3904aaaf17e4411630b16814103ef1 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Wed, 4 Feb 2015 23:52:07 -0800 Subject: [PATCH] Version number is now set in a single place --- CMakeLists.txt | 7 +++++++ cli/kdeconnect-cli.cpp | 12 +++++++++--- core/CMakeLists.txt | 5 ----- interfaces/CMakeLists.txt | 4 ---- kdeconnect-version.h.in | 2 ++ kded/kdeconnectd.cpp | 2 +- 6 files changed, 19 insertions(+), 13 deletions(-) create mode 100644 kdeconnect-version.h.in diff --git a/CMakeLists.txt b/CMakeLists.txt index c3148d4b4..7d991fa7b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,5 +1,10 @@ project(kdeconnect) +set(KDECONNECT_VERSION_MAJOR 0) +set(KDECONNECT_VERSION_MINOR 8) +set(KDECONNECT_VERSION_PATCH 0) +set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}") + cmake_minimum_required(VERSION 2.8.12) find_package(ECM 0.0.9 REQUIRED NO_MODULE) @@ -9,6 +14,8 @@ find_package(Qt5 5.2 REQUIRED COMPONENTS Quick Test) find_package(KF5 REQUIRED COMPONENTS I18n KIO Notifications ConfigWidgets DBusAddons KCMUtils IconThemes) find_package(Qca-qt5 2.1.0 REQUIRED) +configure_file(kdeconnect-version.h.in ${CMAKE_CURRENT_BINARY_DIR}/kdeconnect-version.h) + include(KDEInstallDirs) include(KDECompilerSettings) include(KDECMakeSettings) diff --git a/cli/kdeconnect-cli.cpp b/cli/kdeconnect-cli.cpp index 9e796cbb5..b30576c25 100644 --- a/cli/kdeconnect-cli.cpp +++ b/cli/kdeconnect-cli.cpp @@ -1,5 +1,5 @@ /* - * Copyright 2013 Aleix Pol Gonzalez + * Copyright 2015 Aleix Pol Gonzalez * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -28,11 +28,17 @@ #include #include +#include "../kdeconnect-version.h" + int main(int argc, char** argv) { QCoreApplication app(argc, argv); - KAboutData about("kdeconnect-cli", i18n("kdeconnect-cli"), "1.0", i18n("KDE Connect CLI tool"), - KAboutLicense::GPL, i18n("(C) 2013 Aleix Pol Gonzalez")); + KAboutData about("kdeconnect-cli", + "kdeconnect-cli", + QLatin1String(KDECONNECT_VERSION_STRING), + i18n("KDE Connect CLI tool"), + KAboutLicense::GPL, + i18n("(C) 2015 Aleix Pol Gonzalez")); KAboutData::setApplicationData(about); about.addAuthor( i18n("Aleix Pol Gonzalez"), QString(), "aleixpol@kde.org" ); diff --git a/core/CMakeLists.txt b/core/CMakeLists.txt index b6fa09b88..f9f092550 100644 --- a/core/CMakeLists.txt +++ b/core/CMakeLists.txt @@ -2,11 +2,6 @@ project(KDEConnectCore) add_definitions(-DTRANSLATION_DOMAIN=\"kdeconnect-core\") -set(KDECONNECT_VERSION_MAJOR 1) -set(KDECONNECT_VERSION_MINOR 0) -set(KDECONNECT_VERSION_PATCH 1) -set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}") - include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) diff --git a/interfaces/CMakeLists.txt b/interfaces/CMakeLists.txt index 9a3dd713b..d71425bfe 100644 --- a/interfaces/CMakeLists.txt +++ b/interfaces/CMakeLists.txt @@ -1,7 +1,3 @@ -set(KDECONNECT_VERSION_MAJOR 1) -set(KDECONNECT_VERSION_MINOR 0) -set(KDECONNECT_VERSION_PATCH 1) -set(KDECONNECT_VERSION "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}.${KDECONNECT_VERSION_PATCH}") include_directories(${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR} diff --git a/kdeconnect-version.h.in b/kdeconnect-version.h.in new file mode 100644 index 000000000..e90e7c550 --- /dev/null +++ b/kdeconnect-version.h.in @@ -0,0 +1,2 @@ + +#define KDECONNECT_VERSION_STRING "${KDECONNECT_VERSION_MAJOR}.${KDECONNECT_VERSION_MINOR}" \ No newline at end of file diff --git a/kded/kdeconnectd.cpp b/kded/kdeconnectd.cpp index 068371daa..c5df8405c 100644 --- a/kded/kdeconnectd.cpp +++ b/kded/kdeconnectd.cpp @@ -61,7 +61,7 @@ int main(int argc, char* argv[]) { QApplication app(argc, argv); app.setApplicationName("kdeconnect"); - app.setApplicationVersion("0.1"); + app.setApplicationVersion(QLatin1String(KDECONNECT_VERSION_STRING)); app.setOrganizationDomain("kde.org"); app.setQuitOnLastWindowClosed(false);