diff --git a/CMakeLists.txt b/CMakeLists.txt --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,7 +20,7 @@ set_package_properties(ECM PROPERTIES TYPE REQUIRED DESCRIPTION "Extra modules and scripts for CMake" URL "git://anongit.kde.org/extra-cmake-modules") -set(PROJECT_VERSION "16.08.0") +set(PROJECT_VERSION "0.90.0") set(KF5_DEP_VERSION "5.24.0") # handled by release scripts set(REQUIRED_QT_VERSION 5.4.0) @@ -47,7 +47,7 @@ VARIABLE_PREFIX ATCORE VERSION_HEADER "${CMAKE_CURRENT_BINARY_DIR}/atcore_version.h" PACKAGE_VERSION_FILE "${CMAKE_CURRENT_BINARY_DIR}/AtCoreConfigVersion.cmake" - SOVERSION 1 + SOVERSION ${PROJECT_VERSION_MAJOR} ) if (IS_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/po") diff --git a/src/atcore.h b/src/atcore.h --- a/src/atcore.h +++ b/src/atcore.h @@ -52,6 +52,7 @@ class ATCORE_EXPORT AtCore : public QObject { Q_OBJECT + Q_PROPERTY(QString version READ version) Q_PROPERTY(QStringList availableFirmwarePlugins READ availableFirmwarePlugins) Q_PROPERTY(quint16 serialTimerInterval READ serialTimerInterval WRITE setSerialTimerInterval) Q_PROPERTY(QStringList serialPorts READ serialPorts NOTIFY portsChanged) @@ -98,6 +99,12 @@ */ explicit AtCore(QObject *parent = nullptr); + /** + * @brief version + * @return Version number + */ + QString version() const; + /** * @brief Returns a List of detected serial ports * @return List of detected ports diff --git a/src/atcore.cpp b/src/atcore.cpp --- a/src/atcore.cpp +++ b/src/atcore.cpp @@ -33,6 +33,7 @@ #include #include "atcore.h" +#include "atcore_version.h" #include "seriallayer.h" #include "gcodecommands.h" #include "printthread.h" @@ -93,6 +94,11 @@ setState(AtCore::DISCONNECTED); } +QString AtCore::version() const +{ + return QString::fromLatin1(ATCORE_VERSION_STRING); +} + SerialLayer *AtCore::serial() const { return d->serial; diff --git a/testclient/mainwindow.cpp b/testclient/mainwindow.cpp --- a/testclient/mainwindow.cpp +++ b/testclient/mainwindow.cpp @@ -42,6 +42,7 @@ logFile(new QTemporaryFile(QDir::tempPath() + QStringLiteral("/AtCore_"))) { ui->setupUi(this); + setWindowTitle(QString::fromLatin1("AtCore (%1) - Test Gui").arg(core->version())); ui->serialPortCB->setEditable(true); QValidator *validator = new QIntValidator(); ui->baudRateLE->setValidator(validator);