Skip to content

Commit b3e3bcd

Browse files
committedNov 20, 2017
Modernize code (remove "on" from slots)
1 parent 4272f5d commit b3e3bcd

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed
 

‎src/providers/virtual/qgsvirtuallayersourceselect.cpp

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,12 +43,12 @@ QgsVirtualLayerSourceSelect::QgsVirtualLayerSourceSelect( QWidget *parent, Qt::W
4343
setupUi( this );
4444
setupButtons( buttonBox );
4545

46-
connect( mTestButton, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::onTestQuery );
47-
connect( mBrowseCRSBtn, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::onBrowseCRS );
48-
connect( mAddLayerBtn, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::onAddLayer );
49-
connect( mRemoveLayerBtn, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::onRemoveLayer );
50-
connect( mImportLayerBtn, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::onImportLayer );
51-
connect( mLayersTable->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &QgsVirtualLayerSourceSelect::onTableRowChanged );
46+
connect( mTestButton, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::testQuery );
47+
connect( mBrowseCRSBtn, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::browseCRS );
48+
connect( mAddLayerBtn, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::addLayer );
49+
connect( mRemoveLayerBtn, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::removeLayer );
50+
connect( mImportLayerBtn, &QAbstractButton::clicked, this, &QgsVirtualLayerSourceSelect::importLayer );
51+
connect( mLayersTable->selectionModel(), &QItemSelectionModel::currentRowChanged, this, &QgsVirtualLayerSourceSelect::tableRowChanged );
5252

5353
// prepare provider list
5454
Q_FOREACH ( const QString &pk, QgsProviderRegistry::instance()->providerList() )
@@ -72,8 +72,8 @@ QgsVirtualLayerSourceSelect::QgsVirtualLayerSourceSelect( QWidget *parent, Qt::W
7272
}
7373
}
7474
updateLayersList();
75-
connect( mLayerNameCombo, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsVirtualLayerSourceSelect::onLayerComboChanged );
76-
onLayerComboChanged( mLayerNameCombo->currentIndex() );
75+
connect( mLayerNameCombo, static_cast<void ( QComboBox::* )( int )>( &QComboBox::currentIndexChanged ), this, &QgsVirtualLayerSourceSelect::layerComboChanged );
76+
layerComboChanged( mLayerNameCombo->currentIndex() );
7777

7878
// Prepare embedded layer selection dialog and
7979
// connect to model changes in the treeview
@@ -97,7 +97,7 @@ void QgsVirtualLayerSourceSelect::refresh()
9797
updateLayersList();
9898
}
9999

100-
void QgsVirtualLayerSourceSelect::onLayerComboChanged( int idx )
100+
void QgsVirtualLayerSourceSelect::layerComboChanged( int idx )
101101
{
102102
if ( idx == -1 )
103103
return;
@@ -145,7 +145,7 @@ void QgsVirtualLayerSourceSelect::onLayerComboChanged( int idx )
145145
}
146146
}
147147

148-
void QgsVirtualLayerSourceSelect::onBrowseCRS()
148+
void QgsVirtualLayerSourceSelect::browseCRS()
149149
{
150150
QgsProjectionSelectionDialog crsSelector( this );
151151
QgsCoordinateReferenceSystem crs( mSrid );
@@ -196,7 +196,7 @@ QgsVirtualLayerDefinition QgsVirtualLayerSourceSelect::getVirtualLayerDef()
196196
return def;
197197
}
198198

199-
void QgsVirtualLayerSourceSelect::onTestQuery()
199+
void QgsVirtualLayerSourceSelect::testQuery()
200200
{
201201
QgsVirtualLayerDefinition def = getVirtualLayerDef();
202202
// If the definition is empty just do nothing.
@@ -216,7 +216,7 @@ void QgsVirtualLayerSourceSelect::onTestQuery()
216216
}
217217
}
218218

219-
void QgsVirtualLayerSourceSelect::onAddLayer()
219+
void QgsVirtualLayerSourceSelect::addLayer()
220220
{
221221
mLayersTable->insertRow( mLayersTable->rowCount() );
222222

@@ -234,14 +234,14 @@ void QgsVirtualLayerSourceSelect::onAddLayer()
234234
mLayersTable->setCellWidget( mLayersTable->rowCount() - 1, 2, encodingCombo );
235235
}
236236

237-
void QgsVirtualLayerSourceSelect::onRemoveLayer()
237+
void QgsVirtualLayerSourceSelect::removeLayer()
238238
{
239239
int currentRow = mLayersTable->selectionModel()->currentIndex().row();
240240
if ( currentRow != -1 )
241241
mLayersTable->removeRow( currentRow );
242242
}
243243

244-
void QgsVirtualLayerSourceSelect::onTableRowChanged( const QModelIndex &current, const QModelIndex &previous )
244+
void QgsVirtualLayerSourceSelect::tableRowChanged( const QModelIndex &current, const QModelIndex &previous )
245245
{
246246
Q_UNUSED( previous );
247247
mRemoveLayerBtn->setEnabled( current.row() != -1 );
@@ -321,7 +321,7 @@ void QgsVirtualLayerSourceSelect::updateLayersList()
321321
void QgsVirtualLayerSourceSelect::addEmbeddedLayer( const QString &name, const QString &provider, const QString &encoding, const QString &source )
322322
{
323323
// insert a new row
324-
onAddLayer();
324+
addLayer();
325325
const int n = mLayersTable->rowCount() - 1;
326326
// local name
327327
mLayersTable->item( n, 0 )->setText( name );
@@ -335,7 +335,7 @@ void QgsVirtualLayerSourceSelect::addEmbeddedLayer( const QString &name, const Q
335335
encodingCombo->setCurrentIndex( encodingCombo->findText( encoding ) );
336336
}
337337

338-
void QgsVirtualLayerSourceSelect::onImportLayer()
338+
void QgsVirtualLayerSourceSelect::importLayer()
339339
{
340340
if ( mEmbeddedSelectionDialog && mEmbeddedSelectionDialog->exec() == QDialog::Accepted )
341341
{

‎src/providers/virtual/qgsvirtuallayersourceselect.h

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,13 @@ class QgsVirtualLayerSourceSelect : public QgsAbstractDataSourceWidget, private
4444
void addButtonClicked() override;
4545

4646
private slots:
47-
void onTestQuery();
48-
void onBrowseCRS();
49-
void onLayerComboChanged( int );
50-
void onAddLayer();
51-
void onRemoveLayer();
52-
void onImportLayer();
53-
void onTableRowChanged( const QModelIndex &current, const QModelIndex &previous );
47+
void testQuery();
48+
void browseCRS();
49+
void layerComboChanged( int );
50+
void addLayer();
51+
void removeLayer();
52+
void importLayer();
53+
void tableRowChanged( const QModelIndex &current, const QModelIndex &previous );
5454
void updateLayersList();
5555

5656

0 commit comments

Comments
 (0)
Please sign in to comment.