Skip to content
Permalink
Browse files

use QStringLiteral

  • Loading branch information
PeterPetrik committed Apr 20, 2018
1 parent c42af60 commit d1240119ef88abbd4a28aaa795e46515293cb879
@@ -376,6 +376,8 @@
%Include raster/qgsrasterdataprovider.sip
%Include raster/qgsrasterinterface.sip
%Include raster/qgsrasterprojector.sip
%Include mesh/qgsmeshdataprovider.sip
%Include mesh/qgsmeshlayer.sip
%Include geometry/qgsabstractgeometry.sip
%Include geometry/qgsgeometry.sip
%Include geometry/qgspoint.sip
@@ -433,6 +435,3 @@
%Include qgsuserprofilemanager.sip
%Include symbology/qgsarrowsymbollayer.sip
%Include qgsuserprofile.sip
%Include mesh/qgsmeshdataprovider.sip
%Include mesh/qgsmeshlayer.sip

@@ -69,6 +69,8 @@ Base class for providing data for :py:class:`QgsMeshLayer`
Responsible for reading native mesh data

.. seealso:: :py:class:`QgsMeshSource`

.. versionadded:: 3.2
%End

%TypeHeaderCode
@@ -78,7 +78,7 @@ class CORE_EXPORT QgsMeshSource SIP_ABSTRACT
* Responsible for reading native mesh data
*
* \see QgsMeshSource
*
* \since QGIS 3.2
*/
class CORE_EXPORT QgsMeshDataProvider: public QgsDataProvider, public QgsMeshSource
{
@@ -26,12 +26,12 @@ bool QgsMeshMemoryDataProvider::isValid() const

QString QgsMeshMemoryDataProvider::name() const
{
return "mesh_memory";
return TEXT_PROVIDER_KEY;
}

QString QgsMeshMemoryDataProvider::description() const
{
return "memory data provider for mesh layer";
return TEXT_PROVIDER_DESCRIPTION;
}

QgsCoordinateReferenceSystem QgsMeshMemoryDataProvider::crs() const
@@ -41,7 +41,6 @@ QgsCoordinateReferenceSystem QgsMeshMemoryDataProvider::crs() const

QgsMeshMemoryDataProvider::QgsMeshMemoryDataProvider( const QString &uri )
: QgsMeshDataProvider( uri )
, mIsValid( false )
{
mIsValid = splitSections( uri );
}
@@ -67,7 +66,7 @@ QgsMeshMemoryDataProvider *QgsMeshMemoryDataProvider::createProvider( const QStr

bool QgsMeshMemoryDataProvider::splitSections( const QString &uri )
{
QStringList sections = uri.split( "---", QString::SkipEmptyParts );
const QStringList sections = uri.split( QStringLiteral( "---" ), QString::SkipEmptyParts );
if ( sections.size() != 2 )
{
setError( QgsError( QStringLiteral( "Invalid mesh definition, does not contain 2 sections" ),
@@ -85,10 +84,10 @@ bool QgsMeshMemoryDataProvider::addVertices( const QString &def )
{
QVector<QgsMeshVertex> vertices;

QStringList verticesCoords = def.split( "\n", QString::SkipEmptyParts );
const QStringList verticesCoords = def.split( '\n', QString::SkipEmptyParts );
for ( int i = 0; i < verticesCoords.size(); ++i )
{
QStringList coords = verticesCoords[i].split( ",", QString::SkipEmptyParts );
const QStringList coords = verticesCoords[i].split( ',', QString::SkipEmptyParts );
if ( coords.size() != 2 )
{
setError( QgsError( QStringLiteral( "Invalid mesh definition, vertex definition does not contain x, y" ),
@@ -109,10 +108,10 @@ bool QgsMeshMemoryDataProvider::addFaces( const QString &def )
{
QVector<QgsMeshFace> faces;

QStringList facesVertices = def.split( "\n", QString::SkipEmptyParts );
const QStringList facesVertices = def.split( '\n', QString::SkipEmptyParts );
for ( int i = 0; i < facesVertices.size(); ++i )
{
QStringList vertices = facesVertices[i].split( ",", QString::SkipEmptyParts );
const QStringList vertices = facesVertices[i].split( ',', QString::SkipEmptyParts );
if ( vertices.size() < 3 )
{
setError( QgsError( QStringLiteral( "Invalid mesh definition, face must contain at least 3 vertices" ),
@@ -90,7 +90,7 @@ class QgsMeshMemoryDataProvider: public QgsMeshDataProvider
QVector<QgsMeshVertex> mVertices;
QVector<QgsMeshFace> mFaces;

bool mIsValid;
bool mIsValid = false;
};

///@endcond
@@ -38,7 +38,10 @@ struct CORE_EXPORT QgsMesh
};

/**
* \ingroup core
*
* Triangular/Derived Mesh
*
* \since QGIS 3.2
*/
class CORE_EXPORT QgsTriangularMesh

0 comments on commit d124011

Please sign in to comment.
You can’t perform that action at this time.