From 43bc223e683e9059b6b89653f91d10f8ac0a9978 Mon Sep 17 00:00:00 2001 From: pvdk Date: Wed, 22 Jan 2014 16:57:18 +0100 Subject: [PATCH 1/7] Added version info retrieval from git tags --- CMakeLists.txt | 26 +++- cmake/GetGitRevisionDescription.cmake | 159 +++++++++++++++++++++++ cmake/GetGitRevisionDescription.cmake.in | 38 ++++++ 3 files changed, 217 insertions(+), 6 deletions(-) create mode 100644 cmake/GetGitRevisionDescription.cmake create mode 100644 cmake/GetGitRevisionDescription.cmake.in diff --git a/CMakeLists.txt b/CMakeLists.txt index 8eb8b44c2..9bd2cdddc 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,15 +14,29 @@ endif (APPLE) set(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/) -include (OpenMWMacros) +include(OpenMWMacros) # Version -set (OPENMW_VERSION_MAJOR 0) -set (OPENMW_VERSION_MINOR 27) -set (OPENMW_VERSION_RELEASE 0) +include(GetGitRevisionDescription) -set (OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}") +get_git_tag_revision(taghash --tags --max-count=1) +get_git_head_revision(refspec commithash) +git_describe(version --tags ${taghash}) + +string(REGEX MATCH "^openmw-[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" match "${version}") +if (match) + string(REGEX REPLACE "^openmw-([0-9]+)\\..*" "\\1" OPENMW_VERSION_MAJOR "${version}") + string(REGEX REPLACE "^openmw-[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_MINOR "${version}") + string(REGEX REPLACE "^openmw-[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_RELEASE "${version}") + + set(OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}") + set(OPENMW_VERSION_COMMIT "${commithash}") + + message(STATUS "Configuring OpenMW ${OPENMW_VERSION}...") +else (match) + message(FATAL_ERROR "Failed to get valid version information from Git") +endif (match) # doxygen main page @@ -319,7 +333,7 @@ configure_file(${OpenMW_SOURCE_DIR}/files/openmw.cfg configure_file(${OpenMW_SOURCE_DIR}/files/opencs.cfg "${OpenMW_BINARY_DIR}/opencs.cfg") - + configure_file(${OpenMW_SOURCE_DIR}/files/opencs/defaultfilters "${OpenMW_BINARY_DIR}/resources/defaultfilters" COPYONLY) diff --git a/cmake/GetGitRevisionDescription.cmake b/cmake/GetGitRevisionDescription.cmake new file mode 100644 index 000000000..f70f64261 --- /dev/null +++ b/cmake/GetGitRevisionDescription.cmake @@ -0,0 +1,159 @@ +# - Returns a version string from Git +# +# These functions force a re-configure on each git commit so that you can +# trust the values of the variables in your build system. +# +# get_git_head_revision( [ ...]) +# +# Returns the refspec and sha hash of the current head revision +# +# git_describe( [ ...]) +# +# Returns the results of git describe on the source tree, and adjusting +# the output so that it tests false if an error occurs. +# +# git_get_exact_tag( [ ...]) +# +# Returns the results of git describe --exact-match on the source tree, +# and adjusting the output so that it tests false if there was no exact +# matching tag. +# +# Requires CMake 2.6 or newer (uses the 'function' command) +# +# Original Author: +# 2009-2010 Ryan Pavlik +# http://academic.cleardefinition.com +# Iowa State University HCI Graduate Program/VRAC +# +# Copyright Iowa State University 2009-2010. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +if(__get_git_revision_description) + return() +endif() +set(__get_git_revision_description YES) + +# We must run the following at "include" time, not at function call time, +# to find the path to this module rather than the path to a calling list file +get_filename_component(_gitdescmoddir ${CMAKE_CURRENT_LIST_FILE} PATH) + +function(get_git_head_revision _refspecvar _hashvar) + set(GIT_PARENT_DIR "${CMAKE_CURRENT_SOURCE_DIR}") + set(GIT_DIR "${GIT_PARENT_DIR}/.git") + while(NOT EXISTS "${GIT_DIR}") # .git dir not found, search parent directories + set(GIT_PREVIOUS_PARENT "${GIT_PARENT_DIR}") + get_filename_component(GIT_PARENT_DIR ${GIT_PARENT_DIR} PATH) + if(GIT_PARENT_DIR STREQUAL GIT_PREVIOUS_PARENT) + # We have reached the root directory, we are not in git + set(${_refspecvar} "GITDIR-NOTFOUND" PARENT_SCOPE) + set(${_hashvar} "GITDIR-NOTFOUND" PARENT_SCOPE) + return() + endif() + + set(GIT_DIR "${GIT_PARENT_DIR}/.git") + endwhile() + + # check if this is a submodule + if(NOT IS_DIRECTORY ${GIT_DIR}) + file(READ ${GIT_DIR} submodule) + string(REGEX REPLACE "gitdir: (.*)\n$" "\\1" GIT_DIR_RELATIVE ${submodule}) + get_filename_component(SUBMODULE_DIR ${GIT_DIR} PATH) + get_filename_component(GIT_DIR ${SUBMODULE_DIR}/${GIT_DIR_RELATIVE} ABSOLUTE) + endif() + + set(GIT_DATA "${CMAKE_CURRENT_BINARY_DIR}/CMakeFiles/git-data") + + if(NOT EXISTS "${GIT_DATA}") + file(MAKE_DIRECTORY "${GIT_DATA}") + endif() + + if(NOT EXISTS "${GIT_DIR}/HEAD") + return() + endif() + + set(HEAD_FILE "${GIT_DATA}/HEAD") + configure_file("${GIT_DIR}/HEAD" "${HEAD_FILE}" COPYONLY) + + configure_file("${_gitdescmoddir}/GetGitRevisionDescription.cmake.in" + "${GIT_DATA}/grabRef.cmake" @ONLY) + include("${GIT_DATA}/grabRef.cmake") + + set(${_refspecvar} "${HEAD_REF}" PARENT_SCOPE) + set(${_hashvar} "${HEAD_HASH}" PARENT_SCOPE) +endfunction() + +function(git_describe _var) + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + + #get_git_head_revision(refspec hash) + + if(NOT GIT_FOUND) + set(${_var} "GIT-NOTFOUND" PARENT_SCOPE) + return() + endif() + + #if(NOT hash) + # set(${_var} "HEAD-HASH-NOTFOUND" PARENT_SCOPE) + # return() + #endif() + + # TODO sanitize + #if((${ARGN}" MATCHES "&&") OR + # (ARGN MATCHES "||") OR + # (ARGN MATCHES "\\;")) + # message("Please report the following error to the project!") + # message(FATAL_ERROR "Looks like someone's doing something nefarious with git_describe! Passed arguments ${ARGN}") + #endif() + + #message(STATUS "Arguments to execute_process: ${ARGN}") + + execute_process(COMMAND + "${GIT_EXECUTABLE}" + describe + #${hash} + ${ARGN} + WORKING_DIRECTORY + "${CMAKE_SOURCE_DIR}" + RESULT_VARIABLE + res + OUTPUT_VARIABLE + out + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + + if(NOT res EQUAL 0) + set(out "${out}-${res}-NOTFOUND") + endif() + + set(${_var} "${out}" PARENT_SCOPE) +endfunction() + +function(get_git_tag_revision _var) + if(NOT GIT_FOUND) + find_package(Git QUIET) + endif() + + execute_process(COMMAND + "${GIT_EXECUTABLE}" + rev-list + ${ARGN} + WORKING_DIRECTORY + "${CMAKE_SOURCE_DIR}" + RESULT_VARIABLE + res + OUTPUT_VARIABLE + out + ERROR_QUIET + OUTPUT_STRIP_TRAILING_WHITESPACE) + if(NOT res EQUAL 0) + set(out "${out}-${res}-NOTFOUND") + endif() + + set(${_var} "${out}" PARENT_SCOPE) +endfunction() + + diff --git a/cmake/GetGitRevisionDescription.cmake.in b/cmake/GetGitRevisionDescription.cmake.in new file mode 100644 index 000000000..888ce13aa --- /dev/null +++ b/cmake/GetGitRevisionDescription.cmake.in @@ -0,0 +1,38 @@ +# +# Internal file for GetGitRevisionDescription.cmake +# +# Requires CMake 2.6 or newer (uses the 'function' command) +# +# Original Author: +# 2009-2010 Ryan Pavlik +# http://academic.cleardefinition.com +# Iowa State University HCI Graduate Program/VRAC +# +# Copyright Iowa State University 2009-2010. +# Distributed under the Boost Software License, Version 1.0. +# (See accompanying file LICENSE_1_0.txt or copy at +# http://www.boost.org/LICENSE_1_0.txt) + +set(HEAD_HASH) + +file(READ "@HEAD_FILE@" HEAD_CONTENTS LIMIT 1024) + +string(STRIP "${HEAD_CONTENTS}" HEAD_CONTENTS) +if(HEAD_CONTENTS MATCHES "ref") + # named branch + string(REPLACE "ref: " "" HEAD_REF "${HEAD_CONTENTS}") + if(EXISTS "@GIT_DIR@/${HEAD_REF}") + configure_file("@GIT_DIR@/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) + elseif(EXISTS "@GIT_DIR@/logs/${HEAD_REF}") + configure_file("@GIT_DIR@/logs/${HEAD_REF}" "@GIT_DATA@/head-ref" COPYONLY) + set(HEAD_HASH "${HEAD_REF}") + endif() +else() + # detached HEAD + configure_file("@GIT_DIR@/HEAD" "@GIT_DATA@/head-ref" COPYONLY) +endif() + +if(NOT HEAD_HASH) + file(READ "@GIT_DATA@/head-ref" HEAD_HASH LIMIT 1024) + string(STRIP "${HEAD_HASH}" HEAD_HASH) +endif() From c95b8bcb391f32ba92458c14b27d20f90a6e8397 Mon Sep 17 00:00:00 2001 From: pvdk Date: Wed, 22 Jan 2014 17:33:55 +0100 Subject: [PATCH 2/7] Moved the generated version header stuff into components --- apps/openmw/CMakeLists.txt | 5 ----- apps/openmw/config.hpp.cmake | 9 --------- apps/openmw/main.cpp | 3 +-- components/CMakeLists.txt | 12 ++++++++++-- 4 files changed, 11 insertions(+), 18 deletions(-) delete mode 100644 apps/openmw/config.hpp.cmake diff --git a/apps/openmw/CMakeLists.txt b/apps/openmw/CMakeLists.txt index 3b533b416..ff0ff65d2 100644 --- a/apps/openmw/CMakeLists.txt +++ b/apps/openmw/CMakeLists.txt @@ -1,7 +1,3 @@ - -# config file -configure_file ("${CMAKE_CURRENT_SOURCE_DIR}/config.hpp.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/config.hpp") - # local files set(GAME main.cpp @@ -12,7 +8,6 @@ if(NOT WIN32) endif() set(GAME_HEADER engine.hpp - config.hpp ) source_group(game FILES ${GAME} ${GAME_HEADER}) diff --git a/apps/openmw/config.hpp.cmake b/apps/openmw/config.hpp.cmake deleted file mode 100644 index 848fbe0eb..000000000 --- a/apps/openmw/config.hpp.cmake +++ /dev/null @@ -1,9 +0,0 @@ -#ifndef CONFIG_H -#define CONFIG_H - -#define OPENMW_VERSION_MAJOR @OPENMW_VERSION_MAJOR@ -#define OPENMW_VERSION_MINOR @OPENMW_VERSION_MINOR@ -#define OPENMW_VERSION_RELEASE @OPENMW_VERSION_RELEASE@ -#define OPENMW_VERSION "@OPENMW_VERSION@" - -#endif diff --git a/apps/openmw/main.cpp b/apps/openmw/main.cpp index 3129e6bd3..260a35a9b 100644 --- a/apps/openmw/main.cpp +++ b/apps/openmw/main.cpp @@ -1,6 +1,7 @@ #include #include +#include #include #include @@ -30,8 +31,6 @@ extern int is_debugger_attached(void); #include #endif -#include "config.hpp" - #include /** * Workaround for problems with whitespaces in paths in older versions of Boost library diff --git a/components/CMakeLists.txt b/components/CMakeLists.txt index a037fd5fa..9c37d2e62 100644 --- a/components/CMakeLists.txt +++ b/components/CMakeLists.txt @@ -1,5 +1,9 @@ project (Components) set (CMAKE_BUILD_TYPE DEBUG) + +# Version file +configure_file("${CMAKE_CURRENT_SOURCE_DIR}/version/version.hpp.cmake" "${CMAKE_CURRENT_SOURCE_DIR}/version/version.hpp") + # source files add_component_dir (settings @@ -75,8 +79,12 @@ add_component_dir (loadinglistener ) add_component_dir (ogreinit - ogreinit ogreplugin - ) + ogreinit ogreplugin + ) + +add_component_dir (version + version + ) set (ESM_UI ${CMAKE_SOURCE_DIR}/files/ui/contentselector.ui ) From fa186f5ec1430c6b75ffbcf2bf0848b6498e90fe Mon Sep 17 00:00:00 2001 From: pvdk Date: Wed, 22 Jan 2014 17:51:10 +0100 Subject: [PATCH 3/7] Added version information to the launcher --- apps/launcher/maindialog.cpp | 9 ++++++++ files/ui/mainwindow.ui | 42 +++++++++++++++++++++++++++++++----- 2 files changed, 46 insertions(+), 5 deletions(-) diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 9b3c4e1b0..4aa8a4816 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -1,5 +1,8 @@ #include "maindialog.hpp" +#include + +#include #include #include #include @@ -67,6 +70,12 @@ Launcher::MainDialog::MainDialog(QWidget *parent) // Remove what's this? button setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); + // Add version information to bottom of the window + QString revision(OPENMW_VERSION_COMMIT); + revision = revision.left(10); + + versionLabel->setText(tr("OpenMW %0 revision %1").arg(OPENMW_VERSION, revision)); + createIcons(); } diff --git a/files/ui/mainwindow.ui b/files/ui/mainwindow.ui index a1dfb172b..5f2be05a2 100644 --- a/files/ui/mainwindow.ui +++ b/files/ui/mainwindow.ui @@ -2,6 +2,14 @@ MainWindow + + + 0 + 0 + 575 + 535 + + 575 @@ -56,11 +64,35 @@ - - - QDialogButtonBox::Close - - + + + + + OpenMW version + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + QDialogButtonBox::Close + + + + From c354cd52be15d92940e97dcaee9f7d3de0a86024 Mon Sep 17 00:00:00 2001 From: pvdk Date: Wed, 22 Jan 2014 18:37:49 +0100 Subject: [PATCH 4/7] Added compile date and time to the version info in the launcher --- apps/launcher/maindialog.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 4aa8a4816..42d3d1754 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -3,6 +3,8 @@ #include #include +#include +#include #include #include #include @@ -74,7 +76,12 @@ Launcher::MainDialog::MainDialog(QWidget *parent) QString revision(OPENMW_VERSION_COMMIT); revision = revision.left(10); + QDate date(QDate::fromString(__DATE__, QLatin1String("MMM dd yyyy"))); + QTime time(QTime::fromString(__TIME__, QLatin1String("hh:m:ss"))); + versionLabel->setText(tr("OpenMW %0 revision %1").arg(OPENMW_VERSION, revision)); + versionLabel->setToolTip(tr("Compiled on %0 %1").arg(date.toString(Qt::SystemLocaleShortDate), + time.toString(Qt::SystemLocaleShortDate))); createIcons(); } From d92ded3bcd37af3a5bfd56b05e3f3e58903efe1e Mon Sep 17 00:00:00 2001 From: pvdk Date: Wed, 22 Jan 2014 19:30:41 +0100 Subject: [PATCH 5/7] Forgot adding the version header CMake file --- components/version/version.hpp.cmake | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 components/version/version.hpp.cmake diff --git a/components/version/version.hpp.cmake b/components/version/version.hpp.cmake new file mode 100644 index 000000000..4adb0d8c2 --- /dev/null +++ b/components/version/version.hpp.cmake @@ -0,0 +1,12 @@ +#ifndef VERSION_HPP +#define VERSION_HPP + +#define OPENMW_VERSION_MAJOR @OPENMW_VERSION_MAJOR@ +#define OPENMW_VERSION_MINOR @OPENMW_VERSION_MINOR@ +#define OPENMW_VERSION_RELEASE @OPENMW_VERSION_RELEASE@ +#define OPENMW_VERSION "@OPENMW_VERSION@" + +#define OPENMW_VERSION_COMMIT "@OPENMW_VERSION_COMMIT@" + +#endif // VERSION_HPP + From 19bef4fce8cf490be89c40057ab498fe30d0394f Mon Sep 17 00:00:00 2001 From: pvdk Date: Thu, 23 Jan 2014 13:18:05 +0100 Subject: [PATCH 6/7] Distinguish between release and development builds --- CMakeLists.txt | 23 ++++++++++++----------- apps/launcher/maindialog.cpp | 12 +++++++++--- components/version/version.hpp.cmake | 3 ++- 3 files changed, 23 insertions(+), 15 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 9bd2cdddc..01ac9b23f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -20,23 +20,24 @@ include(OpenMWMacros) include(GetGitRevisionDescription) -get_git_tag_revision(taghash --tags --max-count=1) -get_git_head_revision(refspec commithash) -git_describe(version --tags ${taghash}) +get_git_tag_revision(TAGHASH --tags --max-count=1) +get_git_head_revision(REFSPEC COMMITHASH) +git_describe(VERSION --tags ${TAGHASH}) -string(REGEX MATCH "^openmw-[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" match "${version}") -if (match) - string(REGEX REPLACE "^openmw-([0-9]+)\\..*" "\\1" OPENMW_VERSION_MAJOR "${version}") - string(REGEX REPLACE "^openmw-[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_MINOR "${version}") - string(REGEX REPLACE "^openmw-[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_RELEASE "${version}") +string(REGEX MATCH "^openmw-[^0-9]*[0-9]+\\.[0-9]+\\.[0-9]+.*" MATCH "${VERSION}") +if (MATCH) + string(REGEX REPLACE "^openmw-([0-9]+)\\..*" "\\1" OPENMW_VERSION_MAJOR "${VERSION}") + string(REGEX REPLACE "^openmw-[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_MINOR "${VERSION}") + string(REGEX REPLACE "^openmw-[0-9]+\\.[0-9]+\\.([0-9]+).*" "\\1" OPENMW_VERSION_RELEASE "${VERSION}") set(OPENMW_VERSION "${OPENMW_VERSION_MAJOR}.${OPENMW_VERSION_MINOR}.${OPENMW_VERSION_RELEASE}") - set(OPENMW_VERSION_COMMIT "${commithash}") + set(OPENMW_VERSION_COMMITHASH "${COMMITHASH}") + set(OPENMW_VERSION_TAGHASH "${TAGHASH}") message(STATUS "Configuring OpenMW ${OPENMW_VERSION}...") -else (match) +else (MATCH) message(FATAL_ERROR "Failed to get valid version information from Git") -endif (match) +endif (MATCH) # doxygen main page diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 42d3d1754..67665adf0 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -73,13 +73,19 @@ Launcher::MainDialog::MainDialog(QWidget *parent) setWindowFlags(this->windowFlags() & ~Qt::WindowContextHelpButtonHint); // Add version information to bottom of the window - QString revision(OPENMW_VERSION_COMMIT); - revision = revision.left(10); + QString revision(OPENMW_VERSION_COMMITHASH); + QString tag(OPENMW_VERSION_TAGHASH); + if (revision == tag) { + versionLabel->setText(tr("OpenMW %0 release").arg(OPENMW_VERSION)); + } else { + versionLabel->setText(tr("OpenMW unstable, revision %0").arg(revision.left(10))); + } + + // Add the compile date and time QDate date(QDate::fromString(__DATE__, QLatin1String("MMM dd yyyy"))); QTime time(QTime::fromString(__TIME__, QLatin1String("hh:m:ss"))); - versionLabel->setText(tr("OpenMW %0 revision %1").arg(OPENMW_VERSION, revision)); versionLabel->setToolTip(tr("Compiled on %0 %1").arg(date.toString(Qt::SystemLocaleShortDate), time.toString(Qt::SystemLocaleShortDate))); diff --git a/components/version/version.hpp.cmake b/components/version/version.hpp.cmake index 4adb0d8c2..4cdfa32f0 100644 --- a/components/version/version.hpp.cmake +++ b/components/version/version.hpp.cmake @@ -6,7 +6,8 @@ #define OPENMW_VERSION_RELEASE @OPENMW_VERSION_RELEASE@ #define OPENMW_VERSION "@OPENMW_VERSION@" -#define OPENMW_VERSION_COMMIT "@OPENMW_VERSION_COMMIT@" +#define OPENMW_VERSION_COMMITHASH "@OPENMW_VERSION_COMMITHASH@" +#define OPENMW_VERSION_TAGHASH "@OPENMW_VERSION_TAGHASH@" #endif // VERSION_HPP From 4e03e9cf87998129c432e833a186b77b863dcfbd Mon Sep 17 00:00:00 2001 From: pvdk Date: Sun, 2 Feb 2014 20:10:47 +0100 Subject: [PATCH 7/7] Changed development version info text and the tooltip now works on all platforms --- apps/launcher/maindialog.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/apps/launcher/maindialog.cpp b/apps/launcher/maindialog.cpp index 67665adf0..56b3186ff 100644 --- a/apps/launcher/maindialog.cpp +++ b/apps/launcher/maindialog.cpp @@ -79,15 +79,14 @@ Launcher::MainDialog::MainDialog(QWidget *parent) if (revision == tag) { versionLabel->setText(tr("OpenMW %0 release").arg(OPENMW_VERSION)); } else { - versionLabel->setText(tr("OpenMW unstable, revision %0").arg(revision.left(10))); + versionLabel->setText(tr("OpenMW development (%0)").arg(revision.left(10))); } // Add the compile date and time - QDate date(QDate::fromString(__DATE__, QLatin1String("MMM dd yyyy"))); - QTime time(QTime::fromString(__TIME__, QLatin1String("hh:m:ss"))); - - versionLabel->setToolTip(tr("Compiled on %0 %1").arg(date.toString(Qt::SystemLocaleShortDate), - time.toString(Qt::SystemLocaleShortDate))); + versionLabel->setToolTip(tr("Compiled on %0 %1").arg(QLocale(QLocale::C).toDate(QString(__DATE__).simplified(), + QLatin1String("MMM d yyyy")).toString(Qt::SystemLocaleLongDate), + QLocale(QLocale::C).toTime(QString(__TIME__).simplified(), + QLatin1String("hh:mm:ss")).toString(Qt::SystemLocaleShortDate))); createIcons(); }