Commit 97a6d6c6 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use directly qOverload

parent bb4ec18c
......@@ -126,6 +126,7 @@ find_package(KPimImportWizard ${IMPORTWIZARD_LIB_VERSION} CONFIG)
find_package(KF5MailImporterAkonadi ${MAILIMPORTER_LIB_VERSION} CONFIG REQUIRED)
find_package(KPimPkPass ${KPIMPKPASS_LIB_VERSION} CONFIG REQUIRED)
find_package(KPimItinerary ${KPIMITINERARY_LIB_VERSION} CONFIG REQUIRED)
set(CMAKE_CXX_STANDARD 14)
if(BUILD_TESTING)
add_definitions(-DBUILD_TESTING)
......
......@@ -41,7 +41,7 @@ SelectAddressTypeComboBox::SelectAddressTypeComboBox(QWidget *parent)
update();
connect(this, QOverload<int>::of(&KComboBox::activated), this, &SelectAddressTypeComboBox::selected);
connect(this, qOverload<int>(&KComboBox::activated), this, &SelectAddressTypeComboBox::selected);
}
SelectAddressTypeComboBox::~SelectAddressTypeComboBox()
......
......@@ -188,22 +188,22 @@ CSVImportDialog::CSVImportDialog(QWidget *parent)
reloadCodecs();
connect(mUrlRequester, QOverload<const QString &>::of(&KUrlRequester::returnPressed), this, &CSVImportDialog::setFile);
connect(mUrlRequester, qOverload<const QString &>(&KUrlRequester::returnPressed), this, &CSVImportDialog::setFile);
connect(mUrlRequester, &KUrlRequester::urlSelected, this, &CSVImportDialog::setUrl);
connect(mUrlRequester->lineEdit(), &QLineEdit::textChanged, this, &CSVImportDialog::urlChanged);
connect(mDelimiterGroup, QOverload<int>::of(&QButtonGroup::buttonClicked), this, [this](int val) {
connect(mDelimiterGroup, qOverload<int>(&QButtonGroup::buttonClicked), this, [this](int val) {
delimiterClicked(val);
});
connect(mDelimiterEdit, QOverload<>::of(&QLineEdit::returnPressed), this, [this]() {
connect(mDelimiterEdit, qOverload<>(&QLineEdit::returnPressed), this, [this]() {
customDelimiterChanged();
});
connect(mDelimiterEdit, QOverload<const QString &>::of(&QLineEdit::textChanged), this, [this](const QString &str) {
connect(mDelimiterEdit, qOverload<const QString &>(&QLineEdit::textChanged), this, [this](const QString &str) {
customDelimiterChanged(str);
});
connect(mComboQuote, QOverload<const QString &>::of(&QComboBox::activated), this, [this](const QString &str) {
connect(mComboQuote, qOverload<const QString &>(&QComboBox::activated), this, [this](const QString &str) {
textQuoteChanged(str);
});
connect(mCodecCombo, QOverload<const QString &>::of(&QComboBox::activated), this, [this]() {
connect(mCodecCombo, qOverload<const QString &>(&QComboBox::activated), this, [this]() {
codecChanged();
});
connect(mSkipFirstRow, &QCheckBox::toggled, this, [this](bool b) {
......
......@@ -84,8 +84,8 @@ MergeContactWidget::MergeContactWidget(QWidget *parent)
mCollectionCombobox->setMinimumWidth(250);
mCollectionCombobox->setMimeTypeFilter(QStringList() << KContacts::Addressee::mimeType());
mCollectionCombobox->setObjectName(QStringLiteral("akonadicombobox"));
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::currentIndexChanged), this, &MergeContactWidget::slotUpdateMergeButton);
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::activated), this, &MergeContactWidget::slotUpdateMergeButton);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &MergeContactWidget::slotUpdateMergeButton);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::activated), this, &MergeContactWidget::slotUpdateMergeButton);
hbox->addWidget(mCollectionCombobox);
......
......@@ -74,8 +74,8 @@ SearchDuplicateResultWidget::SearchDuplicateResultWidget(QWidget *parent)
mCollectionCombobox->setMinimumWidth(250);
mCollectionCombobox->setMimeTypeFilter(QStringList() << KContacts::Addressee::mimeType());
mCollectionCombobox->setObjectName(QStringLiteral("akonadicombobox"));
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::currentIndexChanged), this, &SearchDuplicateResultWidget::slotUpdateMergeButton);
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::activated), this, &SearchDuplicateResultWidget::slotUpdateMergeButton);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &SearchDuplicateResultWidget::slotUpdateMergeButton);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::activated), this, &SearchDuplicateResultWidget::slotUpdateMergeButton);
mergeLayout->addWidget(mCollectionCombobox);
mMergeContact = new QPushButton(i18n("Merge"));
......
......@@ -47,7 +47,7 @@ InsertShorturlConfigureWidget::InsertShorturlConfigureWidget(QWidget *parent)
mShortUrlServer->addItem(plugin->pluginName(), plugin->engineName());
}
connect(mShortUrlServer, QOverload<int>::of(&QComboBox::activated), this, &InsertShorturlConfigureWidget::slotChanged);
connect(mShortUrlServer, qOverload<int>(&QComboBox::activated), this, &InsertShorturlConfigureWidget::slotChanged);
loadConfig();
}
......
......@@ -48,7 +48,7 @@ void IsgdShortUrlEngineInterface::generateShortUrl()
request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("application/json"));
QNetworkReply *reply = mNetworkAccessManager->get(request);
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &IsgdShortUrlEngineInterface::slotErrorFound);
connect(reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this, &IsgdShortUrlEngineInterface::slotErrorFound);
}
void IsgdShortUrlEngineInterface::slotSslErrors(QNetworkReply *reply, const QList<QSslError> &error)
......
......@@ -42,7 +42,7 @@ void TinyUrlEngineInterface::generateShortUrl()
{
const QString requestUrl = QStringLiteral("https://tinyurl.com/api-create.php?url=%1").arg(mOriginalUrl);
QNetworkReply *reply = mNetworkAccessManager->get(QNetworkRequest(QUrl(requestUrl)));
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &TinyUrlEngineInterface::slotErrorFound);
connect(reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this, &TinyUrlEngineInterface::slotErrorFound);
}
void TinyUrlEngineInterface::slotShortUrlFinished(QNetworkReply *reply)
......
......@@ -42,7 +42,7 @@ void TripAbShortUrlEngineInterface::generateShortUrl()
{
const QString requestUrl = QStringLiteral("https://to.ly/api.php?longurl=%1").arg(mOriginalUrl);
QNetworkReply *reply = mNetworkAccessManager->get(QNetworkRequest(QUrl(requestUrl)));
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &TripAbShortUrlEngineInterface::slotErrorFound);
connect(reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this, &TripAbShortUrlEngineInterface::slotErrorFound);
}
void TripAbShortUrlEngineInterface::slotShortUrlFinished(QNetworkReply *reply)
......
......@@ -55,7 +55,7 @@ void Ur1CaShortUrlEngineInterface::generateShortUrl()
request.setHeader(QNetworkRequest::ContentTypeHeader, QStringLiteral("text/plain"));
QNetworkReply *reply = mNetworkAccessManager->post(request, postData);
connect(reply, QOverload<QNetworkReply::NetworkError>::of(&QNetworkReply::error), this, &Ur1CaShortUrlEngineInterface::slotErrorFound);
connect(reply, qOverload<QNetworkReply::NetworkError>(&QNetworkReply::error), this, &Ur1CaShortUrlEngineInterface::slotErrorFound);
}
void Ur1CaShortUrlEngineInterface::slotSslErrors(QNetworkReply *reply, const QList<QSslError> &error)
......
......@@ -60,8 +60,8 @@ AutomaticAddContactsTabWidget::AutomaticAddContactsTabWidget(QWidget *parent, QA
mCollectionCombobox->setObjectName(QStringLiteral("akonadicombobox"));
hlay->addWidget(mCollectionCombobox);
hlay->addStretch(1);
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::currentIndexChanged), this, &AutomaticAddContactsTabWidget::configureChanged);
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::activated), this, &AutomaticAddContactsTabWidget::configureChanged);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &AutomaticAddContactsTabWidget::configureChanged);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::activated), this, &AutomaticAddContactsTabWidget::configureChanged);
mainLayout->addStretch(1);
}
......
......@@ -38,8 +38,8 @@ void GrammalecteGenerateConfigOptionJob::start()
mProcess = new QProcess(this);
mProcess->setProgram(mPythonPath);
mProcess->setArguments(QStringList() << mGrammarlecteCliPath << QStringLiteral("-lo"));
connect(mProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &GrammalecteGenerateConfigOptionJob::slotFinished);
connect(mProcess, QOverload<QProcess::ProcessError>::of(&QProcess::errorOccurred),
connect(mProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &GrammalecteGenerateConfigOptionJob::slotFinished);
connect(mProcess, qOverload<QProcess::ProcessError>(&QProcess::errorOccurred),
this, &GrammalecteGenerateConfigOptionJob::receivedError);
connect(mProcess, &QProcess::readyReadStandardError, this, &GrammalecteGenerateConfigOptionJob::receivedStdErr);
connect(mProcess, &QProcess::readyReadStandardOutput, this, &GrammalecteGenerateConfigOptionJob::receivedStandardOutput);
......
......@@ -51,8 +51,8 @@ void GrammalecteResultJob::start()
}
args << QStringLiteral("-f") << file->fileName() << QStringLiteral("-j");
mProcess->setArguments(args);
connect(mProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &GrammalecteResultJob::slotFinished);
connect(mProcess, QOverload<QProcess::ProcessError>::of(&QProcess::errorOccurred),
connect(mProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &GrammalecteResultJob::slotFinished);
connect(mProcess, qOverload<QProcess::ProcessError>(&QProcess::errorOccurred),
this, &GrammalecteResultJob::receivedError);
connect(mProcess, &QProcess::readyReadStandardError, this, &GrammalecteResultJob::receivedStdErr);
connect(mProcess, &QProcess::readyReadStandardOutput, this, &GrammalecteResultJob::receivedStandardOutput);
......
......@@ -47,8 +47,8 @@ MailMergeWidget::MailMergeWidget(QWidget *parent)
mSource->setObjectName(QStringLiteral("source"));
mSource->addItem(i18n("Address Book"), AddressBook);
mSource->addItem(i18n("CSV"), CSV);
connect(mSource, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &MailMergeWidget::slotSourceChanged);
connect(mSource, QOverload<int>::of(&QComboBox::activated), this, &MailMergeWidget::slotSourceChanged);
connect(mSource, qOverload<int>(&QComboBox::currentIndexChanged), this, &MailMergeWidget::slotSourceChanged);
connect(mSource, qOverload<int>(&QComboBox::activated), this, &MailMergeWidget::slotSourceChanged);
hbox->addWidget(mSource);
......
......@@ -68,7 +68,7 @@ void SendmailConfigWidget::init()
// is saved in the config.
d->ui.kcfg_host->setText(QStandardPaths::findExecutable(QStringLiteral("sendmail")));
}
connect(d->ui.kcfg_host->lineEdit(), QOverload<const QString &>::of(&QLineEdit::textChanged),
connect(d->ui.kcfg_host->lineEdit(), qOverload<const QString &>(&QLineEdit::textChanged),
this, &SendmailConfigWidget::slotTextChanged);
slotTextChanged(d->ui.kcfg_host->text());
}
......
......@@ -36,8 +36,8 @@ SendmailJob::SendmailJob(Transport *transport, QObject *parent)
: TransportJob(transport, parent)
{
mProcess = new QProcess(this);
connect(mProcess, QOverload<int, QProcess::ExitStatus>::of(&QProcess::finished), this, &SendmailJob::sendmailExited);
connect(mProcess, QOverload<QProcess::ProcessError>::of(&QProcess::errorOccurred),
connect(mProcess, qOverload<int, QProcess::ExitStatus>(&QProcess::finished), this, &SendmailJob::sendmailExited);
connect(mProcess, qOverload<QProcess::ProcessError>(&QProcess::errorOccurred),
this, &SendmailJob::receivedError);
connect(mProcess, &QProcess::readyReadStandardError, this, &SendmailJob::receivedStdErr);
}
......
......@@ -81,8 +81,8 @@ EventEdit::EventEdit(QWidget *parent)
#endif
mCollectionCombobox->setToolTip(i18n("Calendar where the new event will be stored"));
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::currentIndexChanged), this, &EventEdit::slotCollectionChanged);
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::activated), this, &EventEdit::slotCollectionChanged);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &EventEdit::slotCollectionChanged);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::activated), this, &EventEdit::slotCollectionChanged);
connect(mCollectionCombobox->model(), &QAbstractItemModel::rowsInserted, this, &EventEdit::comboboxRowInserted);
hbox->addWidget(mCollectionCombobox);
......
......@@ -76,8 +76,8 @@ NoteEdit::NoteEdit(QWidget *parent)
#endif
mCollectionCombobox->setToolTip(i18n("Calendar where the new event will be stored"));
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::currentIndexChanged), this, &NoteEdit::slotCollectionChanged);
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::activated), this, &NoteEdit::slotCollectionChanged);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &NoteEdit::slotCollectionChanged);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::activated), this, &NoteEdit::slotCollectionChanged);
hbox->addWidget(mCollectionCombobox);
hbox = new QHBoxLayout;
......
......@@ -88,8 +88,8 @@ TodoEdit::TodoEdit(QWidget *parent)
mCollectionCombobox->setAccessibleDescription(i18n("Todo list where the new task will be stored."));
#endif
mCollectionCombobox->setToolTip(i18n("Todo list where the new task will be stored"));
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::currentIndexChanged), this, &TodoEdit::slotCollectionChanged);
connect(mCollectionCombobox, QOverload<int>::of(&Akonadi::CollectionComboBox::activated), this, &TodoEdit::slotCollectionChanged);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &TodoEdit::slotCollectionChanged);
connect(mCollectionCombobox, qOverload<int>(&Akonadi::CollectionComboBox::activated), this, &TodoEdit::slotCollectionChanged);
hbox->addWidget(mCollectionCombobox);
hbox = new QHBoxLayout;
......
......@@ -59,7 +59,7 @@ AdBlockCreateFilterDialog::AdBlockCreateFilterDialog(QWidget *parent)
mUi->collapseBlocked->addItem(i18n("Use default"), QString());
mUi->collapseBlocked->addItem(i18n("Yes"), QStringLiteral("collapse"));
mUi->collapseBlocked->addItem(i18n("Not"), QStringLiteral("~collapse"));
connect(mUi->collapseBlocked, QOverload<int>::of(&QComboBox::activated), this, &AdBlockCreateFilterDialog::slotUpdateFilter);
connect(mUi->collapseBlocked, qOverload<int>(&QComboBox::activated), this, &AdBlockCreateFilterDialog::slotUpdateFilter);
readConfig();
}
......
Markdown is supported
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