Make build date update whenever build version does

Previously, the build version would only update if the dialog_about.cpp
file were modified. This moves the date generation into the same file
as the build version, so it will be updated whenever a new version
is made.
This commit is contained in:
Ian McInerney 2019-11-11 17:57:33 +00:00
parent fa14d5b9fa
commit 122ec64c02
5 changed files with 28 additions and 8 deletions

View File

@ -2,7 +2,7 @@
* This program source code file is part of KiCad, a free EDA CAD application.
*
* Copyright (C) 2015 Jean-Pierre Charras, jp.charras at wanadoo.fr
* Copyright (C) 2015-2016 KiCad Developers, see AUTHORS.txt for contributors.
* Copyright (C) 2015-2019 KiCad Developers, see AUTHORS.txt for contributors.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -26,7 +26,8 @@
#include <fctsys.h>
// The include file version.h is always created even if the repo version cannot be
// determined. In this case KICAD_BUILD_VERSION will default to "no-bzr".
// determined. In this case KICAD_VERSION_FULL will default to the KICAD_VERSION
// that is set in KiCadVersion.cmake.
#include <kicad_build_version.h>
@ -36,10 +37,18 @@
*/
wxString GetBuildVersion()
{
wxString msg = wxString::Format(
wxT( "%s" ),
wxT( KICAD_VERSION_FULL )
);
wxString msg = wxString::Format( wxT( "%s" ), wxT( KICAD_VERSION_FULL ) );
return msg;
}
/**
* Function GetBuildDate
* @return the build date string
*
*/
wxString GetBuildDate()
{
wxString msg = wxString::Format( wxT( "%s %s" ), wxT( __DATE__ ), wxT( __TIME__ ) );
return msg;
}

View File

@ -77,6 +77,7 @@ static void buildKicadAboutBanner( EDA_BASE_FRAME* aParent, ABOUT_APP_INFO& aInf
<< " build";
aInfo.SetBuildVersion( version );
aInfo.SetBuildDate( GetBuildDate() );
/* wxWidgets version */
wxString libVersion;

View File

@ -98,6 +98,9 @@ public:
void SetBuildVersion( const wxString& version ) { buildVersion = version; }
wxString& GetBuildVersion() { return buildVersion; }
void SetBuildDate( const wxString& date ) { buildDate = date; }
wxString& GetBuildDate() { return buildDate; }
void SetLibVersion( const wxString& version ) { libVersion = version; }
wxString& GetLibVersion() { return libVersion; }
@ -124,6 +127,7 @@ private:
wxString copyright;
wxString appName;
wxString buildVersion;
wxString buildDate;
wxString libVersion;
wxIcon m_appIcon;

View File

@ -466,7 +466,7 @@ void DIALOG_ABOUT::buildVersionInfoData( wxString& aMsg, bool aFormatHtml )
<< platform.GetPortIdName() << eol;
aMsg << "Build Info:" << eol;
aMsg << indent4 << "Build date: " << __DATE__ << " " << __TIME__ << eol;
aMsg << indent4 << "Build date: " << m_info.GetBuildDate() << eol;
aMsg << indent4 << "wxWidgets: " << wxVERSION_NUM_DOT_STRING << " (";
aMsg << __WX_BO_UNICODE __WX_BO_STL __WX_BO_WXWIN_COMPAT_2_8 ")";

View File

@ -36,4 +36,10 @@ class wxString;
*/
wxString GetBuildVersion();
/**
* Function GetBuildDate
* @return the build date string
*/
wxString GetBuildDate();
#endif // KICAD_BUILD_VERSION_H