Navigation Menu

Skip to content

Commit

Permalink
support utf-8 encoded release names
Browse files Browse the repository at this point in the history
  • Loading branch information
jef-n committed Jul 10, 2016
1 parent 3d72837 commit c9838cc
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion cmake/Txt2Tags.cmake
Expand Up @@ -50,7 +50,7 @@ MACRO(ADD_TXT2TAGS_FILES _sources)
ADD_CUSTOM_COMMAND(
OUTPUT ${_out}.html
COMMAND ${TXT2TAGS_EXECUTABLE}
ARGS -o${_out}.html -t html ${_in}
ARGS --encoding=utf-8 -o${_out}.html -t html ${_in}
DEPENDS ${_in}
COMMENT "Building ${_out}.html from ${_in}"
)
Expand Down
4 changes: 2 additions & 2 deletions doc/INSTALL.html
Expand Up @@ -2,7 +2,7 @@
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.org">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>QGIS</TITLE>

<!-- Included /home/fischer/src/qgis/doc/style.css -->
Expand Down Expand Up @@ -3016,5 +3016,5 @@ <H1>9. Authors and Acknowledgments</H1>

</DIV>
<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -o/home/fischer/src/qgis/debian/build-master-pyqtwrapper-qt4/doc/INSTALL.html -t html /home/fischer/src/qgis/doc/INSTALL.t2t -->
<!-- cmdline: txt2tags -\-encoding=utf-8 -o/home/fischer/src/qgis/debian/build-master-pyqtwrapper-qt4/doc/INSTALL.html -t html /home/fischer/src/qgis/doc/INSTALL.t2t -->
</BODY></HTML>
4 changes: 2 additions & 2 deletions doc/news.html
Expand Up @@ -2,7 +2,7 @@
<HTML>
<HEAD>
<META NAME="generator" CONTENT="http://txt2tags.org">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=utf-8">
<TITLE>QGIS News</TITLE>

<!-- Included doc/style.css -->
Expand Down Expand Up @@ -3091,5 +3091,5 @@ <H1>28. 0.5</H1>
</DIV>

<!-- html code generated by txt2tags 2.6 (http://txt2tags.org) -->
<!-- cmdline: txt2tags -odoc/news.html -t html doc/news.t2t -->
<!-- cmdline: txt2tags -\-encoding=utf-8 -o/home/fischer/src/qgis/debian/build-master-pyqtwrapper-qt4/doc/news.html -t html /home/fischer/src/qgis/doc/news.t2t -->
</BODY></HTML>
6 changes: 3 additions & 3 deletions python/core/qgis.sip
Expand Up @@ -31,11 +31,11 @@ class QGis
// Version constants
//
// Version string
static const char* QGIS_VERSION;
static QString QGIS_VERSION;
// Version number used for comparing versions using the "Check QGIS Version" function
static const int QGIS_VERSION_INT;
// Release name
static const char* QGIS_RELEASE_NAME;
static QString QGIS_RELEASE_NAME;
// The development version
static const char* QGIS_DEV_VERSION;

Expand Down Expand Up @@ -93,7 +93,7 @@ class QGis
static int wkbDimensions( WkbType type );

//! Converts from old (pre 2.10) WKB type (OGR) to new WKB type
static QgsWKBTypes::Type fromOldWkbType(QGis::WkbType type);
static QgsWKBTypes::Type fromOldWkbType( QGis::WkbType type );

//! Converts from new (post 2.10) WKB type (OGC) to old WKB type
static QGis::WkbType fromNewWkbType( QgsWKBTypes::Type type );
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -376,7 +376,7 @@ static void setTitleBarText_( QWidget & qgisApp )
{
QString caption = QgisApp::tr( "QGIS " );

if ( QString( QGis::QGIS_VERSION ).endsWith( "Master" ) )
if ( QGis::QGIS_VERSION.endsWith( "Master" ) )
{
caption += QString( "%1" ).arg( QGis::QGIS_DEV_VERSION );
}
Expand Down Expand Up @@ -8114,7 +8114,7 @@ void QgisApp::duplicateVectorStyle( QgsVectorLayer* srcLayer, QgsVectorLayer* de
"qgis", "http://mrcc.com/qgis.dtd", "SYSTEM" );
QDomDocument doc( documentType );
QDomElement rootNode = doc.createElement( "qgis" );
rootNode.setAttribute( "version", QString( "%1" ).arg( QGis::QGIS_VERSION ) );
rootNode.setAttribute( "version", QGis::QGIS_VERSION );
doc.appendChild( rootNode );
QString errorMsg;
srcLayer->writeSymbology( rootNode, doc, errorMsg );
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgspluginregistry.cpp
Expand Up @@ -237,7 +237,7 @@ bool QgsPluginRegistry::checkQgisVersion( const QString& minVersion, const QStri
}

// our qgis version - cut release name after version number
QString qgisVersion = QString( QGis::QGIS_VERSION ).section( '-', 0, 0 );
QString qgisVersion = QGis::QGIS_VERSION.section( '-', 0, 0 );

QStringList qgisVersionParts = qgisVersion.split( '.' );

Expand Down
4 changes: 2 additions & 2 deletions src/core/qgis.cpp
Expand Up @@ -36,7 +36,7 @@
//

// Version string
const char* QGis::QGIS_VERSION = VERSION;
QString QGis::QGIS_VERSION( QString::fromUtf8( VERSION ) );

// development version
const char* QGis::QGIS_DEV_VERSION = QGSVERSION;
Expand All @@ -46,7 +46,7 @@ const char* QGis::QGIS_DEV_VERSION = QGSVERSION;
const int QGis::QGIS_VERSION_INT = VERSION_INT;

// Release name
const char* QGis::QGIS_RELEASE_NAME = RELEASE_NAME;
QString QGis::QGIS_RELEASE_NAME( QString::fromUtf8( RELEASE_NAME ) );

#if GDAL_VERSION_NUM >= 1800
const QString GEOPROJ4 = "+proj=longlat +datum=WGS84 +no_defs";
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgis.h
Expand Up @@ -43,11 +43,11 @@ class CORE_EXPORT QGis
// Version constants
//
// Version string
static const char* QGIS_VERSION;
static QString QGIS_VERSION;
// Version number used for comparing versions using the "Check QGIS Version" function
static const int QGIS_VERSION_INT;
// Release name
static const char* QGIS_RELEASE_NAME;
static QString QGIS_RELEASE_NAME;
// The development version
static const char* QGIS_DEV_VERSION;

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmaplayer.cpp
Expand Up @@ -1258,7 +1258,7 @@ void QgsMapLayer::exportNamedStyle( QDomDocument &doc, QString &errorMsg )
QDomDocument myDocument( documentType );

QDomElement myRootNode = myDocument.createElement( "qgis" );
myRootNode.setAttribute( "version", QString( "%1" ).arg( QGis::QGIS_VERSION ) );
myRootNode.setAttribute( "version", QGis::QGIS_VERSION );
myDocument.appendChild( myRootNode );

myRootNode.setAttribute( "hasScaleBasedVisibilityFlag", hasScaleBasedVisibility() ? 1 : 0 );
Expand Down
4 changes: 2 additions & 2 deletions tests/src/core/testqgsexpressioncontext.cpp
Expand Up @@ -495,9 +495,9 @@ void TestQgsExpressionContext::globalScope()
QgsExpression expOsName( "var('qgis_os_name')" );
QgsExpression expPlatform( "var('qgis_platform')" );

QCOMPARE( expVersion.evaluate( &context ).toString(), QString( QGis::QGIS_VERSION ) );
QCOMPARE( expVersion.evaluate( &context ).toString(), QGis::QGIS_VERSION );
QCOMPARE( expVersionNo.evaluate( &context ).toInt(), QGis::QGIS_VERSION_INT );
QCOMPARE( expReleaseName.evaluate( &context ).toString(), QString( QGis::QGIS_RELEASE_NAME ) );
QCOMPARE( expReleaseName.evaluate( &context ).toString(), QGis::QGIS_RELEASE_NAME );
QCOMPARE( expAccountName.evaluate( &context ).toString(), QgsApplication::userLoginName() );
QCOMPARE( expUserFullName.evaluate( &context ).toString(), QgsApplication::userFullName() );
QCOMPARE( expOsName.evaluate( &context ).toString(), QgsApplication::osName() );
Expand Down

0 comments on commit c9838cc

Please sign in to comment.