Skip to content
Permalink
Browse files

More old style connect removal

  • Loading branch information
nyalldawson committed Nov 5, 2018
1 parent 7b24bd3 commit 0ea86bf0a5934c192a79f5921d0c23df53972159
@@ -1655,7 +1655,7 @@ void QgsPluginManager::showEvent( QShowEvent *e )
}
else
{
QTimer::singleShot( 0, this, SLOT( warnAboutMissingObjects() ) );
QTimer::singleShot( 0, this, &QgsPluginManager::warnAboutMissingObjects );
}

QgsOptionsDialogBase::showEvent( e );
@@ -112,22 +112,22 @@ QgsRasterLayerProperties::QgsRasterLayerProperties( QgsMapLayer *lyr, QgsMapCanv

mBtnStyle = new QPushButton( tr( "Style" ) );
QMenu *menuStyle = new QMenu( this );
menuStyle->addAction( tr( "Load Style…" ), this, SLOT( loadStyle_clicked() ) );
menuStyle->addAction( tr( "Save Style…" ), this, SLOT( saveStyleAs_clicked() ) );
menuStyle->addAction( tr( "Load Style…" ), this, &QgsRasterLayerProperties::loadStyle_clicked );
menuStyle->addAction( tr( "Save Style…" ), this, &QgsRasterLayerProperties::saveStyleAs_clicked );
menuStyle->addSeparator();
menuStyle->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
menuStyle->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultStyle_clicked() ) );
menuStyle->addAction( tr( "Save as Default" ), this, &QgsRasterLayerProperties::saveDefaultStyle_clicked );
menuStyle->addAction( tr( "Restore Default" ), this, &QgsRasterLayerProperties::loadDefaultStyle_clicked );
mBtnStyle->setMenu( menuStyle );
connect( menuStyle, &QMenu::aboutToShow, this, &QgsRasterLayerProperties::aboutToShowStyleMenu );
buttonBox->addButton( mBtnStyle, QDialogButtonBox::ResetRole );

mBtnMetadata = new QPushButton( tr( "Metadata" ), this );
QMenu *menuMetadata = new QMenu( this );
mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata…" ), this, SLOT( loadMetadata() ) );
mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata…" ), this, SLOT( saveMetadataAs() ) );
mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata…" ), this, &QgsRasterLayerProperties::loadMetadata );
mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata…" ), this, &QgsRasterLayerProperties::saveMetadataAs );
menuMetadata->addSeparator();
menuMetadata->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultMetadata() ) );
menuMetadata->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultMetadata() ) );
menuMetadata->addAction( tr( "Save as Default" ), this, &QgsRasterLayerProperties::saveDefaultMetadata );
menuMetadata->addAction( tr( "Restore Default" ), this, &QgsRasterLayerProperties::loadDefaultMetadata );
mBtnMetadata->setMenu( menuMetadata );
buttonBox->addButton( mBtnMetadata, QDialogButtonBox::ResetRole );

@@ -127,19 +127,19 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
mActionSaveStyle = menuStyle->addAction( tr( "Save Style…" ) );
connect( mActionSaveStyle, &QAction::triggered, this, &QgsVectorLayerProperties::saveStyleAs );
menuStyle->addSeparator();
menuStyle->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultStyle_clicked() ) );
menuStyle->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultStyle_clicked() ) );
menuStyle->addAction( tr( "Save as Default" ), this, &QgsVectorLayerProperties::saveDefaultStyle_clicked );
menuStyle->addAction( tr( "Restore Default" ), this, &QgsVectorLayerProperties::loadDefaultStyle_clicked );
mBtnStyle->setMenu( menuStyle );
connect( menuStyle, &QMenu::aboutToShow, this, &QgsVectorLayerProperties::aboutToShowStyleMenu );
buttonBox->addButton( mBtnStyle, QDialogButtonBox::ResetRole );

mBtnMetadata = new QPushButton( tr( "Metadata" ), this );
QMenu *menuMetadata = new QMenu( this );
mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata…" ), this, SLOT( loadMetadata() ) );
mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata…" ), this, SLOT( saveMetadataAs() ) );
mActionLoadMetadata = menuMetadata->addAction( tr( "Load Metadata…" ), this, &QgsVectorLayerProperties::loadMetadata );
mActionSaveMetadataAs = menuMetadata->addAction( tr( "Save Metadata…" ), this, &QgsVectorLayerProperties::saveMetadataAs );
menuMetadata->addSeparator();
menuMetadata->addAction( tr( "Save as Default" ), this, SLOT( saveDefaultMetadata() ) );
menuMetadata->addAction( tr( "Restore Default" ), this, SLOT( loadDefaultMetadata() ) );
menuMetadata->addAction( tr( "Save as Default" ), this, &QgsVectorLayerProperties::saveDefaultMetadata );
menuMetadata->addAction( tr( "Restore Default" ), this, &QgsVectorLayerProperties::loadDefaultMetadata );
mBtnMetadata->setMenu( menuMetadata );
buttonBox->addButton( mBtnMetadata, QDialogButtonBox::ResetRole );

@@ -845,7 +845,7 @@ const QString QgsAuthManager::uniqueConfigId() const
int len = 7;
// sleep just a bit to make sure the current time has changed
QEventLoop loop;
QTimer::singleShot( 3, &loop, SLOT( quit() ) );
QTimer::singleShot( 3, &loop, &QEventLoop::quit );
loop.exec();

uint seed = static_cast< uint >( QTime::currentTime().msec() );
@@ -969,7 +969,7 @@ void QgsDirectoryItem::directoryChanged()
// this happens when a new file appears in the directory and
// the item's children thread will try to open the file with
// GDAL or OGR even if it is still being written.
QTimer::singleShot( 100, this, SLOT( refresh() ) );
QTimer::singleShot( 100, this, [ = ] { refresh(); } );
}
}

@@ -1124,7 +1124,7 @@ void QgsDirectoryParamWidget::mousePressEvent( QMouseEvent *event )
labels << tr( "Name" ) << tr( "Size" ) << tr( "Date" ) << tr( "Permissions" ) << tr( "Owner" ) << tr( "Group" ) << tr( "Type" );
for ( int i = 0; i < labels.count(); i++ )
{
QAction *action = popupMenu.addAction( labels[i], this, SLOT( showHideColumn() ) );
QAction *action = popupMenu.addAction( labels[i], this, &QgsDirectoryParamWidget::showHideColumn );
action->setObjectName( QString::number( i ) );
action->setCheckable( true );
action->setChecked( !isColumnHidden( i ) );
@@ -117,7 +117,7 @@ void QgsTransactionGroup::onCommitChanges()
{
emit commitError( errMsg );
// Restart editing the calling layer in the next event loop cycle
QTimer::singleShot( 0, triggeringLayer, SLOT( startEditing() ) );
QTimer::singleShot( 0, triggeringLayer, &QgsVectorLayer::startEditing );
}
mEditingStopping = false;
}
@@ -144,7 +144,7 @@ void QgsTransactionGroup::onRollback()
else
{
// Restart editing the calling layer in the next event loop cycle
QTimer::singleShot( 0, triggeringLayer, SLOT( startEditing() ) );
QTimer::singleShot( 0, triggeringLayer, &QgsVectorLayer::startEditing );
}
mEditingStopping = false;
}

0 comments on commit 0ea86bf

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