From d72a2f1ffb85d4e416c5bad19b974403c8f6c3ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ga=C5=A1per=20Sedej?= Date: Wed, 12 Mar 2014 12:33:42 +0100 Subject: [PATCH] Added code to test if git hash is availible --- apps/openmw/mwgui/mainmenu.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwgui/mainmenu.cpp b/apps/openmw/mwgui/mainmenu.cpp index 2788c8f5c..4ad260fd9 100644 --- a/apps/openmw/mwgui/mainmenu.cpp +++ b/apps/openmw/mwgui/mainmenu.cpp @@ -23,12 +23,20 @@ namespace MWGui , mSaveGameDialog(NULL) { getWidget(mVersionText, "VersionText"); - std::string rev = OPENMW_VERSION_COMMITHASH; - rev = rev.substr(0,10); std::stringstream sstream; - sstream << "OpenMW version: " << OPENMW_VERSION << "\nrevision: " << rev; + sstream << "OpenMW version: " << OPENMW_VERSION; + + // adding info about git hash if availible + std::string rev = OPENMW_VERSION_COMMITHASH; + std::string tag = OPENMW_VERSION_TAGHASH; + if (!rev.empty() && !tag.empty()) + { + rev = rev.substr(0,10); + sstream << "\nrevision: " << rev; + } + std::string output = sstream.str(); - mVersionText->setCaptionWithReplacing(output); + mVersionText->setCaption(output); updateMenu(); }