Skip to content

Commit

Permalink
use QStringLiteral
Browse files Browse the repository at this point in the history
  • Loading branch information
PeterPetrik committed Apr 20, 2018
1 parent c42af60 commit d124011
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 13 deletions.
5 changes: 2 additions & 3 deletions python/core/core_auto.sip
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -433,6 +435,3 @@
%Include qgsuserprofilemanager.sip
%Include symbology/qgsarrowsymbollayer.sip
%Include qgsuserprofile.sip
%Include mesh/qgsmeshdataprovider.sip
%Include mesh/qgsmeshlayer.sip

2 changes: 2 additions & 0 deletions python/core/mesh/qgsmeshdataprovider.sip.in
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/core/mesh/qgsmeshdataprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
15 changes: 7 additions & 8 deletions src/core/mesh/qgsmeshmemorydataprovider.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -41,7 +41,6 @@ QgsCoordinateReferenceSystem QgsMeshMemoryDataProvider::crs() const

QgsMeshMemoryDataProvider::QgsMeshMemoryDataProvider( const QString &uri )
: QgsMeshDataProvider( uri )
, mIsValid( false )
{
mIsValid = splitSections( uri );
}
Expand All @@ -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" ),
Expand All @@ -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" ),
Expand All @@ -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" ),
Expand Down
2 changes: 1 addition & 1 deletion src/core/mesh/qgsmeshmemorydataprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ class QgsMeshMemoryDataProvider: public QgsMeshDataProvider
QVector<QgsMeshVertex> mVertices;
QVector<QgsMeshFace> mFaces;

bool mIsValid;
bool mIsValid = false;
};

///@endcond
Expand Down
3 changes: 3 additions & 0 deletions src/core/mesh/qgstriangularmesh.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,10 @@ struct CORE_EXPORT QgsMesh
};

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

0 comments on commit d124011

Please sign in to comment.