Commit ee9ec222 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use qOverload directly (scripted)

parent af9c09ab
Pipeline #77322 passed with stage
in 14 minutes and 4 seconds
......@@ -27,7 +27,7 @@ void TestRunner::run()
qCDebug(AKONADITEST_LOG) << "Starting test" << mArguments;
mProcess = new KProcess(this);
mProcess->setProgram(mArguments);
connect(mProcess, QOverload<int, QProcess::ExitStatus>::of(&KProcess::finished), this, &TestRunner::processFinished);
connect(mProcess, qOverload<int, QProcess::ExitStatus>(&KProcess::finished), this, &TestRunner::processFinished);
connect(mProcess, &KProcess::errorOccurred, this, &TestRunner::processError);
// environment setup seems to have been done by setuptest globally already
mProcess->start();
......
......@@ -29,7 +29,7 @@ ProcessControl::ProcessControl(QObject *parent)
, mShutdownTimeout(1s)
{
connect(&mProcess, &QProcess::errorOccurred, this, &ProcessControl::slotError);
connect(&mProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &ProcessControl::slotFinished);
connect(&mProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &ProcessControl::slotFinished);
mProcess.setProcessChannelMode(QProcess::ForwardedChannels);
if (Akonadi::Instance::hasIdentifier()) {
......
......@@ -1113,9 +1113,9 @@ bool MonitorPrivate::emitCollectionNotification(const Protocol::CollectionChange
case Protocol::CollectionChangeNotification::Add:
return emitToListeners(&Monitor::collectionAdded, collection, parent);
case Protocol::CollectionChangeNotification::Modify:
handled |= emitToListeners(QOverload<const Akonadi::Collection &>::of(&Monitor::collectionChanged), collection);
handled |= emitToListeners(qOverload<const Akonadi::Collection &>(&Monitor::collectionChanged), collection);
handled |=
emitToListeners(QOverload<const Akonadi::Collection &, const QSet<QByteArray> &>::of(&Monitor::collectionChanged), collection, msg.changedParts());
emitToListeners(qOverload<const Akonadi::Collection &, const QSet<QByteArray> &>(&Monitor::collectionChanged), collection, msg.changedParts());
return handled;
case Protocol::CollectionChangeNotification::Move:
return emitToListeners(&Monitor::collectionMoved, collection, parent, destination);
......@@ -1366,8 +1366,8 @@ void MonitorPrivate::updateListeners(QMetaMethod signal, ListenerAction action)
UPDATE_LISTENERS(&Monitor::itemsUnlinked)
UPDATE_LISTENERS(&Monitor::collectionAdded)
UPDATE_LISTENERS(QOverload<const Akonadi::Collection &>::of(&Monitor::collectionChanged))
UPDATE_LISTENERS((QOverload<const Akonadi::Collection &, const QSet<QByteArray> &>::of(&Monitor::collectionChanged)))
UPDATE_LISTENERS(qOverload<const Akonadi::Collection &>(&Monitor::collectionChanged))
UPDATE_LISTENERS((qOverload<const Akonadi::Collection &, const QSet<QByteArray> &>(&Monitor::collectionChanged)))
UPDATE_LISTENERS(&Monitor::collectionMoved)
UPDATE_LISTENERS(&Monitor::collectionRemoved)
UPDATE_LISTENERS(&Monitor::collectionSubscribed)
......
......@@ -80,7 +80,7 @@ public:
Q_EMIT instance->stopped();
}
if (state == ServerManager::Starting || state == ServerManager::Stopping) {
QMetaObject::invokeMethod(mSafetyTimer.data(), QOverload<>::of(&QTimer::start), Qt::QueuedConnection); // in case we are in a different thread
QMetaObject::invokeMethod(mSafetyTimer.data(), qOverload<>(&QTimer::start), Qt::QueuedConnection); // in case we are in a different thread
} else {
QMetaObject::invokeMethod(mSafetyTimer.data(), &QTimer::stop, Qt::QueuedConnection); // in case we are in a different thread
}
......
......@@ -334,13 +334,13 @@ void AkonadiServer::stopDatabaseProcess()
bool AkonadiServer::createServers(QSettings &settings, QSettings &connectionSettings)
{
mCmdServer = std::make_unique<AkLocalServer>(this);
connect(mCmdServer.get(), QOverload<quintptr>::of(&AkLocalServer::newConnection), this, &AkonadiServer::newCmdConnection);
connect(mCmdServer.get(), qOverload<quintptr>(&AkLocalServer::newConnection), this, &AkonadiServer::newCmdConnection);
mNotificationManager = std::make_unique<NotificationManager>();
mNtfServer = std::make_unique<AkLocalServer>(this);
// Note: this is a queued connection, as NotificationManager lives in its
// own thread
connect(mNtfServer.get(), QOverload<quintptr>::of(&AkLocalServer::newConnection), mNotificationManager.get(), &NotificationManager::registerConnection);
connect(mNtfServer.get(), qOverload<quintptr>(&AkLocalServer::newConnection), mNotificationManager.get(), &NotificationManager::registerConnection);
// TODO: share socket setup with client
#ifdef Q_OS_WIN
......
......@@ -199,7 +199,7 @@ void SearchManager::scheduleSearchUpdate()
// Reset if the timer is active (use QueuedConnection to invoke start() from
// the thread the QTimer lives in instead of caller's thread, otherwise crashes
// and weird things can happen.
QMetaObject::invokeMethod(mSearchUpdateTimer, QOverload<>::of(&QTimer::start), Qt::QueuedConnection);
QMetaObject::invokeMethod(mSearchUpdateTimer, qOverload<>(&QTimer::start), Qt::QueuedConnection);
}
void SearchManager::searchUpdateTimeout()
......
......@@ -407,7 +407,7 @@ bool DbConfigMysql::startInternalServer()
return false;
}
connect(mDatabaseProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &DbConfigMysql::processFinished);
connect(mDatabaseProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &DbConfigMysql::processFinished);
// wait until mysqld has created the socket file (workaround for QTBUG-47475 in Qt5.5.0)
int counter = 50; // avoid an endless loop in case mysqld terminated
......
......@@ -104,7 +104,7 @@ AgentTypeWidget::AgentTypeWidget(QWidget *parent)
connect(d->mView->selectionModel(), &QItemSelectionModel::currentChanged, this, [this](const QModelIndex &start, const QModelIndex &end) {
d->currentAgentTypeChanged(start, end);
});
connect(d->mView, QOverload<const QModelIndex &>::of(&QListView::activated), this, [this](const QModelIndex &index) {
connect(d->mView, qOverload<const QModelIndex &>(&QListView::activated), this, [this](const QModelIndex &index) {
d->typeActivated(index);
});
}
......
......@@ -70,10 +70,10 @@ CachePolicyPage::CachePolicyPage(QWidget *parent, GuiMode mode)
d->mode = mode;
d->mUi->setupUi(this);
connect(d->mUi->checkInterval, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int value) {
connect(d->mUi->checkInterval, qOverload<int>(&QSpinBox::valueChanged), this, [this](int value) {
d->slotIntervalValueChanged(value);
});
connect(d->mUi->localCacheTimeout, QOverload<int>::of(&QSpinBox::valueChanged), this, [this](int value) {
connect(d->mUi->localCacheTimeout, qOverload<int>(&QSpinBox::valueChanged), this, [this](int value) {
d->slotCacheValueChanged(value);
});
connect(d->mUi->inherit, &QCheckBox::toggled, this, [this](bool checked) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment