File tree Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Expand file tree Collapse file tree 2 files changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,9 @@ QT += core gui websockets
88
99greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
1010
11+ GIT_TAG_VERSION =$$system (git describe --always --tags )
12+ DEFINES += GIT_TAG_VERSION =\ \\"$$GIT_TAG_VERSION\\\"
13+
1114TARGET = Savestate2snes
1215TEMPLATE = app
1316
Original file line number Diff line number Diff line change @@ -101,7 +101,14 @@ int main(int argc, char *argv[])
101101 QTranslator translator;
102102 QString locale = QLocale::system ().name ().split (' _' ).first ();
103103 translator.load (a.applicationDirPath () + " /i18n/savestate2snes_" + locale + " .qm" );
104- QApplication::setApplicationVersion (" 0.6" );
104+ // This is only defined in the PRO file
105+ #ifdef GIT_TAG_VERSION
106+ QString plop (GIT_TAG_VERSION);
107+ plop.remove (0 , 1 ); // Remove the v
108+ QApplication::setApplicationVersion (QVersionNumber::fromString (plop).toString ());
109+ #else
110+ QApplication::setApplicationVersion (" 0.99" );
111+ #endif
105112 a.installTranslator (&translator);
106113 if (!settings.contains (" lastSaveStateDir" ))
107114 {
You can’t perform that action at this time.
0 commit comments