summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Vrátil <dvratil@kde.org>2016-10-12 16:31:56 (GMT)
committerDaniel Vrátil <dvratil@kde.org>2016-10-12 17:26:10 (GMT)
commita0ccf4fc33ff90409ae182739fe3d819131574a7 (patch)
treea88df8b90524fb8f1703d6f6b4dd5594a263a0dd
parentb222e4591be27a8ba840ed985ffc473d9f54d580 (diff)
Port to new connect() syntax where possible
-rw-r--r--src/kleo/defaultkeygenerationjob.cpp9
-rw-r--r--src/models/keycache.cpp26
-rw-r--r--src/models/keycache.h2
-rw-r--r--src/models/keycache_p.h3
-rw-r--r--src/models/keylistmodel.cpp7
-rw-r--r--src/tests/test_keygen.cpp3
-rw-r--r--src/tests/test_keylister.cpp8
-rw-r--r--src/tests/test_keyselectioncombo.cpp10
-rw-r--r--src/ui/cryptoconfigmodule.cpp12
-rw-r--r--src/ui/directoryserviceswidget.cpp9
-rw-r--r--src/ui/dnattributeorderconfigwidget.cpp16
-rw-r--r--src/ui/keylistview.h1
-rw-r--r--src/ui/keyselectioncombo.cpp30
-rw-r--r--src/ui/keyselectiondialog.cpp43
14 files changed, 68 insertions, 111 deletions
diff --git a/src/kleo/defaultkeygenerationjob.cpp b/src/kleo/defaultkeygenerationjob.cpp
index ae83989..29d75d3 100644
--- a/src/kleo/defaultkeygenerationjob.cpp
+++ b/src/kleo/defaultkeygenerationjob.cpp
@@ -103,12 +103,9 @@ GpgME::Error DefaultKeyGenerationJob::start(const QString &email, const QString
d->job = QGpgME::openpgp()->keyGenerationJob();
d->job->installEventFilter(this);
- connect(d->job.data(), &QGpgME::KeyGenerationJob::result,
- this, &DefaultKeyGenerationJob::result);
- connect(d->job.data(), &QGpgME::KeyGenerationJob::done,
- this, &DefaultKeyGenerationJob::done);
- connect(d->job.data(), &QGpgME::KeyGenerationJob::done,
- this, &QObject::deleteLater);
+ connect(d->job.data(), &QGpgME::KeyGenerationJob::result, this, &DefaultKeyGenerationJob::result);
+ connect(d->job.data(), &QGpgME::KeyGenerationJob::done, this, &DefaultKeyGenerationJob::done);
+ connect(d->job.data(), &QGpgME::KeyGenerationJob::done, this, &QObject::deleteLater);
return d->job->start(args);
}
diff --git a/src/models/keycache.cpp b/src/models/keycache.cpp
index 7a9d20d..21b9677 100644
--- a/src/models/keycache.cpp
+++ b/src/models/keycache.cpp
@@ -90,7 +90,7 @@ class KeyCache::Private
public:
explicit Private(KeyCache *qq) : q(qq), m_refreshInterval(1), m_initalized(false)
{
- connect(&m_autoKeyListingTimer, SIGNAL(timeout()), q, SLOT(startKeyListing()));
+ connect(&m_autoKeyListingTimer, &QTimer::timeout, q, [this]() { q->startKeyListing(); });
updateAutoKeyListingTimer();
}
@@ -255,7 +255,10 @@ void KeyCache::reload(GpgME::Protocol /*proto*/)
enableFileSystemWatcher(false);
d->m_refreshJob = new RefreshKeysJob(this);
- connect(d->m_refreshJob, SIGNAL(done(GpgME::KeyListResult)), this, SLOT(refreshJobDone(GpgME::KeyListResult)));
+ connect(d->m_refreshJob, &RefreshKeysJob::done,
+ this, [this](const GpgME::KeyListResult &r) {
+ d->refreshJobDone(r);
+ });
d->m_refreshJob->start();
}
@@ -273,10 +276,10 @@ void KeyCache::addFileSystemWatcher(const std::shared_ptr<FileSystemWatcher> &wa
return;
}
d->m_fsWatchers.push_back(watcher);
- connect(watcher.get(), SIGNAL(directoryChanged(QString)),
- this, SLOT(startKeyListing()));
- connect(watcher.get(), SIGNAL(fileChanged(QString)),
- this, SLOT(startKeyListing()));
+ connect(watcher.get(), &FileSystemWatcher::directoryChanged,
+ this, [this]() { startKeyListing(); });
+ connect(watcher.get(), &FileSystemWatcher::fileChanged,
+ this, [this]() { startKeyListing(); });
watcher->setEnabled(d->m_refreshJob == 0);
}
@@ -1004,7 +1007,7 @@ KeyCache::RefreshKeysJob::~RefreshKeysJob() {}
void KeyCache::RefreshKeysJob::start()
{
- QTimer::singleShot(0, this, SLOT(doStart()));
+ QTimer::singleShot(0, this, [this](){ d->doStart(); });
}
void KeyCache::RefreshKeysJob::cancel()
@@ -1049,11 +1052,12 @@ Error KeyCache::RefreshKeysJob::Private::startKeyListing(GpgME::Protocol proto)
if (!job) {
return Error();
}
- connect(job, SIGNAL(result(GpgME::KeyListResult,std::vector<GpgME::Key>)),
- q, SLOT(listAllKeysJobDone(GpgME::KeyListResult,std::vector<GpgME::Key>)));
+ connect(job, &QGpgME::ListAllKeysJob::result,
+ q, [this](const GpgME::KeyListResult &res, const std::vector<GpgME::Key> &keys) {
+ listAllKeysJobDone(res, keys);
+ });
- connect(q, &RefreshKeysJob::canceled,
- job, &QGpgME::Job::slotCancel);
+ connect(q, &RefreshKeysJob::canceled, job, &QGpgME::Job::slotCancel);
const Error error = job->start(true);
diff --git a/src/models/keycache.h b/src/models/keycache.h
index 6f9b535..25b2bf9 100644
--- a/src/models/keycache.h
+++ b/src/models/keycache.h
@@ -155,8 +155,6 @@ private:
class Private;
QScopedPointer<Private> const d;
-
- Q_PRIVATE_SLOT(d, void refreshJobDone(GpgME::KeyListResult))
};
}
diff --git a/src/models/keycache_p.h b/src/models/keycache_p.h
index f17a792..51958af 100644
--- a/src/models/keycache_p.h
+++ b/src/models/keycache_p.h
@@ -62,9 +62,6 @@ private:
class Private;
friend class Private;
Private * const d;
-
- Q_PRIVATE_SLOT(d, void listAllKeysJobDone(GpgME::KeyListResult, std::vector<GpgME::Key>))
- Q_PRIVATE_SLOT(d, void doStart())
};
}
diff --git a/src/models/keylistmodel.cpp b/src/models/keylistmodel.cpp
index 305ae49..d514621 100644
--- a/src/models/keylistmodel.cpp
+++ b/src/models/keylistmodel.cpp
@@ -964,12 +964,7 @@ void AbstractKeyListModel::useKeyCache(bool value, bool secretOnly)
} else {
setKeys(std::vector<Key>());
}
- connect(KeyCache::instance().get(), &KeyCache::keysMayHaveChanged,
- this, [this] {
- if (d->m_useKeyCache) {
- setKeys(d->m_secretOnly ? KeyCache::instance()->secretKeys() : KeyCache::instance()->keys());
- }
- });
+ connect(KeyCache::instance().get(), &KeyCache::keysMayHaveChanged, this, [this] { if (d->m_useKeyCache) { setKeys(d->m_secretOnly ? KeyCache::instance()->secretKeys() : KeyCache::instance()->keys()); } });
}
// static
diff --git a/src/tests/test_keygen.cpp b/src/tests/test_keygen.cpp
index 0606b2b..33c2d5a 100644
--- a/src/tests/test_keygen.cpp
+++ b/src/tests/test_keygen.cpp
@@ -133,8 +133,7 @@ void KeyGenerator::slotStartKeyGeneration()
QGpgME::KeyGenerationJob *job = proto->keyGenerationJob();
Q_ASSERT(job);
- connect(job, SIGNAL(result(GpgME::KeyGenerationResult,QByteArray)),
- SLOT(slotResult(GpgME::KeyGenerationResult,QByteArray)));
+ connect(job, &QGpgME::KeyGenerationJob::result, this, &KeyGenerator::slotResult);
const GpgME::Error err = job->start(params);
if (err) {
diff --git a/src/tests/test_keylister.cpp b/src/tests/test_keylister.cpp
index 784a07d..64ce31a 100644
--- a/src/tests/test_keylister.cpp
+++ b/src/tests/test_keylister.cpp
@@ -124,10 +124,8 @@ void CertListView::slotStart()
qDebug() << "CertListView::slotStart()";
QGpgME::KeyListJob *job = QGpgME::smime()->keyListJob(false);
Q_ASSERT(job);
- QObject::connect(job, SIGNAL(nextKey(GpgME::Key)),
- this, SLOT(slotAddKey(GpgME::Key)));
- QObject::connect(job, SIGNAL(result(GpgME::KeyListResult)),
- this, SLOT(slotResult(GpgME::KeyListResult)));
+ QObject::connect(job, &QGpgME::KeyListJob::nextKey, this, &CertListView::slotAddKey);
+ QObject::connect(job, &QGpgME::KeyListJob::result, this, &CertListView::slotResult);
#if 0
QStringList l;
l << "Marc";
@@ -153,7 +151,7 @@ int main(int argc, char **argv)
CertListView *clv = new CertListView;
clv->show();
- QTimer::singleShot(5000, clv, SLOT(slotStart()));
+ QTimer::singleShot(5000, clv, &CertListView::slotStart);
return app.exec();
}
diff --git a/src/tests/test_keyselectioncombo.cpp b/src/tests/test_keyselectioncombo.cpp
index b6b050b..807221e 100644
--- a/src/tests/test_keyselectioncombo.cpp
+++ b/src/tests/test_keyselectioncombo.cpp
@@ -66,14 +66,8 @@ int main(int argc, char **argv)
combo.setKeyFilter(filter);
combo.prependCustomItem(QIcon(), i18n("No key"), QStringLiteral("no-key"));
- QObject::connect(&combo, &Kleo::KeySelectionCombo::currentKeyChanged,
- [](const GpgME::Key &key) {
- qDebug() << "Current key changed:" << key.keyID();
- });
- QObject::connect(&combo, &Kleo::KeySelectionCombo::customItemSelected,
- [](const QVariant &data) {
- qDebug() << "Custom item selected:" << data.toString();
- });
+ QObject::connect(&combo, &Kleo::KeySelectionCombo::currentKeyChanged, [](const GpgME::Key &key) { qDebug() << "Current key changed:" << key.keyID(); });
+ QObject::connect(&combo, &Kleo::KeySelectionCombo::customItemSelected, [](const QVariant &data) { qDebug() << "Custom item selected:" << data.toString(); });
window.show();
diff --git a/src/ui/cryptoconfigmodule.cpp b/src/ui/cryptoconfigmodule.cpp
index d46fed0..c35cc3e 100644
--- a/src/ui/cryptoconfigmodule.cpp
+++ b/src/ui/cryptoconfigmodule.cpp
@@ -561,7 +561,8 @@ Kleo::CryptoConfigEntryDebugLevel::CryptoConfigEntryDebugLevel(CryptoConfigModul
label->setEnabled(false);
mComboBox->setEnabled(false);
} else {
- connect(mComboBox, SIGNAL(currentIndexChanged(int)), SLOT(slotChanged()));
+ connect(mComboBox, static_cast<void(QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
+ this, &CryptoConfigEntryDebugLevel::slotChanged);
}
const int row = glay->rowCount();
@@ -615,8 +616,7 @@ Kleo::CryptoConfigEntryPath::CryptoConfigEntryPath(
}
} else {
if (mFileNameRequester)
- connect(mFileNameRequester, &FileNameRequester::fileNameChanged,
- this, &CryptoConfigEntryPath::slotChanged);
+ connect(mFileNameRequester, &FileNameRequester::fileNameChanged, this, &CryptoConfigEntryPath::slotChanged);
}
}
@@ -659,8 +659,7 @@ Kleo::CryptoConfigEntryDirPath::CryptoConfigEntryDirPath(
}
} else {
if (mFileNameRequester)
- connect(mFileNameRequester, &FileNameRequester::fileNameChanged,
- this, &CryptoConfigEntryDirPath::slotChanged);
+ connect(mFileNameRequester, &FileNameRequester::fileNameChanged, this, &CryptoConfigEntryDirPath::slotChanged);
}
}
@@ -817,8 +816,7 @@ void prepareURLCfgDialog(QDialog *dialog, DirectoryServicesWidget *dirserv, bool
QPushButton *defaultsBtn = buttonBox->button(QDialogButtonBox::RestoreDefaults);
- QObject::connect(defaultsBtn, &QPushButton::clicked, dirserv,
- &DirectoryServicesWidget::clear);
+ QObject::connect(defaultsBtn, &QPushButton::clicked, dirserv, &DirectoryServicesWidget::clear);
QObject::connect(buttonBox, &QDialogButtonBox::rejected, dialog, &QDialog::reject);
}
diff --git a/src/ui/directoryserviceswidget.cpp b/src/ui/directoryserviceswidget.cpp
index beae288..e820500 100644
--- a/src/ui/directoryserviceswidget.cpp
+++ b/src/ui/directoryserviceswidget.cpp
@@ -471,12 +471,9 @@ public:
ui.treeView->setModel(&model);
ui.treeView->setItemDelegate(&delegate);
- connect(&model, &QAbstractItemModel::dataChanged,
- q, &DirectoryServicesWidget::changed);
- connect(&model, &QAbstractItemModel::rowsInserted,
- q, &DirectoryServicesWidget::changed);
- connect(&model, &QAbstractItemModel::rowsRemoved,
- q, &DirectoryServicesWidget::changed);
+ connect(&model, &QAbstractItemModel::dataChanged, q, &DirectoryServicesWidget::changed);
+ connect(&model, &QAbstractItemModel::rowsInserted, q, &DirectoryServicesWidget::changed);
+ connect(&model, &QAbstractItemModel::rowsRemoved, q, &DirectoryServicesWidget::changed);
connect(ui.treeView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)),
q, SLOT(slotSelectionChanged()));
diff --git a/src/ui/dnattributeorderconfigwidget.cpp b/src/ui/dnattributeorderconfigwidget.cpp
index db872bb..8b1351c 100644
--- a/src/ui/dnattributeorderconfigwidget.cpp
+++ b/src/ui/dnattributeorderconfigwidget.cpp
@@ -123,15 +123,15 @@ Kleo::DNAttributeOrderConfigWidget::DNAttributeOrderConfigWidget(DNAttributeMapp
const char *icon;
int row, col;
const char *tooltip;
- const char *slot;
+ void(DNAttributeOrderConfigWidget::*slot)();
bool autorepeat;
} navButtons[] = {
- { "go-top", 0, 1, I18N_NOOP("Move to top"), SLOT(slotDoubleUpButtonClicked()), false },
- { "go-up", 1, 1, I18N_NOOP("Move one up"), SLOT(slotUpButtonClicked()), true },
- { "go-previous", 2, 0, I18N_NOOP("Remove from current attribute order"), SLOT(slotLeftButtonClicked()), false },
- { "go-next", 2, 2, I18N_NOOP("Add to current attribute order"), SLOT(slotRightButtonClicked()), false },
- { "go-down", 3, 1, I18N_NOOP("Move one down"), SLOT(slotDownButtonClicked()), true },
- { "go-bottom", 4, 1, I18N_NOOP("Move to bottom"), SLOT(slotDoubleDownButtonClicked()), false }
+ { "go-top", 0, 1, I18N_NOOP("Move to top"), &DNAttributeOrderConfigWidget::slotDoubleUpButtonClicked, false },
+ { "go-up", 1, 1, I18N_NOOP("Move one up"), &DNAttributeOrderConfigWidget::slotUpButtonClicked, true },
+ { "go-previous", 2, 0, I18N_NOOP("Remove from current attribute order"), &DNAttributeOrderConfigWidget::slotLeftButtonClicked, false },
+ { "go-next", 2, 2, I18N_NOOP("Add to current attribute order"), &DNAttributeOrderConfigWidget::slotRightButtonClicked, false },
+ { "go-down", 3, 1, I18N_NOOP("Move one down"), &DNAttributeOrderConfigWidget::slotDownButtonClicked, true },
+ { "go-bottom", 4, 1, I18N_NOOP("Move to bottom"), &DNAttributeOrderConfigWidget::slotDoubleDownButtonClicked, false }
};
for (unsigned int i = 0; i < sizeof navButtons / sizeof * navButtons; ++i) {
@@ -141,7 +141,7 @@ Kleo::DNAttributeOrderConfigWidget::DNAttributeOrderConfigWidget(DNAttributeMapp
tb->setToolTip(i18n(navButtons[i].tooltip));
xlay->addWidget(tb, navButtons[i].row, navButtons[i].col);
tb->setAutoRepeat(navButtons[i].autorepeat);
- connect(tb, SIGNAL(clicked()), navButtons[i].slot);
+ connect(tb, &QToolButton::clicked, this, navButtons[i].slot);
}
glay->addLayout(xlay, row, 1);
diff --git a/src/ui/keylistview.h b/src/ui/keylistview.h
index 5b8ab53..5f33bb4 100644
--- a/src/ui/keylistview.h
+++ b/src/ui/keylistview.h
@@ -170,6 +170,7 @@ public:
KeyListViewItem *itemByFingerprint(const QByteArray &) const;
+public:
using QTreeWidget::selectionChanged; // for below, but moc doesn't like it to be in the Q_SIGNALS: section
Q_SIGNALS:
void doubleClicked(Kleo::KeyListViewItem *, int);
diff --git a/src/ui/keyselectioncombo.cpp b/src/ui/keyselectioncombo.cpp
index 45898f8..18e9d11 100644
--- a/src/ui/keyselectioncombo.cpp
+++ b/src/ui/keyselectioncombo.cpp
@@ -254,16 +254,7 @@ KeySelectionCombo::KeySelectionCombo(QWidget* parent)
d->proxyModel->setSourceModel(d->sortFilterProxy);
setModel(d->proxyModel);
- connect(this, static_cast<void(KeySelectionCombo::*)(int)>(&KeySelectionCombo::currentIndexChanged),
- this, [this](int row) {
- if (row >= 0 && row < d->proxyModel->rowCount()) {
- if (d->proxyModel->isCustomItem(row)) {
- Q_EMIT customItemSelected(d->proxyModel->index(row, 0).data(Qt::UserRole));
- } else {
- Q_EMIT currentKeyChanged(currentKey());
- }
- }
- });
+ connect(this, static_cast<void(KeySelectionCombo::*)(int)>(&KeySelectionCombo::currentIndexChanged), this, [this](int row) { if (row >= 0 && row < d->proxyModel->rowCount()) { if (d->proxyModel->isCustomItem(row)) { Q_EMIT customItemSelected(d->proxyModel->index(row, 0).data(Qt::UserRole)); } else { Q_EMIT currentKeyChanged(currentKey()); } } });
d->cache = Kleo::KeyCache::mutableInstance();
@@ -279,19 +270,16 @@ void KeySelectionCombo::init()
{
connect(d->cache.get(), &Kleo::KeyCache::keyListingDone,
this, [this]() {
- qDebug() << "Key listing done";
- // Set useKeyCache ensures that the cache is populated
- // so this can be a blocking call if the cache is not initalized
- d->model->useKeyCache(true, true);
- d->proxyModel->removeCustomItem(QStringLiteral("-libkleo-loading-keys"));
- setEnabled(d->wasEnabled);
- Q_EMIT keyListingFinished();
+ // Set useKeyCache ensures that the cache is populated
+ // so this can be a blocking call if the cache is not initalized
+ qDebug() << "Key listing done";
+ d->model->useKeyCache(true, true);
+ d->proxyModel->removeCustomItem(QStringLiteral("-libkleo-loading-keys"));
+ setEnabled(d->wasEnabled);
+ Q_EMIT keyListingFinished();
});
- connect(this, &KeySelectionCombo::keyListingFinished,
- this, [this]() {
- setCurrentKey(d->defaultKey);
- });
+ connect(this, &KeySelectionCombo::keyListingFinished, this, [this]() { setCurrentKey(d->defaultKey); });
if (!d->cache->initialized()) {
refreshKeys();
diff --git a/src/ui/keyselectiondialog.cpp b/src/ui/keyselectiondialog.cpp
index 8c11acc..09e64c0 100644
--- a/src/ui/keyselectiondialog.cpp
+++ b/src/ui/keyselectiondialog.cpp
@@ -455,8 +455,7 @@ void Kleo::KeySelectionDialog::init(bool rememberChoice, bool extendedSelection,
QPushButton *const searchExternalPB =
new QPushButton(i18n("Search for &External Certificates"), page);
mTopLayout->addWidget(searchExternalPB, 0, Qt::AlignLeft);
- connect(searchExternalPB, &QAbstractButton::clicked,
- this, &KeySelectionDialog::slotStartSearchForExternalCertificates);
+ connect(searchExternalPB, &QAbstractButton::clicked, this, &KeySelectionDialog::slotStartSearchForExternalCertificates);
if (initialQuery.isEmpty()) {
searchExternalPB->hide();
}
@@ -475,8 +474,8 @@ void Kleo::KeySelectionDialog::init(bool rememberChoice, bool extendedSelection,
hlay->addWidget(le, 1);
le->setFocus();
- connect(le, SIGNAL(textChanged(QString)),
- this, SLOT(slotSearch(QString)));
+ connect(le, &QLineEdit::textChanged,
+ this, static_cast<void(KeySelectionDialog::*)(const QString &)>(&KeySelectionDialog::slotSearch));
connect(mStartSearchTimer, &QTimer::timeout, this, &KeySelectionDialog::slotFilter);
mKeyListView = new KeyListView(new ColumnStrategy(mKeyUsage), 0, page);
@@ -500,21 +499,17 @@ void Kleo::KeySelectionDialog::init(bool rememberChoice, bool extendedSelection,
"</p></qt>"));
}
- connect(mCheckSelectionTimer, SIGNAL(timeout()),
- SLOT(slotCheckSelection()));
+ connect(mCheckSelectionTimer, &QTimer::timeout,
+ this, static_cast<void(KeySelectionDialog::*)()>(&KeySelectionDialog::slotCheckSelection));
connectSignals();
- connect(mKeyListView,
- SIGNAL(doubleClicked(Kleo::KeyListViewItem*,int)),
- SLOT(slotTryOk()));
- connect(mKeyListView,
- &KeyListView::contextMenu,
- this, &KeySelectionDialog::slotRMB);
+ connect(mKeyListView, &Kleo::KeyListView::doubleClicked, this, &KeySelectionDialog::slotTryOk);
+ connect(mKeyListView, &KeyListView::contextMenu, this, &KeySelectionDialog::slotRMB);
user1Button->setText(i18n("&Reread Keys"));
user2Button->setText(i18n("&Start Certificate Manager"));
connect(user1Button, &QPushButton::clicked, this, &KeySelectionDialog::slotRereadKeys);
- connect(user2Button, SIGNAL(clicked()), this, SLOT(slotStartCertificateManager()));
+ connect(user2Button, &QPushButton::clicked, this, [this]() { slotStartCertificateManager(); });
connect(mOkButton, &QPushButton::clicked, this, &KeySelectionDialog::slotOk);
connect(buttonBox->button(QDialogButtonBox::Cancel), &QPushButton::clicked, this, &KeySelectionDialog::slotCancel);
slotRereadKeys();
@@ -547,11 +542,10 @@ Kleo::KeySelectionDialog::~KeySelectionDialog()
void Kleo::KeySelectionDialog::connectSignals()
{
if (mKeyListView->isMultiSelection())
- connect(mKeyListView, &QTreeWidget::itemSelectionChanged,
- this, &KeySelectionDialog::slotSelectionChanged);
+ connect(mKeyListView, &QTreeWidget::itemSelectionChanged, this, &KeySelectionDialog::slotSelectionChanged);
else
- connect(mKeyListView, SIGNAL(selectionChanged(Kleo::KeyListViewItem*)),
- SLOT(slotCheckSelection(Kleo::KeyListViewItem*)));
+ connect(mKeyListView, static_cast<void(KeyListView::*)(KeyListViewItem*)>(&KeyListView::selectionChanged),
+ this, static_cast<void(KeySelectionDialog::*)(KeyListViewItem*)>(&KeySelectionDialog::slotCheckSelection));
}
void Kleo::KeySelectionDialog::disconnectSignals()
@@ -560,8 +554,8 @@ void Kleo::KeySelectionDialog::disconnectSignals()
disconnect(mKeyListView, &QTreeWidget::itemSelectionChanged,
this, &KeySelectionDialog::slotSelectionChanged);
else
- disconnect(mKeyListView, SIGNAL(selectionChanged(Kleo::KeyListViewItem*)),
- this, SLOT(slotCheckSelection(Kleo::KeyListViewItem*)));
+ disconnect(mKeyListView, static_cast<void(KeyListView::*)(KeyListViewItem*)>(&KeyListView::selectionChanged),
+ this, static_cast<void(KeySelectionDialog::*)(KeyListViewItem*)>(&KeySelectionDialog::slotCheckSelection));
}
const GpgME::Key &Kleo::KeySelectionDialog::selectedKey() const
@@ -687,14 +681,11 @@ void Kleo::KeySelectionDialog::startKeyListJobForBackend(const QGpgME::Protocol
return;
}
- connect(job, &QGpgME::KeyListJob::result,
- this, &KeySelectionDialog::slotKeyListResult);
+ connect(job, &QGpgME::KeyListJob::result, this, &KeySelectionDialog::slotKeyListResult);
if (validate)
- connect(job, &QGpgME::KeyListJob::nextKey,
- mKeyListView, &KeyListView::slotRefreshKey);
+ connect(job, &QGpgME::KeyListJob::nextKey, mKeyListView, &KeyListView::slotRefreshKey);
else
- connect(job, &QGpgME::KeyListJob::nextKey,
- mKeyListView, &KeyListView::slotAddKey);
+ connect(job, &QGpgME::KeyListJob::nextKey, mKeyListView, &KeyListView::slotAddKey);
QStringList fprs;
std::transform(keys.begin(), keys.end(), std::back_inserter(fprs), ExtractFingerprint());
@@ -862,7 +853,7 @@ void Kleo::KeySelectionDialog::slotRMB(Kleo::KeyListViewItem *item, const QPoint
mCurrentContextMenuItem = item;
QMenu menu;
- menu.addAction(i18n("Recheck Key"), this, SLOT(slotRecheckKey()));
+ menu.addAction(i18n("Recheck Key"), this, &KeySelectionDialog::slotRecheckKey);
menu.exec(p);
}