Skip to content

Commit 94badce

Browse files
committed
Avoid use of QString("")
1 parent 1412426 commit 94badce

32 files changed

+58
-62
lines changed

python/gui/qgisinterface.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,15 +179,15 @@ class QgisInterface : QObject
179179
* @return pointer to composer's view
180180
* @note new composer window will be shown and activated
181181
*/
182-
virtual QgsComposerView* createNewComposer( QString title = QString( "" ) ) = 0;
182+
virtual QgsComposerView* createNewComposer( QString title = QString() ) = 0;
183183

184184
/** Duplicate an existing parent composer from composer view
185185
* @param composerView pointer to existing composer view
186186
* @param title window title for duplicated composer (one will be generated if empty)
187187
* @return pointer to duplicate composer's view
188188
* @note dupicate composer window will be hidden until loaded, then shown and activated
189189
*/
190-
virtual QgsComposerView* duplicateComposer( QgsComposerView* composerView, QString title = QString( "" ) ) = 0;
190+
virtual QgsComposerView* duplicateComposer( QgsComposerView* composerView, QString title = QString() ) = 0;
191191

192192
/** Deletes parent composer of composer view, after closing composer window */
193193
virtual void deleteComposer( QgsComposerView* composerView ) = 0;

python/gui/qgsdatadefinedbutton.sip

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ class QgsDataDefinedButton : QToolButton
4646
const QgsVectorLayer* vl = 0,
4747
const QgsDataDefined* datadefined = 0,
4848
DataTypes datatypes = AnyType,
49-
QString description = "" );
49+
QString description = QString() );
5050
~QgsDataDefinedButton();
5151

5252
/**
@@ -60,7 +60,7 @@ class QgsDataDefinedButton : QToolButton
6060
void init( const QgsVectorLayer* vl,
6161
const QgsDataDefined* datadefined = 0,
6262
DataTypes datatypes = AnyType,
63-
QString description = QString( "" ) );
63+
QString description = QString() );
6464

6565
QMap< QString, QString > definedProperty() const;
6666

src/app/composer/qgscomposermanager.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ QgsComposerManager::QgsComposerManager( QWidget * parent, Qt::WindowFlags f ): Q
9696
}
9797
}
9898

99-
mTemplatePathLineEdit->setText( settings.value( "/UI/ComposerManager/templatePath", QString( "" ) ).toString() );
99+
mTemplatePathLineEdit->setText( settings.value( "/UI/ComposerManager/templatePath", QString() ).toString() );
100100

101101
refreshComposers();
102102
}

src/app/qgisapp.cpp

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5736,13 +5736,12 @@ QString QgisApp::uniqueComposerTitle( QWidget* parent, bool acceptEmpty, const Q
57365736
}
57375737
else
57385738
{
5739-
newTitle = QString( "" );
57405739
titleValid = true;
57415740
}
57425741
}
57435742
else if ( cNames.indexOf( newTitle, 1 ) >= 0 )
57445743
{
5745-
cNames[0] = QString( "" ); // clear non-unique name
5744+
cNames[0] = QString(); // clear non-unique name
57465745
titleMsg = chooseMsg + "\n\n" + tr( "Title already exists!" );
57475746
}
57485747
else
@@ -7400,7 +7399,7 @@ void QgisApp::duplicateLayers( QList<QgsMapLayer *> lyrList )
74007399
foreach ( QgsMapLayer * selectedLyr, selectedLyrs )
74017400
{
74027401
dupLayer = 0;
7403-
unSppType = QString( "" );
7402+
unSppType.clear();
74047403
layerDupName = selectedLyr->name() + " " + tr( "copy" );
74057404

74067405
if ( selectedLyr->type() == QgsMapLayer::PluginLayer )
@@ -10212,7 +10211,7 @@ void QgisApp::oldProjectVersionWarning( QString oldVersion )
1021210211
.replace( QString( "<p>" ), QString( "\n\n" ) )
1021310212
.replace( QString( "<br>" ), QString( "\n" ) )
1021410213
.replace( QString( "<a href=\"http://hub.qgis.org/projects/quantum-gis\">http://hub.qgis.org/projects/quantum-gis</a> " ), QString( "\nhttp://hub.qgis.org/projects/quantum-gis" ) )
10215-
.replace( QRegExp( "</?tt>" ), QString( "" ) )
10214+
.replace( QRegExp( "</?tt>" ), QString() )
1021610215
);
1021710216
box.exec();
1021810217
#else

src/app/qgisapp.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -256,14 +256,14 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
256256
* @param currentTitle base name for initial title choice
257257
* @return QString::null if user cancels input dialog
258258
*/
259-
QString uniqueComposerTitle( QWidget *parent, bool acceptEmpty, const QString& currentTitle = QString( "" ) );
259+
QString uniqueComposerTitle( QWidget *parent, bool acceptEmpty, const QString& currentTitle = QString() );
260260
/** Creates a new composer and returns a pointer to it*/
261-
QgsComposer* createNewComposer( QString title = QString( "" ) );
261+
QgsComposer* createNewComposer( QString title = QString() );
262262
/** Deletes a composer and removes entry from Set*/
263263
void deleteComposer( QgsComposer *c );
264264
/** Duplicates a composer and adds it to Set
265265
*/
266-
QgsComposer *duplicateComposer( QgsComposer *currentComposer, QString title = QString( "" ) );
266+
QgsComposer *duplicateComposer( QgsComposer *currentComposer, QString title = QString() );
267267

268268
/** Overloaded function used to sort menu entries alphabetically */
269269
QMenu* createPopupMenu() override;

src/app/qgisappinterface.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
196196
* @return pointer to composer's view
197197
* @note new composer window will be shown and activated
198198
*/
199-
QgsComposerView* createNewComposer( QString title = QString( "" ) ) override;
199+
QgsComposerView* createNewComposer( QString title = QString() ) override;
200200

201201
// ### QGIS 3: return QgsComposer*, not QgsComposerView*
202202
/** Duplicate an existing parent composer from composer view
@@ -205,7 +205,7 @@ class APP_EXPORT QgisAppInterface : public QgisInterface
205205
* @return pointer to duplicate composer's view
206206
* @note dupicate composer window will be hidden until loaded, then shown and activated
207207
*/
208-
QgsComposerView* duplicateComposer( QgsComposerView* composerView, QString title = QString( "" ) ) override;
208+
QgsComposerView* duplicateComposer( QgsComposerView* composerView, QString title = QString() ) override;
209209

210210
/** Deletes parent composer of composer view, after closing composer window */
211211
void deleteComposer( QgsComposerView* composerView ) override;

src/app/qgisappstylesheet.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,8 +99,7 @@ QMap<QString, QVariant> QgisAppStyleSheet::defaultOptions()
9999

100100
void QgisAppStyleSheet::buildStyleSheet( const QMap<QString, QVariant>& opts )
101101
{
102-
QString ss = QString( "" );
103-
102+
QString ss;
104103

105104
// QgisApp-wide font
106105
QString fontSize = opts.value( "fontPointSize" ).toString();

src/app/qgsdecorationgrid.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ void QgsDecorationGrid::saveToProject()
191191
}
192192
if ( mMarkerSymbol )
193193
{
194-
doc.setContent( QString( "" ) );
194+
doc.setContent( QString() );
195195
elem = QgsSymbolLayerV2Utils::saveSymbol( "marker symbol", mMarkerSymbol, doc );
196196
doc.appendChild( elem );
197197
QgsProject::instance()->writeEntry( mNameConfig, "/MarkerSymbol", doc.toString() );

src/app/qgsmaptoolrotatefeature.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ QgsAngleMagnetWidget::QgsAngleMagnetWidget( QString label , QWidget *parent )
4646
//mLayout->setAlignment( Qt::AlignLeft );
4747
setLayout( mLayout );
4848

49-
if ( !label.isNull() )
49+
if ( !label.isEmpty() )
5050
{
5151
QLabel* lbl = new QLabel( label, this );
5252
lbl->setAlignment( Qt::AlignRight | Qt::AlignCenter );

src/app/qgsmaptoolrotatefeature.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ class APP_EXPORT QgsAngleMagnetWidget : public QWidget
3333

3434
public:
3535

36-
explicit QgsAngleMagnetWidget( QString label = QString( "" ), QWidget *parent = 0 );
36+
explicit QgsAngleMagnetWidget( QString label = QString(), QWidget *parent = 0 );
3737

3838
~QgsAngleMagnetWidget();
3939

0 commit comments

Comments
 (0)