Skip to content
Permalink
Browse files

Replace QString::null by QString() in core (deprecated since Qt 5.9)

  • Loading branch information
wonder-sk committed Jun 6, 2017
1 parent dbedd7e commit 51e7efe2181d049fc15b21a338b3622016ab5bd0
@@ -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
@@ -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
@@ -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
@@ -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::
@@ -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
@@ -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
@@ -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 );
};

@@ -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 );
};

@@ -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/ );
@@ -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
@@ -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
@@ -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
@@ -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

@@ -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
@@ -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

@@ -299,7 +299,7 @@ const QString QgsPkiBundle::certId() const
{
if ( mCert.isNull() )
{
return QString::null;
return QString();
}
return QString( mCert.digest( QCryptographicHash::Sha1 ).toHex() );
}
@@ -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>() );

/**
@@ -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;
@@ -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;
@@ -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;
@@ -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;

@@ -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();
@@ -4262,7 +4262,7 @@ QString QgsDxfExport::dxfEncoding( const QString &name )
return DXF_ENCODINGS[i][0];
}

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

QStringList QgsDxfExport::encodings()
@@ -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 )
@@ -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 )
@@ -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;
}
@@ -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 );
@@ -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;
@@ -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;
};

@@ -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;
};

@@ -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 ); }
@@ -207,7 +207,7 @@ class CORE_EXPORT QgsDataProvider : public QObject
*/
virtual QString subsetString() const
{
return QString::null;
return QString();
}


@@ -122,7 +122,7 @@ QgsDataSourceUri::QgsDataSourceUri( QString uri )
}
else
{
mGeometryColumn = QString::null;
mGeometryColumn = QString();
}
}
else if ( pname == QLatin1String( "key" ) )
@@ -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 )
@@ -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; }
@@ -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;
}

@@ -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
@@ -170,7 +170,7 @@ QVariant QgsOgrUtils::getOgrFeatureAttribute( OGRFeatureH ogrFet, const QgsField
}
else
{
value = QVariant( QString::null );
value = QVariant( QString() );
}

return value;
@@ -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 );

}

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

return pfi.canonicalPath();
}
@@ -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;
@@ -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;
@@ -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" );

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

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

return dataSourceNode.toElement().text();

2 comments on commit 51e7efe

@nyalldawson

This comment has been minimized.

Copy link
Collaborator

@nyalldawson nyalldawson replied Jun 6, 2017

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

This comment has been minimized.

Copy link
Member Author

@wonder-sk wonder-sk replied Jun 6, 2017

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

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