Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Replace QString::null with QString()
Deprecated sind Qt 5.9
  • Loading branch information
m-kuhn committed Jun 16, 2017
1 parent a77f791 commit cb1f98f
Show file tree
Hide file tree
Showing 62 changed files with 130 additions and 130 deletions.
2 changes: 1 addition & 1 deletion python/gui/qgscredentialdialog.sip
Expand Up @@ -27,7 +27,7 @@ QgsCredentialDialog constructor


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/gui/qgsfilterlineedit.sip
Expand Up @@ -41,7 +41,7 @@ class QgsFilterLineEdit : QLineEdit
ClearToDefault,
};

QgsFilterLineEdit( QWidget *parent /TransferThis/ = 0, const QString &nullValue = QString::null );
QgsFilterLineEdit( QWidget *parent /TransferThis/ = 0, const QString &nullValue = QString() );
%Docstring
Constructor for QgsFilterLineEdit.
\param parent parent widget
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsnewhttpconnection.sip
Expand Up @@ -19,7 +19,7 @@ class QgsNewHttpConnection : QDialog
#include "qgsnewhttpconnection.h"
%End
public:
QgsNewHttpConnection( QWidget *parent /TransferThis/ = 0, const QString &baseKey = "qgis/connections-wms/", const QString &connName = QString::null, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
QgsNewHttpConnection( QWidget *parent /TransferThis/ = 0, const QString &baseKey = "qgis/connections-wms/", const QString &connName = QString(), Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
%Docstring
Constructor
%End
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsnewnamedialog.sip
Expand Up @@ -22,7 +22,7 @@ class QgsNewNameDialog : QgsDialog
%End
public:

QgsNewNameDialog( const QString &source = QString::null, const QString &initial = QString::null,
QgsNewNameDialog( const QString &source = QString(), const QString &initial = QString(),
const QStringList &extensions = QStringList(), const QStringList &existing = QStringList(),
const QRegExp &regexp = QRegExp(), Qt::CaseSensitivity cs = Qt::CaseSensitive,
QWidget *parent /TransferThis/ = 0, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
Expand Down
2 changes: 1 addition & 1 deletion python/gui/qgsnewvectorlayerdialog.sip
Expand Up @@ -20,7 +20,7 @@ class QgsNewVectorLayerDialog: QDialog
static QString runAndCreateLayer( QWidget *parent = 0, QString *enc = 0, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );
%Docstring
Runs the dialog and creates a layer matching the dialog parameters.
:return: fileName on success, empty string use aborted, QString.null if creation failed
:return: fileName on success, empty string use aborted, QString() if creation failed
:rtype: str
%End

Expand Down
2 changes: 1 addition & 1 deletion src/app/composer/qgscomposer.cpp
Expand Up @@ -1975,7 +1975,7 @@ void QgsComposer::exportCompositionAsImage( QgsComposer::OutputMode mode )
QgsAtlasComposition *atlasMap = &mComposition->atlasComposition();
if ( mode == QgsComposer::Single )
{
QString outputFileName = QString::null;
QString outputFileName = QString();

if ( atlasMap->enabled() && mComposition->atlasMode() == QgsComposition::PreviewAtlas )
{
Expand Down
2 changes: 1 addition & 1 deletion src/app/nodetool/qgsvertexentry.h
Expand Up @@ -38,7 +38,7 @@ class QgsVertexEntry
QgsMapLayer *layer,
const QgsPoint &p,
QgsVertexId vertexId,
const QString &tooltip = QString::null,
const QString &tooltip = QString(),
QgsVertexMarker::IconType type = QgsVertexMarker::ICON_BOX,
int penWidth = 2 );
~QgsVertexEntry();
Expand Down
2 changes: 1 addition & 1 deletion src/app/ogr/qgsnewogrconnection.h
Expand Up @@ -31,7 +31,7 @@ class QgsNewOgrConnection : public QDialog, private Ui::QgsNewOgrConnectionBase

public:
//! Constructor
QgsNewOgrConnection( QWidget *parent = nullptr, const QString &connType = QString::null, const QString &connName = QString::null, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
QgsNewOgrConnection( QWidget *parent = nullptr, const QString &connType = QString(), const QString &connName = QString(), Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );

~QgsNewOgrConnection();
//! Tests the connection using the parameters supplied
Expand Down
2 changes: 1 addition & 1 deletion src/app/ogr/qgsopenvectorlayerdialog.cpp
Expand Up @@ -339,7 +339,7 @@ void QgsOpenVectorLayerDialog::accept()
pass = QInputDialog::getText( this,
tr( "Password for " ) + user,
tr( "Please enter your password:" ),
QLineEdit::Password, QString::null,
QLineEdit::Password, QString(),
&makeConnection );
}

Expand Down
18 changes: 9 additions & 9 deletions src/app/qgisapp.cpp
Expand Up @@ -536,7 +536,7 @@ void QgisApp::activeLayerChanged( QgsMapLayer *layer )
*/
void QgisApp::validateCrs( QgsCoordinateReferenceSystem &srs )
{
static QString sAuthId = QString::null;
static QString sAuthId = QString();
QgsSettings mySettings;
QString myDefaultProjectionOption = mySettings.value( QStringLiteral( "Projections/defaultBehavior" ), "prompt" ).toString();
if ( myDefaultProjectionOption == QLatin1String( "prompt" ) )
Expand Down Expand Up @@ -962,7 +962,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
QString caption = tr( "QGIS - %1 ('%2')" ).arg( Qgis::QGIS_VERSION, Qgis::QGIS_RELEASE_NAME );
setWindowTitle( caption );

QgsMessageLog::logMessage( tr( "QGIS starting..." ), QString::null, QgsMessageLog::INFO );
QgsMessageLog::logMessage( tr( "QGIS starting..." ), QString(), QgsMessageLog::INFO );

// set QGIS specific srs validation
connect( this, &QgisApp::customCrsValidation,
Expand Down Expand Up @@ -1081,9 +1081,9 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh

mSplash->showMessage( tr( "QGIS Ready!" ), Qt::AlignHCenter | Qt::AlignBottom );

QgsMessageLog::logMessage( QgsApplication::showSettings(), QString::null, QgsMessageLog::INFO );
QgsMessageLog::logMessage( QgsApplication::showSettings(), QString(), QgsMessageLog::INFO );

QgsMessageLog::logMessage( tr( "QGIS Ready!" ), QString::null, QgsMessageLog::INFO );
QgsMessageLog::logMessage( tr( "QGIS Ready!" ), QString(), QgsMessageLog::INFO );

mMapTipsVisible = false;
// This turns on the map tip if they where active in the last session
Expand Down Expand Up @@ -5206,7 +5206,7 @@ bool QgisApp::addProject( const QString &projectFile )
// does the project have any macros?
if ( mPythonUtils && mPythonUtils->isEnabled() )
{
if ( !QgsProject::instance()->readEntry( QStringLiteral( "Macros" ), QStringLiteral( "/pythonCode" ), QString::null ).isEmpty() )
if ( !QgsProject::instance()->readEntry( QStringLiteral( "Macros" ), QStringLiteral( "/pythonCode" ), QString() ).isEmpty() )
{
int enableMacros = settings.value( QStringLiteral( "qgis/enableMacros" ), 1 ).toInt();
// 0 = never, 1 = ask, 2 = just for this session, 3 = always
Expand Down Expand Up @@ -9336,7 +9336,7 @@ void QgisApp::loadPythonSupport()
// init python runner
QgsPythonRunner::setInstance( new QgsPythonRunnerImpl( mPythonUtils ) );

QgsMessageLog::logMessage( tr( "Python support ENABLED :-) " ), QString::null, QgsMessageLog::INFO );
QgsMessageLog::logMessage( tr( "Python support ENABLED :-) " ), QString(), QgsMessageLog::INFO );
}
#endif
}
Expand Down Expand Up @@ -11895,7 +11895,7 @@ void QgisApp::projectChanged( const QDomDocument &doc )
if ( !fi.exists() )
return;

static QString sPrevProjectDir = QString::null;
static QString sPrevProjectDir = QString();

if ( sPrevProjectDir == fi.canonicalPath() )
return;
Expand Down Expand Up @@ -12175,7 +12175,7 @@ void QgisApp::namAuthenticationRequired( QNetworkReply *inReply, QAuthenticator
QMutexLocker lock( QgsCredentials::instance()->mutex() );
QgsCredentials::instance()->put(
QStringLiteral( "%1 at %2" ).arg( auth->realm(), reply->url().host() ),
username, QString::null );
username, QString() );
}
}

Expand Down Expand Up @@ -12227,7 +12227,7 @@ void QgisApp::namProxyAuthenticationRequired( const QNetworkProxy &proxy, QAuthe
QMutexLocker lock( QgsCredentials::instance()->mutex() );
QgsCredentials::instance()->put(
QStringLiteral( "proxy %1:%2 [%3]" ).arg( proxy.hostName() ).arg( proxy.port() ).arg( auth->realm() ),
username, QString::null );
username, QString() );
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/app/qgisapp.h
Expand Up @@ -321,7 +321,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
/** Get a unique title from user for new and duplicate composers
* \param acceptEmpty whether to accept empty titles (one will be generated)
* \param currentTitle base name for initial title choice
* \returns QString::null if user cancels input dialog
* \returns QString() if user cancels input dialog
*/
bool uniqueComposerTitle( QWidget *parent, QString &composerTitle, bool acceptEmpty, const QString &currentTitle = QString() );
//! Creates a new composer and returns a pointer to it
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgscrashreport.cpp
Expand Up @@ -116,7 +116,7 @@ const QString QgsCrashReport::crashID() const
if ( mStackTrace.isEmpty() )
return "ID not generated due to missing information\n\n Your version of QGIS install might not have debug information included.";

QString data = QString::null;
QString data = QString();

// Hashes the full stack.
Q_FOREACH ( const QgsStackTrace::StackLine &line, mStackTrace )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgshandlebadlayers.cpp
Expand Up @@ -203,7 +203,7 @@ QString QgsHandleBadLayers::filename( int row )
return datasource;
}

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

void QgsHandleBadLayers::setFilename( int row, const QString &filename )
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsjoindialog.cpp
Expand Up @@ -114,7 +114,7 @@ QgsVectorLayerJoinInfo QgsJoinDialog::joinInfo() const
if ( mUseCustomPrefix->isChecked() )
info.setPrefix( mCustomPrefix->text() );
else
info.setPrefix( QString::null );
info.setPrefix( QString() );

if ( mUseJoinFieldsSubset->isChecked() )
{
Expand Down
10 changes: 5 additions & 5 deletions src/app/qgsmaptoolpinlabels.cpp
Expand Up @@ -381,12 +381,12 @@ bool QgsMapToolPinLabels::pinUnpinCurrentLabel( bool pin )
else
{
vlayer->beginEditCommand( tr( "Unpinned label" ) + QStringLiteral( " '%1'" ).arg( labelText ) );
writeFailed = !vlayer->changeAttributeValue( fid, xCol, QVariant( QString::null ) );
if ( !vlayer->changeAttributeValue( fid, yCol, QVariant( QString::null ) ) )
writeFailed = !vlayer->changeAttributeValue( fid, xCol, QVariant( QString() ) );
if ( !vlayer->changeAttributeValue( fid, yCol, QVariant( QString() ) ) )
writeFailed = true;
if ( hasRCol && !preserveRot )
{
if ( !vlayer->changeAttributeValue( fid, rCol, QVariant( QString::null ) ) )
if ( !vlayer->changeAttributeValue( fid, rCol, QVariant( QString() ) ) )
writeFailed = true;
}
vlayer->endEditCommand();
Expand Down Expand Up @@ -467,8 +467,8 @@ bool QgsMapToolPinLabels::pinUnpinCurrentDiagram( bool pin )
else
{
vlayer->beginEditCommand( tr( "Unpinned diagram" ) + QStringLiteral( " '%1'" ).arg( labelText ) );
writeFailed = !vlayer->changeAttributeValue( fid, xCol, QVariant( QString::null ) );
if ( !vlayer->changeAttributeValue( fid, yCol, QVariant( QString::null ) ) )
writeFailed = !vlayer->changeAttributeValue( fid, xCol, QVariant( QString() ) );
if ( !vlayer->changeAttributeValue( fid, yCol, QVariant( QString() ) ) )
writeFailed = true;
vlayer->endEditCommand();
}
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgsprojectproperties.cpp
Expand Up @@ -680,7 +680,7 @@ QgsProjectProperties::QgsProjectProperties( QgsMapCanvas *mapCanvas, QWidget *pa


// Project macros
QString pythonMacros = QgsProject::instance()->readEntry( QStringLiteral( "Macros" ), QStringLiteral( "/pythonCode" ), QString::null );
QString pythonMacros = QgsProject::instance()->readEntry( QStringLiteral( "Macros" ), QStringLiteral( "/pythonCode" ), QString() );
grpPythonMacros->setChecked( !pythonMacros.isEmpty() );
if ( !pythonMacros.isEmpty() )
{
Expand Down Expand Up @@ -1144,7 +1144,7 @@ void QgsProjectProperties::apply()
QString pythonMacros = ptePythonMacros->text();
if ( !grpPythonMacros->isChecked() || pythonMacros.isEmpty() )
{
pythonMacros = QString::null;
pythonMacros = QString();
resetPythonMacros();
}
QgsProject::instance()->writeEntry( QStringLiteral( "Macros" ), QStringLiteral( "/pythonCode" ), pythonMacros );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/auth/qgsauthimportidentitydialog.cpp
Expand Up @@ -367,7 +367,7 @@ bool QgsAuthImportIdentityDialog::validatePkiPkcs12()

// load the bundle
QCA::SecureArray passarray;
QString keypass = QString::null;
QString keypass = QString();
if ( !lePkiPkcs12KeyPass->text().isEmpty() )
{
passarray = QCA::SecureArray( lePkiPkcs12KeyPass->text().toUtf8() );
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -1569,7 +1569,7 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
rww->setShowLinkButton( relDef->showLinkButton() );
rww->setShowUnlinkButton( relDef->showUnlinkButton() );
mWidgets.append( rww );
newWidgetInfo.labelText = QString::null;
newWidgetInfo.labelText = QString();
newWidgetInfo.labelOnTop = true;
break;
}
Expand Down Expand Up @@ -1674,7 +1674,7 @@ QgsAttributeForm::WidgetInfo QgsAttributeForm::createWidgetFromDef( const QgsAtt
gbLayout->addWidget( spacer, ++row, 0 );
gbLayout->setRowStretch( row, 1 );

newWidgetInfo.labelText = QString::null;
newWidgetInfo.labelText = QString();
newWidgetInfo.labelOnTop = true;
break;
}
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgscredentialdialog.h
Expand Up @@ -57,7 +57,7 @@ class GUI_EXPORT QgsCredentialDialog : public QDialog, public QgsCredentials, pr
void on_chkbxEraseAuthDb_toggled( bool checked );

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/gui/qgsfilterlineedit.cpp
Expand Up @@ -174,7 +174,7 @@ void QgsFilterLineEdit::onTextChanged( const QString &text )
if ( isNull() )
{
setStyleSheet( QStringLiteral( "QLineEdit { font: italic; color: gray; } %1" ).arg( mStyleSheet ) );
emit valueChanged( QString::null );
emit valueChanged( QString() );
}
else
{
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsfilterlineedit.h
Expand Up @@ -68,7 +68,7 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
* \param parent parent widget
* \param nullValue string for representing null values
*/
QgsFilterLineEdit( QWidget *parent SIP_TRANSFERTHIS = 0, const QString &nullValue = QString::null );
QgsFilterLineEdit( QWidget *parent SIP_TRANSFERTHIS = 0, const QString &nullValue = QString() );

/** Returns true if the widget's clear button is visible.
* \see setShowClearButton()
Expand Down Expand Up @@ -160,7 +160,7 @@ class GUI_EXPORT QgsFilterLineEdit : public QLineEdit
* \returns Current text (or null string if it matches the nullValue() property )
* \see setValue()
*/
QString value() const { return isNull() ? QString::null : text(); }
QString value() const { return isNull() ? QString() : text(); }

/**
* Determine if the current text represents null.
Expand Down
4 changes: 2 additions & 2 deletions src/gui/qgsguiutils.cpp
Expand Up @@ -132,7 +132,7 @@ namespace QgsGuiUtils

if ( !outputFileName.isNull() )
{
ext = filterMap.value( selectedFilter, QString::null );
ext = filterMap.value( selectedFilter, QString() );
if ( !ext.isNull() )
settings.setValue( QStringLiteral( "UI/lastSaveAsImageFilter" ), selectedFilter );
settings.setValue( QStringLiteral( "UI/lastSaveAsImageDir" ), QFileInfo( outputFileName ).absolutePath() );
Expand Down Expand Up @@ -160,7 +160,7 @@ namespace QgsGuiUtils

selectedFilter = fileDialog->selectedFilter();
QgsDebugMsg( "Selected filter: " + selectedFilter );
ext = filterMap.value( selectedFilter, QString::null );
ext = filterMap.value( selectedFilter, QString() );

if ( !ext.isNull() )
settings.setValue( "/UI/lastSaveAsImageFilter", selectedFilter );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsguiutils.h
Expand Up @@ -100,7 +100,7 @@ namespace QgsGuiUtils
* \returns QPair<QString, QString> where first is the file name and second is
* the file type
*/
QPair<QString, QString> GUI_EXPORT getSaveAsImageName( QWidget *parent, const QString &message, const QString &defaultFilename = QString::null );
QPair<QString, QString> GUI_EXPORT getSaveAsImageName( QWidget *parent, const QString &message, const QString &defaultFilename = QString() );

/**
Convenience function for readily creating file filters.
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsmessagebar.h
Expand Up @@ -88,7 +88,7 @@ class GUI_EXPORT QgsMessageBar: public QFrame
static QgsMessageBarItem *createMessage( QWidget *widget, QWidget *parent = nullptr ) SIP_FACTORY;

//! convenience method for pushing a message to the bar
void pushMessage( const QString &text, MessageLevel level = INFO, int duration = 5 ) { return pushMessage( QString::null, text, level, duration ); }
void pushMessage( const QString &text, MessageLevel level = INFO, int duration = 5 ) { return pushMessage( QString(), text, level, duration ); }
//! convenience method for pushing a message with title to the bar
void pushMessage( const QString &title, const QString &text, MessageLevel level = INFO, int duration = 5 );

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsnewhttpconnection.h
Expand Up @@ -33,7 +33,7 @@ class GUI_EXPORT QgsNewHttpConnection : public QDialog, private Ui::QgsNewHttpCo

public:
//! Constructor
QgsNewHttpConnection( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &baseKey = "qgis/connections-wms/", const QString &connName = QString::null, Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );
QgsNewHttpConnection( QWidget *parent SIP_TRANSFERTHIS = nullptr, const QString &baseKey = "qgis/connections-wms/", const QString &connName = QString(), Qt::WindowFlags fl = QgsGuiUtils::ModalDialogFlags );

public slots:
// Saves the connection to ~/.qt/qgisrc
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsnewnamedialog.h
Expand Up @@ -43,7 +43,7 @@ class GUI_EXPORT QgsNewNameDialog : public QgsDialog
* \param parent
* \param flags
*/
QgsNewNameDialog( const QString &source = QString::null, const QString &initial = QString::null,
QgsNewNameDialog( const QString &source = QString(), const QString &initial = QString(),
const QStringList &extensions = QStringList(), const QStringList &existing = QStringList(),
const QRegExp &regexp = QRegExp(), Qt::CaseSensitivity cs = Qt::CaseSensitive,
QWidget *parent SIP_TRANSFERTHIS = nullptr, Qt::WindowFlags flags = QgsGuiUtils::ModalDialogFlags );
Expand Down
6 changes: 3 additions & 3 deletions src/gui/qgsnewvectorlayerdialog.cpp
Expand Up @@ -283,19 +283,19 @@ QString QgsNewVectorLayerDialog::runAndCreateLayer( QWidget *parent, QString *pE
QgsCoordinateReferenceSystem srs = geomDialog.crs();
if ( !createEmptyDataSource( fileName, fileformat, enc, geometrytype, attributes, srs ) )
{
return QString::null;
return QString();
}
}
else
{
QgsDebugMsg( "geometry type not recognised" );
return QString::null;
return QString();
}
}
else
{
QgsDebugMsg( "Resolving newEmptyDataSource(...) failed" );
return QString::null;
return QString();
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsnewvectorlayerdialog.h
Expand Up @@ -35,7 +35,7 @@ class GUI_EXPORT QgsNewVectorLayerDialog: public QDialog, private Ui::QgsNewVect

/**
* Runs the dialog and creates a layer matching the dialog parameters.
* \returns fileName on success, empty string use aborted, QString::null if creation failed
* \returns fileName on success, empty string use aborted, QString() if creation failed
*/
static QString runAndCreateLayer( QWidget *parent = nullptr, QString *enc = nullptr, const QgsCoordinateReferenceSystem &crs = QgsCoordinateReferenceSystem() );

Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsprojectionselectiontreewidget.cpp
Expand Up @@ -267,7 +267,7 @@ QString QgsProjectionSelectionTreeWidget::selectedName()
{
// return the selected wkt name from the list view
QTreeWidgetItem *lvi = lstCoordinateSystems->currentItem();
return lvi ? lvi->text( NameColumn ) : QString::null;
return lvi ? lvi->text( NameColumn ) : QString();
}

void QgsProjectionSelectionTreeWidget::setCrs( const QgsCoordinateReferenceSystem &crs )
Expand Down

0 comments on commit cb1f98f

Please sign in to comment.