diff --git a/inkbox.pro b/inkbox.pro index 127430b..000f92d 100644 --- a/inkbox.pro +++ b/inkbox.pro @@ -8,6 +8,7 @@ QMAKE_CXXFLAGS += -Wno-unused-function -Wno-unused-parameter # Thanks to https://github.com/mrbindraw/TestVersion/blob/master/TestVersion.pro GIT_VERSION = $$system(git describe --always --tags) +GIT_COMMIT = $$system(git rev-parse HEAD) COMMAND_REMOVE_MAKEFILES=$$quote(rm $$system_path($$OUT_PWD\Makefile*)) PRE_BUILD_TARGET = .dummyfile updatemakefiles.target = $$PRE_BUILD_TARGET @@ -16,6 +17,7 @@ updatemakefiles.depends = FORCE PRE_TARGETDEPS += $$PRE_BUILD_TARGET QMAKE_EXTRA_TARGETS += updatemakefiles DEFINES += GIT_VERSION=\\\"$$GIT_VERSION\\\" +DEFINES += GIT_COMMIT=\\\"$$GIT_COMMIT\\\" # You can make your code fail to compile if it uses deprecated APIs. # In order to do so, uncomment the following line. diff --git a/mainwindow.cpp b/mainwindow.cpp index ef0689b..e3206e0 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -567,7 +567,7 @@ MainWindow::MainWindow(QWidget *parent) // Write version control info to file in tmpfs if(checkconfig("/opt/inkbox_genuine") == true) { - string_writeconfig("/external_root/run/inkbox_gui_git_commit", GIT_VERSION); + string_writeconfig("/external_root/run/inkbox_gui_git_commit", GIT_COMMIT); } }