Skip to content

Commit 51e7efe

Browse files
committed
Replace QString::null by QString() in core (deprecated since Qt 5.9)
1 parent dbedd7e commit 51e7efe

34 files changed

+51
-51
lines changed

python/core/auth/qgsauthconfig.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ class QgsPkiBundle
218218

219219
static const QgsPkiBundle fromPemPaths( const QString &certPath,
220220
const QString &keyPath,
221-
const QString &keyPass = QString::null,
221+
const QString &keyPass = QString(),
222222
const QList<QSslCertificate> &caChain = QList<QSslCertificate>() );
223223
%Docstring
224224
Construct a bundle of PKI components from PEM-formatted file paths
@@ -230,7 +230,7 @@ class QgsPkiBundle
230230
%End
231231

232232
static const QgsPkiBundle fromPkcs12Paths( const QString &bundlepath,
233-
const QString &bundlepass = QString::null );
233+
const QString &bundlepass = QString() );
234234
%Docstring
235235
Construct a bundle of PKI components from a PKCS#12 file path
236236
\param bundlepath Bundle file path

python/core/auth/qgsauthmanager.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ Name of the authentication database table that stores server exceptions/configs
6161
:rtype: str
6262
%End
6363

64-
bool init( const QString &pluginPath = QString::null );
64+
bool init( const QString &pluginPath = QString() );
6565
%Docstring
6666
Initialize QCA, prioritize qca-ossl plugin and optionally set up the authentication database
6767
:rtype: bool
@@ -107,7 +107,7 @@ Standard message for when QCA's qca-ossl plugin is missing and system is disable
107107
:rtype: bool
108108
%End
109109

110-
bool verifyMasterPassword( const QString &compare = QString::null );
110+
bool verifyMasterPassword( const QString &compare = QString() );
111111
%Docstring
112112
Verify the supplied master password against any existing hash in authentication database
113113
.. note::

python/core/qgscredentials.sip

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ class QgsCredentials
3131

3232
virtual ~QgsCredentials();
3333

34-
bool get( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
34+
bool get( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
3535
%Docstring
3636
:rtype: bool
3737
%End
@@ -72,7 +72,7 @@ retrieves instance
7272
protected:
7373
QgsCredentials();
7474

75-
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null ) = 0;
75+
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() ) = 0;
7676
%Docstring
7777
request a password
7878
:rtype: bool
@@ -115,7 +115,7 @@ signals that object will be destroyed and shouldn't be used anymore
115115
%End
116116

117117
protected:
118-
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
118+
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
119119
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );
120120
};
121121

@@ -143,7 +143,7 @@ signals that object will be destroyed and shouldn't be used anymore
143143
%End
144144

145145
protected:
146-
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
146+
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
147147
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );
148148
};
149149

python/core/qgsdataitem.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -447,7 +447,7 @@ class QgsDataCollectionItem : QgsDataItem
447447
#include "qgsdataitem.h"
448448
%End
449449
public:
450-
QgsDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path = QString::null );
450+
QgsDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path = QString() );
451451
~QgsDataCollectionItem();
452452

453453
void addChild( QgsDataItem *item /Transfer/ );

python/core/qgserror.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class QgsErrorMessage
2828

2929
QgsErrorMessage();
3030

31-
QgsErrorMessage( const QString &message, const QString &tag = QString::null, const QString &file = QString::null, const QString &function = QString::null, int line = 0 );
31+
QgsErrorMessage( const QString &message, const QString &tag = QString(), const QString &file = QString(), const QString &function = QString(), int line = 0 );
3232
%Docstring
3333
Constructor.
3434
\param message error message string

python/core/qgsmultirenderchecker.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class QgsMultiRenderChecker
6060

6161
void setRenderedImage( const QString &renderedImagePath );
6262
%Docstring
63-
Set the path to the rendered image. If this is not set or set to QString.Null, an image
63+
Set the path to the rendered image. If this is not set or set to null QString, an image
6464
will be rendered based on the provided mapsettings
6565

6666
\param renderedImagePath A path to the rendered image with which control images will be compared

python/core/qgsproject.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Returns the QgsProject singleton instance
268268
:rtype: list of str
269269
%End
270270

271-
QString readEntry( const QString &scope, const QString &key, const QString &def = QString::null, bool *ok = 0 ) const;
271+
QString readEntry( const QString &scope, const QString &key, const QString &def = QString(), bool *ok = 0 ) const;
272272
%Docstring
273273
:rtype: str
274274
%End
@@ -411,7 +411,7 @@ Convenience function to query topological editing status
411411
QString homePath() const;
412412
%Docstring
413413
Return project's home path
414-
:return: home path of project (or QString.null if not set) *
414+
:return: home path of project (or null QString if not set) *
415415
:rtype: str
416416
%End
417417

python/core/qgsproviderregistry.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ class QgsProviderRegistry
4242
Manager,
4343
};
4444

45-
static QgsProviderRegistry *instance( const QString &pluginPath = QString::null );
45+
static QgsProviderRegistry *instance( const QString &pluginPath = QString() );
4646
%Docstring
4747
Means of accessing canonical single instance
4848
:rtype: QgsProviderRegistry

python/core/qgsvectorlayer.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -890,7 +890,7 @@ Return the provider type for this layer
890890
virtual QString subsetString() const;
891891
%Docstring
892892
Get the string (typically sql) used to define a subset of the layer
893-
:return: The subset string or QString.null if not implemented by the provider
893+
:return: The subset string or null QString if not implemented by the provider
894894
:rtype: str
895895
%End
896896

src/core/auth/qgsauthconfig.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -299,7 +299,7 @@ const QString QgsPkiBundle::certId() const
299299
{
300300
if ( mCert.isNull() )
301301
{
302-
return QString::null;
302+
return QString();
303303
}
304304
return QString( mCert.digest( QCryptographicHash::Sha1 ).toHex() );
305305
}

src/core/auth/qgsauthconfig.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class CORE_EXPORT QgsPkiBundle
207207
*/
208208
static const QgsPkiBundle fromPemPaths( const QString &certPath,
209209
const QString &keyPath,
210-
const QString &keyPass = QString::null,
210+
const QString &keyPass = QString(),
211211
const QList<QSslCertificate> &caChain = QList<QSslCertificate>() );
212212

213213
/**
@@ -216,7 +216,7 @@ class CORE_EXPORT QgsPkiBundle
216216
* \param bundlepass Optional bundle passphrase
217217
*/
218218
static const QgsPkiBundle fromPkcs12Paths( const QString &bundlepath,
219-
const QString &bundlepass = QString::null );
219+
const QString &bundlepass = QString() );
220220

221221
//! Whether the bundle, either its certificate or private key, is null
222222
bool isNull() const;

src/core/auth/qgsauthmanager.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
8989
const QString authDatabaseServersTable() const { return AUTH_SERVERS_TABLE; }
9090

9191
//! Initialize QCA, prioritize qca-ossl plugin and optionally set up the authentication database
92-
bool init( const QString &pluginPath = QString::null );
92+
bool init( const QString &pluginPath = QString() );
9393

9494
//! Whether QCA has the qca-ossl plugin, which a base run-time requirement
9595
bool isDisabled() const;
@@ -119,7 +119,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
119119
* \note Do not emit verification signals when only comparing
120120
* \param compare Password to compare against
121121
*/
122-
bool verifyMasterPassword( const QString &compare = QString::null );
122+
bool verifyMasterPassword( const QString &compare = QString() );
123123

124124
//! Whether master password has be input and verified, i.e. authentication database is accessible
125125
bool masterPasswordIsSet() const;
@@ -639,7 +639,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
639639

640640
bool masterPasswordRowsInDb( int *rows ) const;
641641

642-
bool masterPasswordCheckAgainstDb( const QString &compare = QString::null ) const;
642+
bool masterPasswordCheckAgainstDb( const QString &compare = QString() ) const;
643643

644644
bool masterPasswordStoreInDb() const;
645645

src/core/auth/qgsauthmethodregistry.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class CORE_EXPORT QgsAuthMethodRegistry
4444

4545
public:
4646
//! Means of accessing canonical single instance
47-
static QgsAuthMethodRegistry *instance( const QString &pluginPath = QString::null );
47+
static QgsAuthMethodRegistry *instance( const QString &pluginPath = QString() );
4848

4949
//! Virtual dectructor
5050
virtual ~QgsAuthMethodRegistry();

src/core/dxf/qgsdxfexport.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4262,7 +4262,7 @@ QString QgsDxfExport::dxfEncoding( const QString &name )
42624262
return DXF_ENCODINGS[i][0];
42634263
}
42644264

4265-
return QString::null;
4265+
return QString();
42664266
}
42674267

42684268
QStringList QgsDxfExport::encodings()

src/core/expression/qgsexpression.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ class CORE_EXPORT QgsExpression
474474

475475
struct HelpExample SIP_SKIP
476476
{
477-
HelpExample( const QString &expression, const QString &returns, const QString &note = QString::null )
477+
HelpExample( const QString &expression, const QString &returns, const QString &note = QString() )
478478
: mExpression( expression )
479479
, mReturns( returns )
480480
, mNote( note )
@@ -491,7 +491,7 @@ class CORE_EXPORT QgsExpression
491491
const QList<QgsExpression::HelpArg> &arguments = QList<QgsExpression::HelpArg>(),
492492
bool variableLenArguments = false,
493493
const QList<QgsExpression::HelpExample> &examples = QList<QgsExpression::HelpExample>(),
494-
const QString &notes = QString::null )
494+
const QString &notes = QString() )
495495
: mName( name )
496496
, mDescription( description )
497497
, mArguments( arguments )

src/core/geometry/qgswkbtypes.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ QString QgsWkbTypes::displayString( Type type )
121121
QMap< Type, wkbEntry >::const_iterator it = ENTRIES.constFind( type );
122122
if ( it == ENTRIES.constEnd() )
123123
{
124-
return QString::null;
124+
return QString();
125125
}
126126
return it->mName;
127127
}

src/core/qgscredentials.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class CORE_EXPORT QgsCredentials
4343

4444
virtual ~QgsCredentials() = default;
4545

46-
bool get( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString::null );
46+
bool get( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() );
4747
void put( const QString &realm, const QString &username, const QString &password );
4848

4949
bool getMasterPassword( QString &password SIP_INOUT, bool stored = false );
@@ -75,7 +75,7 @@ class CORE_EXPORT QgsCredentials
7575
QgsCredentials();
7676

7777
//! request a password
78-
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString::null ) = 0;
78+
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() ) = 0;
7979

8080
//! request a master password
8181
virtual bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) = 0;
@@ -117,7 +117,7 @@ class CORE_EXPORT QgsCredentialsNone : public QObject, public QgsCredentials
117117
void destroyed();
118118

119119
protected:
120-
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString::null ) override;
120+
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() ) override;
121121
virtual bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) override;
122122
};
123123

@@ -141,7 +141,7 @@ class CORE_EXPORT QgsCredentialsConsole : public QObject, public QgsCredentials
141141
void destroyed();
142142

143143
protected:
144-
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString::null ) override;
144+
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() ) override;
145145
virtual bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) override;
146146
};
147147

src/core/qgsdataitem.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class CORE_EXPORT QgsDataCollectionItem : public QgsDataItem
403403
{
404404
Q_OBJECT
405405
public:
406-
QgsDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path = QString::null );
406+
QgsDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path = QString() );
407407
~QgsDataCollectionItem();
408408

409409
void addChild( QgsDataItem *item SIP_TRANSFER ) { mChildren.append( item ); }

src/core/qgsdataprovider.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ class CORE_EXPORT QgsDataProvider : public QObject
207207
*/
208208
virtual QString subsetString() const
209209
{
210-
return QString::null;
210+
return QString();
211211
}
212212

213213

src/core/qgsdatasourceuri.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ QgsDataSourceUri::QgsDataSourceUri( QString uri )
122122
}
123123
else
124124
{
125-
mGeometryColumn = QString::null;
125+
mGeometryColumn = QString();
126126
}
127127
}
128128
else if ( pname == QLatin1String( "key" ) )

src/core/qgseditformconfig_p.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class QgsEditFormConfigPrivate : public QSharedData
2727
{
2828
public:
2929
QgsEditFormConfigPrivate()
30-
: mInvisibleRootContainer( new QgsAttributeEditorContainer( QString::null, nullptr ) )
30+
: mInvisibleRootContainer( new QgsAttributeEditorContainer( QString(), nullptr ) )
3131
, mConfiguredRootContainer( false )
3232
, mEditorLayout( QgsEditFormConfig::GeneratedLayout )
3333
, mInitCodeSource( QgsEditFormConfig::CodeSourceNone )

src/core/qgserror.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class CORE_EXPORT QgsErrorMessage
5050
* \param function the function where error was created
5151
* \param line the line where error was created
5252
*/
53-
QgsErrorMessage( const QString &message, const QString &tag = QString::null, const QString &file = QString::null, const QString &function = QString::null, int line = 0 );
53+
QgsErrorMessage( const QString &message, const QString &tag = QString(), const QString &file = QString(), const QString &function = QString(), int line = 0 );
5454

5555
QString message() const { return mMessage; }
5656
QString tag() const { return mTag; }

src/core/qgsfeature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,7 +205,7 @@ bool QgsFeature::setAttribute( int idx, const QVariant &value )
205205
{
206206
if ( idx < 0 || idx >= d->attributes.size() )
207207
{
208-
QgsMessageLog::logMessage( QObject::tr( "Attribute index %1 out of bounds [0;%2]" ).arg( idx ).arg( d->attributes.size() ), QString::null, QgsMessageLog::WARNING );
208+
QgsMessageLog::logMessage( QObject::tr( "Attribute index %1 out of bounds [0;%2]" ).arg( idx ).arg( d->attributes.size() ), QString(), QgsMessageLog::WARNING );
209209
return false;
210210
}
211211

src/core/qgsmultirenderchecker.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ class CORE_EXPORT QgsMultiRenderChecker
6666
void setControlPathPrefix( const QString &prefix );
6767

6868
/**
69-
* Set the path to the rendered image. If this is not set or set to QString::Null, an image
69+
* Set the path to the rendered image. If this is not set or set to null QString, an image
7070
* will be rendered based on the provided mapsettings
7171
*
7272
* \param renderedImagePath A path to the rendered image with which control images will be compared

src/core/qgsogrutils.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField
170170
}
171171
else
172172
{
173-
value = QVariant( QString::null );
173+
value = QVariant( QString() );
174174
}
175175

176176
return value;

src/core/qgsproject.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ QStringList makeKeyTokens_( const QString &scope, const QString &key )
9797
{
9898

9999
QString errorString = QObject::tr( "Entry token invalid : '%1'. The token will not be saved to file." ).arg( keyToken );
100-
QgsMessageLog::logMessage( errorString, QString::null, QgsMessageLog::CRITICAL );
100+
QgsMessageLog::logMessage( errorString, QString(), QgsMessageLog::CRITICAL );
101101

102102
}
103103

@@ -1945,7 +1945,7 @@ QString QgsProject::homePath() const
19451945
{
19461946
QFileInfo pfi( fileName() );
19471947
if ( !pfi.exists() )
1948-
return QString::null;
1948+
return QString();
19491949

19501950
return pfi.canonicalPath();
19511951
}

src/core/qgsproject.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
273273
*/
274274
QStringList readListEntry( const QString &scope, const QString &key, const QStringList &def = QStringList(), bool *ok = nullptr ) const;
275275

276-
QString readEntry( const QString &scope, const QString &key, const QString &def = QString::null, bool *ok = nullptr ) const;
276+
QString readEntry( const QString &scope, const QString &key, const QString &def = QString(), bool *ok = nullptr ) const;
277277
int readNumEntry( const QString &scope, const QString &key, int def = 0, bool *ok = nullptr ) const;
278278
double readDoubleEntry( const QString &scope, const QString &key, double def = 0, bool *ok = nullptr ) const;
279279
bool readBoolEntry( const QString &scope, const QString &key, bool def = false, bool *ok = nullptr ) const;
@@ -377,7 +377,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
377377
void setAreaUnits( QgsUnitTypes::AreaUnit unit );
378378

379379
/** Return project's home path
380-
\returns home path of project (or QString::null if not set) */
380+
\returns home path of project (or null QString if not set) */
381381
QString homePath() const;
382382

383383
QgsRelationManager *relationManager() const;

src/core/qgsprojectbadlayerhandler.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ QgsProjectBadLayerHandler::DataType QgsProjectBadLayerHandler::dataType( const Q
3333
{
3434
QString type = layerNode.toElement().attribute( QStringLiteral( "type" ) );
3535

36-
if ( QString::null == type )
36+
if ( type.isNull() )
3737
{
3838
QgsDebugMsg( "cannot find ``type'' attribute" );
3939

@@ -66,7 +66,7 @@ QString QgsProjectBadLayerHandler::dataSource( const QDomNode &layerNode )
6666
{
6767
QgsDebugMsg( "cannot find datasource node" );
6868

69-
return QString::null;
69+
return QString();
7070
}
7171

7272
return dataSourceNode.toElement().text();

0 commit comments

Comments
 (0)