From 33f890b55469d6fb18a8043f10558818017b381e Mon Sep 17 00:00:00 2001 From: itsmattkc Date: Mon, 31 Dec 2018 15:41:28 +1100 Subject: [PATCH] added commit short hash to window title --- mainwindow.cpp | 9 ++++++++- olive.pro | 5 +++++ 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index f84212d13..0759112e0 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -54,7 +54,7 @@ MainWindow* mainWindow; QTimer autorecovery_timer; QString config_dir; -QString appName = "Olive (December 2018 | Alpha)"; +QString appName; bool demoNoticeShown = false; void MainWindow::setup_layout(bool reset) { @@ -96,6 +96,13 @@ void MainWindow::setup_layout(bool reset) { MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) { + appName = "Olive (December 2018 | Alpha"; +#ifdef GITHASH + appName += " | "; + appName += GITHASH; +#endif + appName += ")"; + setup_debug(); mainWindow = this; diff --git a/olive.pro b/olive.pro index 1ab9f79e8..d6815c471 100644 --- a/olive.pro +++ b/olive.pro @@ -27,6 +27,11 @@ DEFINES += QT_DEPRECATED_WARNINGS # You can also select to disable deprecated APIs only up to a certain version of Qt. #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 +# Tries to get the current Git short hash +system("which git") { + GITHASHVAR = $$system(git --git-dir $$PWD/.git --work-tree $$PWD log -1 --format=%h) + DEFINES += GITHASH=\\"\"$$GITHASHVAR\\"\" +} SOURCES += \ main.cpp \