Skip to content

Commit 2b697f8

Browse files
author
g_j_m
committed
Fix for ticket #232. A make, make install, or make all in the toplevel
qgis directory will update a file (qgssvnversion.h) that contains the svn version of the qgis code, which is visible with the --help command line argument or in the Help:About dialog box. git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5710 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b123372 commit 2b697f8

File tree

5 files changed

+19
-1
lines changed

5 files changed

+19
-1
lines changed

Makefile.am

+7
Original file line numberDiff line numberDiff line change
@@ -58,3 +58,10 @@ release: UIcheck distdir
5858
> $(distdir)/qgis.spec
5959
BZIP2=$(BZIP2_ENV) $(AMTAR)$(TAR) --bzip2 -chof $(distdir).tar.bz2 $(distdir)
6060
-rm -rf $(distdir)
61+
62+
BUILT_SOURCES = qgssvnversion.h
63+
64+
.PHONY : qgssvnversion.h
65+
qgssvnversion.h:
66+
@ echo "#define QGSSVNVERSION \"`svnversion .`\"" > qgssvnversion.h
67+

src/core/qgis.cpp

+4
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11

22
#include "qgis.h"
3+
#include "qgssvnversion.h"
34

45
// Version constants
56
//
67

78
// Version string
89
const char* QGis::qgisVersion = VERSION;
10+
11+
// SVN version
12+
const char* QGis::qgisSvnVersion = QGSSVNVERSION;
913

1014
// Version number used for comparing versions using the "Check QGIS Version" function
1115
const int QGis::qgisVersionInt =800;

src/core/qgis.h

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ class QGis
4343
static const int qgisVersionInt;
4444
// Release name
4545
static const char* qgisReleaseName;
46+
// The subversion version
47+
static const char* qgisSvnVersion;
4648

4749
// Enumerations
4850
//

src/gui/main.cpp

+3-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
#include "qgisapp.h"
5555
#include "qgsapplication.h"
5656
#include <qgsconfig.h>
57+
#include <qgssvnversion.h>
5758
#include "qgsexception.h"
5859
#include "qgsproject.h"
5960

@@ -63,7 +64,8 @@ static const char * const ident_ = "$Id$";
6364
*/
6465
void usage( std::string const & appName )
6566
{
66-
std::cerr << "Quantum GIS - " << VERSION << " 'Simon'\n"
67+
std::cerr << "Quantum GIS - " << VERSION << " 'Simon' ("
68+
<< QGSSVNVERSION << ")\n"
6769
<< "Quantum GIS (QGIS) is a viewer for spatial data sets, including\n"
6870
<< "raster and vector data.\n"
6971
<< "Usage: " << appName << " [options] [FILES]\n"

src/gui/qgisapp.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -1200,6 +1200,9 @@ void QgisApp::about()
12001200
QgsAbout *abt = new QgsAbout();
12011201
QString versionString = tr("Version ");
12021202
versionString += QGis::qgisVersion;
1203+
versionString += " (";
1204+
versionString += QGis::qgisSvnVersion;
1205+
versionString += ")";
12031206
#ifdef HAVE_POSTGRESQL
12041207

12051208
versionString += tr(" with PostgreSQL support");

0 commit comments

Comments
 (0)