1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-31 21:45:33 +00:00

Added code to test if git hash is availible

This commit is contained in:
Gašper Sedej 2014-03-12 12:33:42 +01:00
parent 06e02ed77f
commit d72a2f1ffb

View file

@ -23,12 +23,20 @@ namespace MWGui
, mSaveGameDialog(NULL) , mSaveGameDialog(NULL)
{ {
getWidget(mVersionText, "VersionText"); getWidget(mVersionText, "VersionText");
std::string rev = OPENMW_VERSION_COMMITHASH;
rev = rev.substr(0,10);
std::stringstream sstream; 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(); std::string output = sstream.str();
mVersionText->setCaptionWithReplacing(output); mVersionText->setCaption(output);
updateMenu(); updateMenu();
} }