- print the branch name onto the header if not master

Sun, 30 Mar 2014 22:10:29 +0300

author
Teemu Piippo <crimsondusk64@gmail.com>
date
Sun, 30 Mar 2014 22:10:29 +0300
changeset 121
b716d1902cd4
parent 120
5ea0faefa82a
child 122
4ef6734f09ff

- print the branch name onto the header if not master

src/main.cpp file | annotate | diff | comparison | revisions
--- a/src/main.cpp	Sun Mar 30 21:53:20 2014 +0300
+++ b/src/main.cpp	Sun Mar 30 22:10:29 2014 +0300
@@ -64,10 +64,25 @@
 		String headerline;
 		header = format (APPNAME " version %1", versionString (true));
 
+		if (String (GIT_BRANCH) != "master")
+		{
+			header += " (";
+			header += GIT_BRANCH;
+			header += " branch";
+		}
+
 #ifdef DEBUG
-		header += " (debug build)";
+		if (header.firstIndexOf ("(") != -1)
+			header += ", ";
+		else
+			header += " (";
+
+		header += "debug build";
 #endif
 
+		if (header.firstIndexOf ("(") != -1)
+			header += ")";
+
 		for (int i = 0; i < header.length() / 2; ++i)
 			headerline += "-=";
 

mercurial