Commit 4e0a6436 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Use qoverload

parent 4f2b3fb5
......@@ -73,7 +73,7 @@ void CollectionExpiryPage::init()
expireReadMailSB->setValue(30);
expireReadMailSB->setSuffix(ki18ncp("Expire messages after %1", " day", " days"));
daysBox->addWidget(expireReadMailSB, 0, 1);
connect(expireReadMailSB, static_cast<void (KPluralHandlingSpinBox::*)(int)>(&KPluralHandlingSpinBox::valueChanged), this, &CollectionExpiryPage::slotChanged);
connect(expireReadMailSB, QOverload<int>::of(&KPluralHandlingSpinBox::valueChanged), this, &CollectionExpiryPage::slotChanged);
expireUnreadMailCB = new QCheckBox;
expireUnreadMailCB->setText(i18n("Expire unread messages after"));
......@@ -85,7 +85,7 @@ void CollectionExpiryPage::init()
expireUnreadMailSB->setValue(30);
expireUnreadMailSB->setSuffix(ki18ncp("Expire messages after %1", " day", " days"));
daysBox->addWidget(expireUnreadMailSB, 1, 1);
connect(expireUnreadMailSB, static_cast<void (KPluralHandlingSpinBox::*)(int)>(&KPluralHandlingSpinBox::valueChanged), this, &CollectionExpiryPage::slotChanged);
connect(expireUnreadMailSB, QOverload<int>::of(&KPluralHandlingSpinBox::valueChanged), this, &CollectionExpiryPage::slotChanged);
daysBox->setColumnStretch(3, 1);
globalVBox->addLayout(daysBox);
......
......@@ -29,8 +29,8 @@ SelectThunderbirdFilterFilesWidget::SelectThunderbirdFilterFilesWidget(const QSt
, ui(new Ui::SelectThunderbirdFilterFilesWidget)
{
ui->setupUi(this);
connect(ui->buttonGroup, static_cast<void (QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), this, &SelectThunderbirdFilterFilesWidget::slotButtonClicked);
connect(ui->profiles, static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this, &SelectThunderbirdFilterFilesWidget::slotProfileChanged);
connect(ui->buttonGroup, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &SelectThunderbirdFilterFilesWidget::slotButtonClicked);
connect(ui->profiles, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &SelectThunderbirdFilterFilesWidget::slotProfileChanged);
ui->listFiles->setSelectionMode(QAbstractItemView::MultiSelection);
QString defaultProfile;
......
......@@ -103,7 +103,7 @@ QWidget *FilterActionAddHeader::createParamWidget(QWidget *parent) const
setParamWidgetValue(widget);
connect(comboBox, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionAddHeader::filterActionModified);
connect(comboBox, QOverload<int>::of(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionAddHeader::filterActionModified);
connect(comboBox->lineEdit(), &QLineEdit::textChanged,
this, &FilterAction::filterActionModified);
connect(lineEdit, &QLineEdit::textChanged, this, &FilterActionAddHeader::filterActionModified);
......
......@@ -53,7 +53,7 @@ QWidget *FilterActionAddTag::createParamWidget(QWidget *parent) const
setParamWidgetValue(mComboBox);
connect(mComboBox, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionAddTag::filterActionModified);
connect(mComboBox, QOverload<int>::of(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionAddTag::filterActionModified);
return mComboBox;
}
......
......@@ -142,8 +142,8 @@ QWidget *FilterActionAddToAddressBook::createParamWidget(QWidget *parent) const
"If it is not accessible, the filter will fallback to the default address book.</p>"));
layout->addWidget(collectionComboBox, 1, 2);
connect(headerCombo, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionAddToAddressBook::filterActionModified);
connect(collectionComboBox, static_cast<void (Akonadi::CollectionComboBox::*)(int)>(&Akonadi::CollectionComboBox::activated), this, &FilterActionAddToAddressBook::filterActionModified);
connect(headerCombo, QOverload<int>::of(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionAddToAddressBook::filterActionModified);
connect(collectionComboBox, QOverload<int>::of(&Akonadi::CollectionComboBox::activated), this, &FilterActionAddToAddressBook::filterActionModified);
connect(categoryEdit, SIGNAL(selectionChanged(QStringList)),
this, SIGNAL(filterActionModified()));
......@@ -192,8 +192,7 @@ void FilterActionAddToAddressBook::applyParamWidgetValue(QWidget *paramWidget)
// we use the previously 'stored' value from the 'collectionId' property
if (collection.isValid()) {
mCollectionId = collection.id();
connect(collectionComboBox, static_cast<void (Akonadi::CollectionComboBox::*)(
int)>(&Akonadi::CollectionComboBox::currentIndexChanged), this, &FilterActionAddToAddressBook::filterActionModified);
connect(collectionComboBox, QOverload< int>::of(&Akonadi::CollectionComboBox::currentIndexChanged), this, &FilterActionAddToAddressBook::filterActionModified);
} else {
const QVariant value = collectionComboBox->property("collectionId");
if (value.isValid()) {
......
......@@ -124,7 +124,7 @@ QWidget *FilterActionForward::createParamWidget(QWidget *parent) const
templateCombo->setToolTip(i18n("The template used when forwarding"));
templateCombo->setWhatsThis(i18n("Set the forwarding template that will be used with this filter."));
connect(templateCombo, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionForward::filterActionModified);
connect(templateCombo, QOverload<int>::of(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionForward::filterActionModified);
connect(addressRequester, &Akonadi::EmailAddressRequester::textChanged, this, &FilterActionForward::filterActionModified);
return addressAndTemplate;
......
......@@ -51,7 +51,7 @@ QWidget *FilterActionRemoveHeader::createParamWidget(QWidget *parent) const
comboBox->setInsertPolicy(QComboBox::InsertAtBottom);
setParamWidgetValue(comboBox);
connect(comboBox, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionRemoveHeader::filterActionModified);
connect(comboBox, QOverload<int>::of(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionRemoveHeader::filterActionModified);
connect(comboBox->lineEdit(), &QLineEdit::textChanged,
this, &FilterAction::filterActionModified);
......
......@@ -149,7 +149,7 @@ QWidget *FilterActionRewriteHeader::createParamWidget(QWidget *parent) const
setParamWidgetValue(widget);
connect(comboBox, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionRewriteHeader::filterActionModified);
connect(comboBox, QOverload<int>::of(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionRewriteHeader::filterActionModified);
connect(comboBox->lineEdit(), &QLineEdit::textChanged,
this, &FilterAction::filterActionModified);
connect(regExpLineEdit, &KLineEdit::textChanged, this, &FilterActionRewriteHeader::filterActionModified);
......
......@@ -106,7 +106,7 @@ QWidget *FilterActionSetIdentity::createParamWidget(QWidget *parent) const
comboBox->setObjectName(QStringLiteral("identitycombobox"));
comboBox->setCurrentIdentity(mParameter);
connect(comboBox, static_cast<void (KIdentityManagement::IdentityCombo::*)(int)>(&KIdentityManagement::IdentityCombo::currentIndexChanged), this, &FilterActionSetIdentity::filterActionModified);
connect(comboBox, QOverload<int>::of(&KIdentityManagement::IdentityCombo::currentIndexChanged), this, &FilterActionSetIdentity::filterActionModified);
return comboBox;
}
......
......@@ -42,8 +42,7 @@ QWidget *FilterActionSetTransport::createParamWidget(QWidget *parent) const
transportCombobox->setObjectName(QStringLiteral("transportcombobox"));
setParamWidgetValue(transportCombobox);
connect(transportCombobox, static_cast<void (MailTransport::TransportComboBox::*)(int)>(&MailTransport::TransportComboBox::currentIndexChanged), this,
&FilterActionSetTransport::filterActionModified);
connect(transportCombobox, QOverload<int>::of(&MailTransport::TransportComboBox::currentIndexChanged), this, &FilterActionSetTransport::filterActionModified);
return transportCombobox;
}
......
......@@ -173,7 +173,7 @@ FilterActionWidget::FilterActionWidget(QWidget *parent)
connect(d->mComboBox, SIGNAL(activated(int)),
this, SLOT(slotFilterTypeChanged(int)));
connect(d->mComboBox, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated), this, &FilterActionWidget::filterModified);
connect(d->mComboBox, QOverload<int>::of(&KComboBox::activated), this, &FilterActionWidget::filterModified);
connect(d->mAdd, SIGNAL(clicked()),
this, SLOT(slotAddWidget()));
......
......@@ -36,7 +36,7 @@ QWidget *FilterActionWithStringList::createParamWidget(QWidget *parent) const
comboBox->addItems(mParameterList);
setParamWidgetValue(comboBox);
connect(comboBox, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionWithStringList::filterActionModified);
connect(comboBox, QOverload<int>::of(&PimCommon::MinimumComboBox::currentIndexChanged), this, &FilterActionWithStringList::filterActionModified);
return comboBox;
}
......
......@@ -47,7 +47,7 @@ SnippetDialog::SnippetDialog(KActionCollection *actionCollection, bool inGroupMo
mOkButton->setEnabled(false);
connect(mUi->nameEdit, &KLineEdit::textChanged, this, &SnippetDialog::slotTextChanged);
connect(mUi->groupBox, static_cast<void (KComboBox::*)(const QString &)>(&KComboBox::currentIndexChanged), this, &SnippetDialog::slotGroupChanged);
connect(mUi->groupBox, QOverload<const QString &>::of(&KComboBox::currentIndexChanged), this, &SnippetDialog::slotGroupChanged);
mUi->snippetText->setMinimumSize(500, 300);
......
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