Commit 6572d149 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use qOverload directly (scripted)

parent f7059877
Pipeline #77324 passed with stage
in 32 minutes and 38 seconds
......@@ -18,8 +18,8 @@ SelectThunderbirdFilterFilesWidget::SelectThunderbirdFilterFilesWidget(const QSt
, ui(new Ui::SelectThunderbirdFilterFilesWidget)
{
ui->setupUi(this);
connect(ui->buttonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &SelectThunderbirdFilterFilesWidget::slotButtonClicked);
connect(ui->profiles, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &SelectThunderbirdFilterFilesWidget::slotProfileChanged);
connect(ui->buttonGroup, qOverload<QAbstractButton *>(&QButtonGroup::buttonClicked), this, &SelectThunderbirdFilterFilesWidget::slotButtonClicked);
connect(ui->profiles, qOverload<int>(&KComboBox::currentIndexChanged), this, &SelectThunderbirdFilterFilesWidget::slotProfileChanged);
ui->listFiles->setSelectionMode(QAbstractItemView::MultiSelection);
QString defaultProfile;
......
......@@ -85,7 +85,7 @@ QWidget *FilterActionAddHeader::createParamWidget(QWidget *parent) const
layout->addWidget(lineEdit, 1);
setParamWidgetValue(widget);
connect(comboBox, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &FilterActionAddHeader::filterActionModified);
connect(comboBox, qOverload<int>(&KComboBox::currentIndexChanged), this, &FilterActionAddHeader::filterActionModified);
connect(comboBox->lineEdit(), &QLineEdit::textChanged, this, &FilterAction::filterActionModified);
connect(lineEdit, &QLineEdit::textChanged, this, &FilterActionAddHeader::filterActionModified);
......
......@@ -39,7 +39,7 @@ QWidget *FilterActionAddTag::createParamWidget(QWidget *parent) const
}
setParamWidgetValue(mComboBox);
connect(mComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FilterActionAddTag::filterActionModified);
connect(mComboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &FilterActionAddTag::filterActionModified);
return mComboBox;
}
......
......@@ -132,8 +132,8 @@ QWidget *FilterActionAddToAddressBook::createParamWidget(QWidget *parent) const
i18n("This defines the preferred address book.\n"
"If it is not accessible, the filter will fallback to the default address book."));
layout->addWidget(collectionComboBox, 1, 2);
connect(headerCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &FilterActionAddToAddressBook::filterActionModified);
connect(collectionComboBox, QOverload<int>::of(&Akonadi::CollectionComboBox::activated), this, &FilterActionAddToAddressBook::filterActionModified);
connect(headerCombo, qOverload<int>(&KComboBox::currentIndexChanged), this, &FilterActionAddToAddressBook::filterActionModified);
connect(collectionComboBox, qOverload<int>(&Akonadi::CollectionComboBox::activated), this, &FilterActionAddToAddressBook::filterActionModified);
connect(categoryEdit, &Akonadi::TagWidget::selectionChanged, this, &FilterActionAddToAddressBook::filterActionModified);
setParamWidgetValue(widget);
......@@ -203,7 +203,7 @@ void FilterActionAddToAddressBook::applyParamWidgetValue(QWidget *paramWidget)
if (collection.isValid()) {
mCollectionId = collection.id();
connect(collectionComboBox,
QOverload<int>::of(&Akonadi::CollectionComboBox::currentIndexChanged),
qOverload<int>(&Akonadi::CollectionComboBox::currentIndexChanged),
this,
&FilterActionAddToAddressBook::filterActionModified);
} else {
......
......@@ -110,7 +110,7 @@ QWidget *FilterActionForward::createParamWidget(QWidget *parent) const
templateCombo->setEnabled(templateCombo->count() > 1);
templateCombo->setToolTip(i18n("The template used when forwarding"));
templateCombo->setWhatsThis(i18n("Set the forwarding template that will be used with this filter."));
connect(templateCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &FilterActionForward::filterActionModified);
connect(templateCombo, qOverload<int>(&KComboBox::currentIndexChanged), this, &FilterActionForward::filterActionModified);
connect(addressRequester, &Akonadi::EmailAddressRequester::textChanged, this, &FilterActionForward::filterActionModified);
return addressAndTemplate;
......
......@@ -34,7 +34,7 @@ QWidget *FilterActionRemoveHeader::createParamWidget(QWidget *parent) const
comboBox->setMinimumWidth(50);
comboBox->setInsertPolicy(QComboBox::InsertAtBottom);
setParamWidgetValue(comboBox);
connect(comboBox, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &FilterActionRemoveHeader::filterActionModified);
connect(comboBox, qOverload<int>(&KComboBox::currentIndexChanged), this, &FilterActionRemoveHeader::filterActionModified);
connect(comboBox->lineEdit(), &QLineEdit::textChanged, this, &FilterAction::filterActionModified);
return comboBox;
......
......@@ -130,7 +130,7 @@ QWidget *FilterActionRewriteHeader::createParamWidget(QWidget *parent) const
layout->addWidget(lineEdit, 1);
setParamWidgetValue(widget);
connect(comboBox, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &FilterActionRewriteHeader::filterActionModified);
connect(comboBox, qOverload<int>(&KComboBox::currentIndexChanged), this, &FilterActionRewriteHeader::filterActionModified);
connect(comboBox->lineEdit(), &QLineEdit::textChanged, this, &FilterAction::filterActionModified);
connect(regExpLineEdit, &KLineEdit::textChanged, this, &FilterActionRewriteHeader::filterActionModified);
connect(lineEdit, &KLineEdit::textChanged, this, &FilterActionRewriteHeader::filterActionModified);
......
......@@ -93,7 +93,7 @@ QWidget *FilterActionSetIdentity::createParamWidget(QWidget *parent) const
comboBox->setObjectName(QStringLiteral("identitycombobox"));
comboBox->setCurrentIdentity(mParameter);
connect(comboBox, QOverload<int>::of(&KIdentityManagement::IdentityCombo::currentIndexChanged), this, &FilterActionSetIdentity::filterActionModified);
connect(comboBox, qOverload<int>(&KIdentityManagement::IdentityCombo::currentIndexChanged), this, &FilterActionSetIdentity::filterActionModified);
return comboBox;
}
......
......@@ -28,10 +28,7 @@ QWidget *FilterActionSetTransport::createParamWidget(QWidget *parent) const
auto transportCombobox = new MailTransport::TransportComboBox(parent);
transportCombobox->setObjectName(QStringLiteral("transportcombobox"));
setParamWidgetValue(transportCombobox);
connect(transportCombobox,
QOverload<int>::of(&MailTransport::TransportComboBox::currentIndexChanged),
this,
&FilterActionSetTransport::filterActionModified);
connect(transportCombobox, qOverload<int>(&MailTransport::TransportComboBox::currentIndexChanged), this, &FilterActionSetTransport::filterActionModified);
return transportCombobox;
}
......
......@@ -152,11 +152,11 @@ FilterActionWidget::FilterActionWidget(QWidget *parent)
setFocusProxy(d->mComboBox);
// now connect the combo box and the widget stack
connect(d->mComboBox, QOverload<int>::of(&QComboBox::activated), this, [this](int index) {
connect(d->mComboBox, qOverload<int>(&QComboBox::activated), this, [this](int index) {
d->slotFilterTypeChanged(index);
});
connect(d->mComboBox, QOverload<int>::of(&QComboBox::activated), this, &FilterActionWidget::filterModified);
connect(d->mComboBox, qOverload<int>(&QComboBox::activated), this, &FilterActionWidget::filterModified);
connect(d->mAdd, &QPushButton::clicked, this, [this]() {
d->slotAddWidget();
......
......@@ -24,7 +24,7 @@ QWidget *FilterActionWithStringList::createParamWidget(QWidget *parent) const
comboBox->setEditable(false);
comboBox->addItems(mParameterList);
setParamWidgetValue(comboBox);
connect(comboBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &FilterActionWithStringList::filterActionModified);
connect(comboBox, qOverload<int>(&QComboBox::currentIndexChanged), this, &FilterActionWithStringList::filterActionModified);
return comboBox;
}
......
......@@ -347,8 +347,8 @@ KMFilterDialog::KMFilterDialog(const QList<KActionCollection *> &actionCollectio
connect(mFilterList, &KMFilterListBox::filterUpdated, this, &KMFilterDialog::slotDialogUpdated);
connect(mFilterList, &KMFilterListBox::filterOrderAltered, this, &KMFilterDialog::slotDialogUpdated);
connect(mPatternEdit, &MailCommon::SearchPatternEdit::patternChanged, this, &KMFilterDialog::slotDialogUpdated);
connect(mActionLister, QOverload<QWidget *>::of(&FilterActionWidgetLister::widgetAdded), this, &KMFilterDialog::slotDialogUpdated);
connect(mActionLister, QOverload<QWidget *>::of(&FilterActionWidgetLister::widgetRemoved), this, &KMFilterDialog::slotDialogUpdated);
connect(mActionLister, qOverload<QWidget *>(&FilterActionWidgetLister::widgetAdded), this, &KMFilterDialog::slotDialogUpdated);
connect(mActionLister, qOverload<QWidget *>(&FilterActionWidgetLister::widgetRemoved), this, &KMFilterDialog::slotDialogUpdated);
connect(mActionLister, &MailCommon::FilterActionWidgetLister::filterModified, this, &KMFilterDialog::slotDialogUpdated);
connect(mActionLister, &MailCommon::FilterActionWidgetLister::clearWidgets, this, &KMFilterDialog::slotDialogUpdated);
KConfigGroup myGroup(KernelIf->config(), "Geometry");
......
......@@ -56,7 +56,7 @@ FilterImporterExporterGui::FilterImporterExporterGui(QWidget *parent)
act = new QAction(QStringLiteral("GMail filters"), this);
act->setData(QVariant::fromValue(MailCommon::FilterImporterExporter::GmailFilter));
menuFilter->addAction(act);
connect(menuFilter, QOverload<QAction *>::of(&QMenu::triggered), this, &FilterImporterExporterGui::slotImportFilter);
connect(menuFilter, qOverload<QAction *>(&QMenu::triggered), this, &FilterImporterExporterGui::slotImportFilter);
mTextEdit = new QTextEdit;
mTextEdit->setReadOnly(true);
......
......@@ -110,7 +110,7 @@ FolderSelectionDialog::FolderSelectionDialog(QWidget *parent, SelectionFolderOpt
connect(d->folderTreeWidget->folderTreeWidgetProxyModel(), &QAbstractItemModel::rowsInserted, this, &FolderSelectionDialog::rowsInserted);
connect(d->folderTreeWidget->folderTreeView(),
QOverload<const QModelIndex &>::of(&QAbstractItemView::doubleClicked),
qOverload<const QModelIndex &>(&QAbstractItemView::doubleClicked),
this,
&FolderSelectionDialog::slotDoubleClick);
......
......@@ -57,7 +57,7 @@ FolderSettings::FolderSettings(const Akonadi::Collection &col, bool writeconfig)
mIdentity = KernelIf->identityManager()->defaultIdentity().uoid();
readConfig();
connect(KernelIf->identityManager(), QOverload<>::of(&KIdentityManagement::IdentityManager::changed), this, &FolderSettings::slotIdentitiesChanged);
connect(KernelIf->identityManager(), qOverload<>(&KIdentityManagement::IdentityManager::changed), this, &FolderSettings::slotIdentitiesChanged);
}
FolderSettings::~FolderSettings()
......
......@@ -613,7 +613,7 @@ void SearchPatternEdit::initLayout(SearchPatternEditOptions options, SearchModeT
}
//------------connect a few signals
connect(bg, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &SearchPatternEdit::slotRadioClicked);
connect(bg, qOverload<QAbstractButton *>(&QButtonGroup::buttonClicked), this, &SearchPatternEdit::slotRadioClicked);
//------------the list of SearchRuleWidget's
mRuleLister = new SearchRuleWidgetLister(this, options, modeType);
......@@ -632,8 +632,8 @@ void SearchPatternEdit::initLayout(SearchPatternEditOptions options, SearchModeT
qCDebug(MAILCOMMON_LOG) << "No first SearchRuleWidget, though slotClear() has been called!";
}
connect(mRuleLister, QOverload<QWidget *>::of(&SearchRuleWidgetLister::widgetAdded), this, &SearchPatternEdit::slotRuleAdded);
connect(mRuleLister, QOverload<>::of(&SearchRuleWidgetLister::widgetRemoved), this, &SearchPatternEdit::patternChanged);
connect(mRuleLister, qOverload<QWidget *>(&SearchRuleWidgetLister::widgetAdded), this, &SearchPatternEdit::slotRuleAdded);
connect(mRuleLister, qOverload<>(&SearchRuleWidgetLister::widgetRemoved), this, &SearchPatternEdit::patternChanged);
connect(mRuleLister, &KPIM::KWidgetLister::clearWidgets, this, &SearchPatternEdit::patternChanged);
layout->addRow(mRuleLister);
......
......@@ -62,7 +62,7 @@ SnippetWidget::SnippetWidget(QWidget *parent)
Q_EMIT textChanged(str);
d->wasChanged = true;
});
connect(d->mUi.groupBox, QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this](int index) {
connect(d->mUi.groupBox, qOverload<int>(&QComboBox::currentIndexChanged), this, [this](int index) {
Q_EMIT groupChanged(index);
d->wasChanged = true;
});
......
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