From c89bcfbb7a40c56755aceb49ca123e28251d45f1 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 10 Mar 2017 13:27:59 +0000 Subject: [PATCH] More robust isolation of the git commit hash, without special cases --- qrenderdoc/Windows/MainWindow.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qrenderdoc/Windows/MainWindow.cpp b/qrenderdoc/Windows/MainWindow.cpp index a27788d3a..cdaf05641 100644 --- a/qrenderdoc/Windows/MainWindow.cpp +++ b/qrenderdoc/Windows/MainWindow.cpp @@ -63,7 +63,12 @@ struct Version static QString string() { return "v" RENDERDOC_VERSION_STRING; } static QString gitCommitHash() { - return QString(GIT_COMMIT_HASH).replace("-official", "").replace("-beta", ""); + QString hash(GIT_COMMIT_HASH); + int dash = hash.indexOf(QChar('-')); + if(dash < 0) + return hash; + else + return hash.left(dash); } static bool isMismatched() { return RENDERDOC_GetVersionString() != bareString(); }