Skip to content

Commit

Permalink
Avoid some "" literals and QString::nulls in layer API
Browse files Browse the repository at this point in the history
Use QString() instead
  • Loading branch information
nyalldawson committed Apr 10, 2017
1 parent de62c4e commit 9dabb9d
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions python/core/qgsmaplayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ class QgsMapLayer : QObject
PluginLayer
};

QgsMapLayer( QgsMapLayer::LayerType type = VectorLayer, const QString &name = QString::null, const QString &source = QString::null );
QgsMapLayer( QgsMapLayer::LayerType type = VectorLayer, const QString &name = QString(), const QString &source = QString() );
%Docstring
Constructor for QgsMapLayer
\param type layer type
Expand Down Expand Up @@ -1005,7 +1005,7 @@ Set whether layer is valid or not - should be used in constructor.
%End


void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = "" );
void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = QString() );
%Docstring
Read custom properties from project file.
\param layerNode note to read from
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ class QgsVectorLayer : QgsMapLayer, QgsExpressionContextGenerator
RemoveFromSelection,
};

QgsVectorLayer( const QString &path = QString::null, const QString &baseName = QString::null,
QgsVectorLayer( const QString &path = QString(), const QString &baseName = QString(),
const QString &providerLib = "ogr", bool loadDefaultStyleFlag = true );
%Docstring
Constructor - creates a vector layer
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsmaplayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
* \param name display name for the layer
* \param source datasource of layer
*/
QgsMapLayer( QgsMapLayer::LayerType type = VectorLayer, const QString &name = QString::null, const QString &source = QString::null );
QgsMapLayer( QgsMapLayer::LayerType type = VectorLayer, const QString &name = QString(), const QString &source = QString() );

virtual ~QgsMapLayer();

Expand Down Expand Up @@ -885,7 +885,7 @@ class CORE_EXPORT QgsMapLayer : public QObject
/** Read custom properties from project file.
\param layerNode note to read from
\param keyStartsWith reads only properties starting with the specified string (or all if the string is empty)*/
void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = "" );
void readCustomProperties( const QDomNode &layerNode, const QString &keyStartsWith = QString() );

//! Write custom properties to project file.
void writeCustomProperties( QDomNode &layerNode, QDomDocument &doc ) const;
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsvectorlayer.h
Original file line number Diff line number Diff line change
Expand Up @@ -392,7 +392,7 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
* \param loadDefaultStyleFlag whether to load the default style
*
*/
QgsVectorLayer( const QString &path = QString::null, const QString &baseName = QString::null,
QgsVectorLayer( const QString &path = QString(), const QString &baseName = QString(),
const QString &providerLib = "ogr", bool loadDefaultStyleFlag = true );


Expand Down

0 comments on commit 9dabb9d

Please sign in to comment.