Skip to content

Commit

Permalink
Fix version number and build number
Browse files Browse the repository at this point in the history
  • Loading branch information
DamirPorobic committed Oct 20, 2018
1 parent 45a4a36 commit 0b1ac6d
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 11 deletions.
5 changes: 3 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,9 @@ install:


script:
- export VERSION=$(git rev-list --count HEAD)-$(git rev-parse --short HEAD) # required for version sufix
- cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DVERSION_SUFIX=$VERSION
- export BUILD_NUMBER=$(git rev-list --count HEAD)-$(git rev-parse --short HEAD)
- export VERSION=Continuous-$BUILD_NUMBER
- cmake . -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DVERSION_SUFIX=Continuous -DBUILD_NUMBER=$BUILD_NUMBER
- make -j$(nproc)
- make DESTDIR=appdir -j$(nproc) install ; find appdir/
- mkdir appdir/usr/bin ; mv appdir/bin/ksnip ./appdir/usr/bin/ ; rm -r ./appdir/bin
Expand Down
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
cmake_minimum_required(VERSION 3.5)
project(ksnip LANGUAGES CXX VERSION 1.5.0)

if(DEFINED VERSION_SUFIX)
if (DEFINED VERSION_SUFIX)
set(KSNIP_VERSION_SUFIX "-${VERSION_SUFIX}")
endif()

set(KSNIP_VERSION "${VERSION}${KSNIP_VERSION_SUFIX}")
set(KSNIP_VERSION "${PROJECT_VERSION}${KSNIP_VERSION_SUFIX}")
set(KSNIP_LANG_INSTAL_DIR "/usr/share/ksnip/translations")

configure_file(src/BuildConfig.h.in ${CMAKE_CURRENT_BINARY_DIR}/src/BuildConfig.h)
Expand Down
2 changes: 2 additions & 0 deletions src/BuildConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

#define KSNIP_VERSION "@KSNIP_VERSION@"

#define KSNIP_BUILD_NUMBER "@BUILD_NUMBER@"

#define KSNIP_LANG_INSTAL_DIR "@KSNIP_LANG_INSTAL_DIR@"

#endif
14 changes: 7 additions & 7 deletions src/gui/AboutDialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ void AboutDialog::createAboutTab()
auto layout = new QVBoxLayout();
auto label = new QLabel();
label->setText(QStringLiteral("<b>") + QApplication::applicationName() + QStringLiteral(" ") + tr("Screenshot Tool") + QStringLiteral("</b><br/><br/>") +
tr("(C) 2017 Damir Porobic") + QStringLiteral("<br/><br/>") +
tr("(C) 2018 Damir Porobic") + QStringLiteral("<br/><br/>") +
tr("License: ") + QStringLiteral("<a href=\"https://www.gnu.org/licenses/old-licenses/gpl-2.0.en.html\">GNU General Public License Version 2</a>") + QStringLiteral("<br/><br/>") +
tr("Please use ") + QStringLiteral("<a href=\"https://github.com/damirporobic/ksnip/issues/\">GitHub</a>") + tr(" to report bugs."));
label->setTextFormat(Qt::RichText);
Expand All @@ -91,16 +91,16 @@ void AboutDialog::createVersionTab()
{
auto layout = new QVBoxLayout();
auto label = new QLabel();
label->setText(QStringLiteral("<b>") + tr("Version ") + QApplication::applicationVersion() +
QStringLiteral("</b><br/><br/>") +
tr("Using:") +
QStringLiteral("<ul>"
label->setText(QStringLiteral("<b>") + tr("Version") + QStringLiteral(": ") + QApplication::applicationVersion() + QStringLiteral("</b>") +
QStringLiteral("<br/><b>") + tr("Build") + QStringLiteral(": ") + QStringLiteral(KSNIP_BUILD_NUMBER) + QStringLiteral("</b>") +
QStringLiteral("</b><br/><br/>") +
tr("Using:") +
QStringLiteral("<ul>"
"<li>Qt5</li>"
"<li>X11</li>"
"<li>KDE Wayland</li>"
"<li>Gnome Wayland</li>"
"</ul>"
"<br />"));
"</ul>"));
layout->addWidget(label);
mVersionWidget->setLayout(layout);
}
Expand Down
1 change: 1 addition & 0 deletions src/gui/AboutDialog.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
#include <QDialog>

#include "MainWindow.h"
#include "BuildConfig.h"

class QLabel;
class MainWindow;
Expand Down

0 comments on commit 0b1ac6d

Please sign in to comment.