Skip to content

Commit

Permalink
Replace QString::null by QString() in core (deprecated since Qt 5.9)
Browse files Browse the repository at this point in the history
  • Loading branch information
wonder-sk committed Jun 6, 2017
1 parent dbedd7e commit 51e7efe
Show file tree
Hide file tree
Showing 34 changed files with 51 additions and 51 deletions.
4 changes: 2 additions & 2 deletions python/core/auth/qgsauthconfig.sip
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@ class QgsPkiBundle

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

static const QgsPkiBundle fromPkcs12Paths( const QString &bundlepath,
const QString &bundlepass = QString::null );
const QString &bundlepass = QString() );
%Docstring
Construct a bundle of PKI components from a PKCS#12 file path
\param bundlepath Bundle file path
Expand Down
4 changes: 2 additions & 2 deletions python/core/auth/qgsauthmanager.sip
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Name of the authentication database table that stores server exceptions/configs
:rtype: str
%End

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

bool verifyMasterPassword( const QString &compare = QString::null );
bool verifyMasterPassword( const QString &compare = QString() );
%Docstring
Verify the supplied master password against any existing hash in authentication database
.. note::
Expand Down
8 changes: 4 additions & 4 deletions python/core/qgscredentials.sip
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class QgsCredentials

virtual ~QgsCredentials();

bool get( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
bool get( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
%Docstring
:rtype: bool
%End
Expand Down Expand Up @@ -72,7 +72,7 @@ retrieves instance
protected:
QgsCredentials();

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

protected:
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );
};

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

protected:
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString::null );
virtual bool request( const QString &realm, QString &username /In,Out/, QString &password /In,Out/, const QString &message = QString() );
virtual bool requestMasterPassword( QString &password /In,Out/, bool stored = false );
};

Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsdataitem.sip
Original file line number Diff line number Diff line change
Expand Up @@ -447,7 +447,7 @@ class QgsDataCollectionItem : QgsDataItem
#include "qgsdataitem.h"
%End
public:
QgsDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path = QString::null );
QgsDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path = QString() );
~QgsDataCollectionItem();

void addChild( QgsDataItem *item /Transfer/ );
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgserror.sip
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class QgsErrorMessage

QgsErrorMessage();

QgsErrorMessage( const QString &message, const QString &tag = QString::null, const QString &file = QString::null, const QString &function = QString::null, int line = 0 );
QgsErrorMessage( const QString &message, const QString &tag = QString(), const QString &file = QString(), const QString &function = QString(), int line = 0 );
%Docstring
Constructor.
\param message error message string
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsmultirenderchecker.sip
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ class QgsMultiRenderChecker

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

\param renderedImagePath A path to the rendered image with which control images will be compared
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsproject.sip
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ Returns the QgsProject singleton instance
:rtype: list of str
%End

QString readEntry( const QString &scope, const QString &key, const QString &def = QString::null, bool *ok = 0 ) const;
QString readEntry( const QString &scope, const QString &key, const QString &def = QString(), bool *ok = 0 ) const;
%Docstring
:rtype: str
%End
Expand Down Expand Up @@ -411,7 +411,7 @@ Convenience function to query topological editing status
QString homePath() const;
%Docstring
Return project's home path
:return: home path of project (or QString.null if not set) *
:return: home path of project (or null QString if not set) *
:rtype: str
%End

Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsproviderregistry.sip
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class QgsProviderRegistry
Manager,
};

static QgsProviderRegistry *instance( const QString &pluginPath = QString::null );
static QgsProviderRegistry *instance( const QString &pluginPath = QString() );
%Docstring
Means of accessing canonical single instance
:rtype: QgsProviderRegistry
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectorlayer.sip
Original file line number Diff line number Diff line change
Expand Up @@ -890,7 +890,7 @@ Return the provider type for this layer
virtual QString subsetString() const;
%Docstring
Get the string (typically sql) used to define a subset of the layer
:return: The subset string or QString.null if not implemented by the provider
:return: The subset string or null QString if not implemented by the provider
:rtype: str
%End

Expand Down
2 changes: 1 addition & 1 deletion src/core/auth/qgsauthconfig.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ const QString QgsPkiBundle::certId() const
{
if ( mCert.isNull() )
{
return QString::null;
return QString();
}
return QString( mCert.digest( QCryptographicHash::Sha1 ).toHex() );
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/auth/qgsauthconfig.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class CORE_EXPORT QgsPkiBundle
*/
static const QgsPkiBundle fromPemPaths( const QString &certPath,
const QString &keyPath,
const QString &keyPass = QString::null,
const QString &keyPass = QString(),
const QList<QSslCertificate> &caChain = QList<QSslCertificate>() );

/**
Expand All @@ -216,7 +216,7 @@ class CORE_EXPORT QgsPkiBundle
* \param bundlepass Optional bundle passphrase
*/
static const QgsPkiBundle fromPkcs12Paths( const QString &bundlepath,
const QString &bundlepass = QString::null );
const QString &bundlepass = QString() );

//! Whether the bundle, either its certificate or private key, is null
bool isNull() const;
Expand Down
6 changes: 3 additions & 3 deletions src/core/auth/qgsauthmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class CORE_EXPORT QgsAuthManager : public QObject
const QString authDatabaseServersTable() const { return AUTH_SERVERS_TABLE; }

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

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

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

bool masterPasswordRowsInDb( int *rows ) const;

bool masterPasswordCheckAgainstDb( const QString &compare = QString::null ) const;
bool masterPasswordCheckAgainstDb( const QString &compare = QString() ) const;

bool masterPasswordStoreInDb() const;

Expand Down
2 changes: 1 addition & 1 deletion src/core/auth/qgsauthmethodregistry.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class CORE_EXPORT QgsAuthMethodRegistry

public:
//! Means of accessing canonical single instance
static QgsAuthMethodRegistry *instance( const QString &pluginPath = QString::null );
static QgsAuthMethodRegistry *instance( const QString &pluginPath = QString() );

//! Virtual dectructor
virtual ~QgsAuthMethodRegistry();
Expand Down
2 changes: 1 addition & 1 deletion src/core/dxf/qgsdxfexport.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4262,7 +4262,7 @@ QString QgsDxfExport::dxfEncoding( const QString &name )
return DXF_ENCODINGS[i][0];
}

return QString::null;
return QString();
}

QStringList QgsDxfExport::encodings()
Expand Down
4 changes: 2 additions & 2 deletions src/core/expression/qgsexpression.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ class CORE_EXPORT QgsExpression

struct HelpExample SIP_SKIP
{
HelpExample( const QString &expression, const QString &returns, const QString &note = QString::null )
HelpExample( const QString &expression, const QString &returns, const QString &note = QString() )
: mExpression( expression )
, mReturns( returns )
, mNote( note )
Expand All @@ -491,7 +491,7 @@ class CORE_EXPORT QgsExpression
const QList<QgsExpression::HelpArg> &arguments = QList<QgsExpression::HelpArg>(),
bool variableLenArguments = false,
const QList<QgsExpression::HelpExample> &examples = QList<QgsExpression::HelpExample>(),
const QString &notes = QString::null )
const QString &notes = QString() )
: mName( name )
, mDescription( description )
, mArguments( arguments )
Expand Down
2 changes: 1 addition & 1 deletion src/core/geometry/qgswkbtypes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ QString QgsWkbTypes::displayString( Type type )
QMap< Type, wkbEntry >::const_iterator it = ENTRIES.constFind( type );
if ( it == ENTRIES.constEnd() )
{
return QString::null;
return QString();
}
return it->mName;
}
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgscredentials.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ class CORE_EXPORT QgsCredentials

virtual ~QgsCredentials() = default;

bool get( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString::null );
bool get( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() );
void put( const QString &realm, const QString &username, const QString &password );

bool getMasterPassword( QString &password SIP_INOUT, bool stored = false );
Expand Down Expand Up @@ -75,7 +75,7 @@ class CORE_EXPORT QgsCredentials
QgsCredentials();

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

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

protected:
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString::null ) override;
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() ) override;
virtual bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) override;
};

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

protected:
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString::null ) override;
virtual bool request( const QString &realm, QString &username SIP_INOUT, QString &password SIP_INOUT, const QString &message = QString() ) override;
virtual bool requestMasterPassword( QString &password SIP_INOUT, bool stored = false ) override;
};

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdataitem.h
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@ class CORE_EXPORT QgsDataCollectionItem : public QgsDataItem
{
Q_OBJECT
public:
QgsDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path = QString::null );
QgsDataCollectionItem( QgsDataItem *parent, const QString &name, const QString &path = QString() );
~QgsDataCollectionItem();

void addChild( QgsDataItem *item SIP_TRANSFER ) { mChildren.append( item ); }
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdataprovider.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@ class CORE_EXPORT QgsDataProvider : public QObject
*/
virtual QString subsetString() const
{
return QString::null;
return QString();
}


Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsdatasourceuri.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ QgsDataSourceUri::QgsDataSourceUri( QString uri )
}
else
{
mGeometryColumn = QString::null;
mGeometryColumn = QString();
}
}
else if ( pname == QLatin1String( "key" ) )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgseditformconfig_p.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class QgsEditFormConfigPrivate : public QSharedData
{
public:
QgsEditFormConfigPrivate()
: mInvisibleRootContainer( new QgsAttributeEditorContainer( QString::null, nullptr ) )
: mInvisibleRootContainer( new QgsAttributeEditorContainer( QString(), nullptr ) )
, mConfiguredRootContainer( false )
, mEditorLayout( QgsEditFormConfig::GeneratedLayout )
, mInitCodeSource( QgsEditFormConfig::CodeSourceNone )
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgserror.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class CORE_EXPORT QgsErrorMessage
* \param function the function where error was created
* \param line the line where error was created
*/
QgsErrorMessage( const QString &message, const QString &tag = QString::null, const QString &file = QString::null, const QString &function = QString::null, int line = 0 );
QgsErrorMessage( const QString &message, const QString &tag = QString(), const QString &file = QString(), const QString &function = QString(), int line = 0 );

QString message() const { return mMessage; }
QString tag() const { return mTag; }
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsfeature.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ bool QgsFeature::setAttribute( int idx, const QVariant &value )
{
if ( idx < 0 || idx >= d->attributes.size() )
{
QgsMessageLog::logMessage( QObject::tr( "Attribute index %1 out of bounds [0;%2]" ).arg( idx ).arg( d->attributes.size() ), QString::null, QgsMessageLog::WARNING );
QgsMessageLog::logMessage( QObject::tr( "Attribute index %1 out of bounds [0;%2]" ).arg( idx ).arg( d->attributes.size() ), QString(), QgsMessageLog::WARNING );
return false;
}

Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsmultirenderchecker.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ class CORE_EXPORT QgsMultiRenderChecker
void setControlPathPrefix( const QString &prefix );

/**
* Set the path to the rendered image. If this is not set or set to QString::Null, an image
* Set the path to the rendered image. If this is not set or set to null QString, an image
* will be rendered based on the provided mapsettings
*
* \param renderedImagePath A path to the rendered image with which control images will be compared
Expand Down
2 changes: 1 addition & 1 deletion src/core/qgsogrutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField
}
else
{
value = QVariant( QString::null );
value = QVariant( QString() );
}

return value;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsproject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ QStringList makeKeyTokens_( const QString &scope, const QString &key )
{

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

}

Expand Down Expand Up @@ -1945,7 +1945,7 @@ QString QgsProject::homePath() const
{
QFileInfo pfi( fileName() );
if ( !pfi.exists() )
return QString::null;
return QString();

return pfi.canonicalPath();
}
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsproject.h
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@ class CORE_EXPORT QgsProject : public QObject, public QgsExpressionContextGenera
*/
QStringList readListEntry( const QString &scope, const QString &key, const QStringList &def = QStringList(), bool *ok = nullptr ) const;

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

/** Return project's home path
\returns home path of project (or QString::null if not set) */
\returns home path of project (or null QString if not set) */
QString homePath() const;

QgsRelationManager *relationManager() const;
Expand Down
4 changes: 2 additions & 2 deletions src/core/qgsprojectbadlayerhandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ QgsProjectBadLayerHandler::DataType QgsProjectBadLayerHandler::dataType( const Q
{
QString type = layerNode.toElement().attribute( QStringLiteral( "type" ) );

if ( QString::null == type )
if ( type.isNull() )
{
QgsDebugMsg( "cannot find ``type'' attribute" );

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

return QString::null;
return QString();
}

return dataSourceNode.toElement().text();
Expand Down
Loading

2 comments on commit 51e7efe

@nyalldawson
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes! Called it! Good riddance to that annoying confusing behaviour.

I'm curious where you read this though - I can't find it listed anywhere?

@wonder-sk
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When compiling against Qt 5.9, compiler emits deprecation warnings about that...

Please sign in to comment.