Commit f8b18510 authored by Laurent Montel's avatar Laurent Montel 😁

use qoverload

parent c3172733
......@@ -76,7 +76,7 @@ void SelectConvertParameterWidget::initialize()
mWidth->setMaximum(9999);
mWidth->setValue(300);
hbox->addWidget(mWidth);
connect(mWidth, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SelectConvertParameterWidget::valueChanged);
connect(mWidth, QOverload<int>::of(&QSpinBox::valueChanged), this, &SelectConvertParameterWidget::valueChanged);
QLabel *lab = new QLabel(QStringLiteral("x"));
hbox->addWidget(lab);
......@@ -88,7 +88,7 @@ void SelectConvertParameterWidget::initialize()
mHeight->setValue(200);
hbox->addWidget(mHeight);
connect(mHeight, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SelectConvertParameterWidget::valueChanged);
connect(mHeight, QOverload<int>::of(&QSpinBox::valueChanged), this, &SelectConvertParameterWidget::valueChanged);
setLayout(hbox);
}
}
......@@ -29,7 +29,7 @@ SelectMatchTypeComboBox::SelectMatchTypeComboBox(SieveEditorGraphicalModeWidget
{
mHasRegexCapability = sieveGraphicalModeWidget->sieveCapabilities().contains(QStringLiteral("regex"));
initialize();
connect(this, static_cast<void (SelectMatchTypeComboBox::*)(int)>(&SelectMatchTypeComboBox::activated), this, &SelectMatchTypeComboBox::slotValueChanged);
connect(this, QOverload<int>::of(&SelectMatchTypeComboBox::activated), this, &SelectMatchTypeComboBox::slotValueChanged);
}
SelectMatchTypeComboBox::~SelectMatchTypeComboBox()
......
......@@ -27,7 +27,7 @@ SelectMimeTypeComboBox::SelectMimeTypeComboBox(QWidget *parent)
: KComboBox(parent)
{
initialize();
connect(this, static_cast<void (SelectMimeTypeComboBox::*)(int)>(&SelectMimeTypeComboBox::activated), this, &SelectMimeTypeComboBox::valueChanged);
connect(this, QOverload<int>::of(&SelectMimeTypeComboBox::activated), this, &SelectMimeTypeComboBox::valueChanged);
}
SelectMimeTypeComboBox::~SelectMimeTypeComboBox()
......
......@@ -49,7 +49,7 @@ QWidget *SieveActionExtractText::createParamWidget(QWidget *parent) const
nbCharacters->setMaximum(99999);
nbCharacters->setObjectName(QStringLiteral("numberOfCharacters"));
grid->addWidget(nbCharacters, 0, 1);
connect(nbCharacters, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SieveActionExtractText::valueChanged);
connect(nbCharacters, QOverload<int>::of(&QSpinBox::valueChanged), this, &SieveActionExtractText::valueChanged);
lab = new QLabel(i18n("Stored in variable name:"));
grid->addWidget(lab, 1, 0);
......
......@@ -62,7 +62,7 @@ QWidget *SieveActionVacation::createParamWidget(QWidget *parent) const
day->setMinimum(1);
day->setMaximum(999);
day->setObjectName(QStringLiteral("day"));
connect(day, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SieveActionVacation::valueChanged);
connect(day, QOverload<int>::of(&QSpinBox::valueChanged), this, &SieveActionVacation::valueChanged);
grid->addWidget(day, 0, 1);
lab = new QLabel(i18n("Message subject:"));
......
......@@ -27,7 +27,7 @@ SelectAddHeaderPositionCombobox::SelectAddHeaderPositionCombobox(QWidget *parent
: KComboBox(parent)
{
initialize();
connect(this, static_cast<void (SelectAddHeaderPositionCombobox::*)(int)>(&SelectAddHeaderPositionCombobox::activated), this, &SelectAddHeaderPositionCombobox::valueChanged);
connect(this, QOverload<int>::of(&SelectAddHeaderPositionCombobox::activated), this, &SelectAddHeaderPositionCombobox::valueChanged);
}
SelectAddHeaderPositionCombobox::~SelectAddHeaderPositionCombobox()
......
......@@ -28,7 +28,7 @@ SelectImportanceCombobox::SelectImportanceCombobox(QWidget *parent)
: KComboBox(parent)
{
initialize();
connect(this, static_cast<void (SelectImportanceCombobox::*)(int)>(&SelectImportanceCombobox::activated), this, &SelectImportanceCombobox::valueChanged);
connect(this, QOverload<int>::of(&SelectImportanceCombobox::activated), this, &SelectImportanceCombobox::valueChanged);
}
SelectImportanceCombobox::~SelectImportanceCombobox()
......
......@@ -27,7 +27,7 @@ SelectVacationComboBox::SelectVacationComboBox(QWidget *parent)
: KComboBox(parent)
{
initialize();
connect(this, static_cast<void (SelectVacationComboBox::*)(int)>(&SelectVacationComboBox::activated), this, &SelectVacationComboBox::valueChanged);
connect(this, QOverload<int>::of(&SelectVacationComboBox::activated), this, &SelectVacationComboBox::valueChanged);
}
SelectVacationComboBox::~SelectVacationComboBox()
......
......@@ -27,7 +27,7 @@ SelectVariableModifierComboBox::SelectVariableModifierComboBox(QWidget *parent)
: KComboBox(parent)
{
initialize();
connect(this, static_cast<void (SelectVariableModifierComboBox::*)(int)>(&SelectVariableModifierComboBox::activated), this, &SelectVariableModifierComboBox::valueChanged);
connect(this, QOverload<int>::of(&SelectVariableModifierComboBox::activated), this, &SelectVariableModifierComboBox::valueChanged);
}
SelectVariableModifierComboBox::~SelectVariableModifierComboBox()
......
......@@ -166,7 +166,7 @@ void SieveActionWidget::initWidget()
updateGeometry();
connect(mComboBox, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::activated), this, &SieveActionWidget::slotActionChanged);
connect(mComboBox, QOverload<int>::of(&PimCommon::MinimumComboBox::activated), this, &SieveActionWidget::slotActionChanged);
mAdd = new QPushButton(this);
mAdd->setIcon(QIcon::fromTheme(QStringLiteral("list-add")));
......
......@@ -48,7 +48,7 @@ QWidget *SieveConditionExists::createParamWidget(QWidget *parent) const
combo->addItem(i18n("exists"), QStringLiteral("exists"));
combo->addItem(i18n("not exists"), QStringLiteral("not exists"));
lay->addWidget(combo);
connect(combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &SieveConditionExists::valueChanged);
connect(combo, QOverload<int>::of(&QComboBox::activated), this, &SieveConditionExists::valueChanged);
QLabel *lab = new QLabel(i18n("headers:"));
lay->addWidget(lab);
......
......@@ -46,7 +46,7 @@ QWidget *SieveConditionSize::createParamWidget(QWidget *parent) const
combo->addItem(i18n("under"), QStringLiteral(":under"));
combo->addItem(i18n("over"), QStringLiteral(":over"));
lay->addWidget(combo);
connect(combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::activated), this, &SieveConditionSize::valueChanged);
connect(combo, QOverload<int>::of(&QComboBox::activated), this, &SieveConditionSize::valueChanged);
SelectSizeWidget *sizeWidget = new SelectSizeWidget;
connect(sizeWidget, &SelectSizeWidget::valueChanged, this, &SieveConditionSize::valueChanged);
......
......@@ -67,7 +67,7 @@ QWidget *SieveConditionSpamTest::createParamWidget(QWidget *parent) const
spinbox->setMaximum(10);
spinbox->setMinimum(0);
spinbox->setObjectName(QStringLiteral("value"));
connect(spinbox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SieveConditionSpamTest::valueChanged);
connect(spinbox, QOverload<int>::of(&QSpinBox::valueChanged), this, &SieveConditionSpamTest::valueChanged);
lay->addWidget(spinbox);
return w;
}
......
......@@ -57,7 +57,7 @@ QWidget *SieveConditionVirusTest::createParamWidget(QWidget *parent) const
spinbox->setMaximum(5);
spinbox->setMinimum(0);
spinbox->setObjectName(QStringLiteral("value"));
connect(spinbox, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SieveConditionVirusTest::valueChanged);
connect(spinbox, QOverload<int>::of(&QSpinBox::valueChanged), this, &SieveConditionVirusTest::valueChanged);
lay->addWidget(spinbox);
return w;
}
......
......@@ -29,7 +29,7 @@ SelectAddressPartComboBox::SelectAddressPartComboBox(SieveEditorGraphicalModeWid
{
mHasSubaddressCapability = sieveGraphicalModeWidget->sieveCapabilities().contains(QStringLiteral("subaddress"));
initialize();
connect(this, static_cast<void (SelectAddressPartComboBox::*)(int)>(&SelectAddressPartComboBox::activated), this, &SelectAddressPartComboBox::valueChanged);
connect(this, QOverload<int>::of(&SelectAddressPartComboBox::activated), this, &SelectAddressPartComboBox::valueChanged);
}
SelectAddressPartComboBox::~SelectAddressPartComboBox()
......
......@@ -48,7 +48,7 @@ void SelectBodyTypeWidget::initialize()
mBodyCombobox->addItem(i18n("raw"), QStringLiteral(":raw"));
mBodyCombobox->addItem(i18n("content"), QStringLiteral(":content"));
mBodyCombobox->addItem(i18n("text"), QStringLiteral(":text"));
connect(mBodyCombobox, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated), this, &SelectBodyTypeWidget::slotBodyTypeChanged);
connect(mBodyCombobox, QOverload<int>::of(&KComboBox::activated), this, &SelectBodyTypeWidget::slotBodyTypeChanged);
mBodyLineEdit = new QLineEdit;
connect(mBodyLineEdit, &QLineEdit::textChanged, this, &SelectBodyTypeWidget::valueChanged);
......
......@@ -24,7 +24,7 @@ using namespace KSieveUi;
SelectComparatorComboBox::SelectComparatorComboBox(SieveEditorGraphicalModeWidget *sieveGraphicalModeWidget, QWidget *parent)
: QComboBox(parent)
{
connect(this, static_cast<void (SelectComparatorComboBox::*)(int)>(&SelectComparatorComboBox::activated), this, &SelectComparatorComboBox::valueChanged);
connect(this, QOverload<int>::of(&SelectComparatorComboBox::activated), this, &SelectComparatorComboBox::valueChanged);
initialize(sieveGraphicalModeWidget->sieveCapabilities());
}
......
......@@ -49,7 +49,7 @@ void SelectDateWidget::initialize()
lay->setMargin(0);
mDateType = new KComboBox;
connect(mDateType, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated), this, &SelectDateWidget::slotDateTypeActivated);
connect(mDateType, QOverload<int>::of(&KComboBox::activated), this, &SelectDateWidget::slotDateTypeActivated);
mDateType->addItem(i18n("Year"), QVariant::fromValue(KSieveUi::SelectDateWidget::Year));
mDateType->addItem(i18n("Month"), QVariant::fromValue(KSieveUi::SelectDateWidget::Month));
mDateType->addItem(i18n("Day"), QVariant::fromValue(KSieveUi::SelectDateWidget::Day));
......@@ -77,7 +77,7 @@ void SelectDateWidget::initialize()
mDateValue = new SieveDateSpinBox;
mStackWidget->addWidget(mDateValue);
connect(mDateValue, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SelectDateWidget::valueChanged);
connect(mDateValue, QOverload<int>::of(&QSpinBox::valueChanged), this, &SelectDateWidget::valueChanged);
mDateEdit = new KDateComboBox;
mStackWidget->addWidget(mDateEdit);
......
......@@ -210,9 +210,9 @@ SelectHeaderTypeComboBox::SelectHeaderTypeComboBox(bool onlyEnvelopType, QWidget
lineEdit()->setClearButtonEnabled(true);
//TODO add completion
initialize(onlyEnvelopType);
connect(this, static_cast<void (SelectHeaderTypeComboBox::*)(const QString &)>(&SelectHeaderTypeComboBox::activated), this, &SelectHeaderTypeComboBox::slotSelectItem);
connect(this, QOverload<const QString &>::of(&SelectHeaderTypeComboBox::activated), this, &SelectHeaderTypeComboBox::slotSelectItem);
connect(this, &SelectHeaderTypeComboBox::editTextChanged, this, &SelectHeaderTypeComboBox::valueChanged);
connect(this, static_cast<void (SelectHeaderTypeComboBox::*)(int)>(&SelectHeaderTypeComboBox::activated), this, &SelectHeaderTypeComboBox::valueChanged);
connect(this, QOverload<int>::of(&SelectHeaderTypeComboBox::activated), this, &SelectHeaderTypeComboBox::valueChanged);
}
SelectHeaderTypeComboBox::~SelectHeaderTypeComboBox()
......
......@@ -27,7 +27,7 @@ SelectMimeComboBox::SelectMimeComboBox(QWidget *parent)
: QComboBox(parent)
{
initialize();
connect(this, static_cast<void (SelectMimeComboBox::*)(int)>(&SelectMimeComboBox::activated), this, &SelectMimeComboBox::valueChanged);
connect(this, QOverload<int>::of(&SelectMimeComboBox::activated), this, &SelectMimeComboBox::valueChanged);
}
SelectMimeComboBox::~SelectMimeComboBox()
......
......@@ -70,7 +70,7 @@ void SelectRelationalMatchType::initialize()
mType->addItem(i18n("Value"), QStringLiteral(":value"));
mType->addItem(i18n("Count"), QStringLiteral(":count"));
lay->addWidget(mType);
connect(mType, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated), this, &SelectRelationalMatchType::valueChanged);
connect(mType, QOverload<int>::of(&KComboBox::activated), this, &SelectRelationalMatchType::valueChanged);
mMatch = new KComboBox;
mMatch->addItem(i18n("Greater than"), QStringLiteral("gt"));
......@@ -79,6 +79,6 @@ void SelectRelationalMatchType::initialize()
mMatch->addItem(i18n("Less than or equal"), QStringLiteral("le"));
mMatch->addItem(i18n("Equal to"), QStringLiteral("eq"));
mMatch->addItem(i18n("Not equal to"), QStringLiteral("ne"));
connect(mMatch, static_cast<void (KComboBox::*)(int)>(&KComboBox::activated), this, &SelectRelationalMatchType::valueChanged);
connect(mMatch, QOverload<int>::of(&KComboBox::activated), this, &SelectRelationalMatchType::valueChanged);
lay->addWidget(mMatch);
}
......@@ -27,7 +27,7 @@ SelectSizeTypeComboBox::SelectSizeTypeComboBox(QWidget *parent)
: QComboBox(parent)
{
initialize();
connect(this, static_cast<void (SelectSizeTypeComboBox::*)(int)>(&SelectSizeTypeComboBox::activated), this, &SelectSizeTypeComboBox::valueChanged);
connect(this, QOverload<int>::of(&SelectSizeTypeComboBox::activated), this, &SelectSizeTypeComboBox::valueChanged);
}
SelectSizeTypeComboBox::~SelectSizeTypeComboBox()
......
......@@ -35,7 +35,7 @@ SelectSizeWidget::SelectSizeWidget(QWidget *parent)
mSpinBoxSize->setMinimum(1);
mSpinBoxSize->setMaximum(99999);
hbox->addWidget(mSpinBoxSize);
connect(mSpinBoxSize, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &SelectSizeWidget::valueChanged);
connect(mSpinBoxSize, QOverload<int>::of(&QSpinBox::valueChanged), this, &SelectSizeWidget::valueChanged);
mSelectSizeType = new SelectSizeTypeComboBox;
connect(mSelectSizeType, &SelectSizeTypeComboBox::valueChanged, this, &SelectSizeWidget::valueChanged);
......
......@@ -130,7 +130,7 @@ void SieveConditionWidget::initWidget()
mComboBox->addItem(QLatin1String(""));
mLayout->addWidget(mComboBox, 1, 2);
connect(mComboBox, static_cast<void (PimCommon::MinimumComboBox::*)(int)>(&PimCommon::MinimumComboBox::activated), this, &SieveConditionWidget::slotConditionChanged);
connect(mComboBox, QOverload<int>::of(&PimCommon::MinimumComboBox::activated), this, &SieveConditionWidget::slotConditionChanged);
mComboBox->setMaxCount(mComboBox->count());
mComboBox->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed));
......
......@@ -64,7 +64,7 @@ SieveScriptBlockWidget::SieveScriptBlockWidget(SieveEditorGraphicalModeWidget *g
bg->addButton(mMatchAny);
bg->addButton(mAllMessageRBtn);
connect(bg, static_cast<void (QButtonGroup::*)(QAbstractButton *)>(&QButtonGroup::buttonClicked), this, &SieveScriptBlockWidget::slotRadioClicked);
connect(bg, QOverload<QAbstractButton *>::of(&QButtonGroup::buttonClicked), this, &SieveScriptBlockWidget::slotRadioClicked);
mConditions->setLayout(vbox);
mScriptConditionLister = new SieveConditionWidgetLister(mSieveGraphicalModeWidget, this);
......
......@@ -391,8 +391,7 @@ void SieveEditorTextModeWidget::printPreview()
bool restoreSpellCheck = mTextEdit->checkSpellingEnabled();
mTextEdit->setCheckSpellingEnabled(false);
PimCommon::KPimPrintPreviewDialog previewdlg(this);
connect(&previewdlg, &QPrintPreviewDialog::paintRequested, this, [this](QPrinter *printer) {
mTextEdit->print(printer);
connect(&previewdlg, &QPrintPreviewDialog::paintRequested, this, [this](QPrinter *printer) { mTextEdit->print(printer);
});
previewdlg.exec();
mTextEdit->setCheckSpellingEnabled(restoreSpellCheck);
......
......@@ -151,7 +151,7 @@ VacationEditWidget::VacationEditWidget(QWidget *parent)
mIntervalSpin->setValue(defDayInterval);
mIntervalSpin->setObjectName(QStringLiteral("mIntervalSpin"));
mIntervalSpin->setSuffix(i18np(" day", " days", defDayInterval));
connect(mIntervalSpin, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged), this, &VacationEditWidget::slotIntervalSpinChanged);
connect(mIntervalSpin, QOverload<int>::of(&QSpinBox::valueChanged), this, &VacationEditWidget::slotIntervalSpinChanged);
QLabel *resendNotificationLabel = new QLabel(i18n("&Resend notification only after:"), this);
resendNotificationLabel->setObjectName(QStringLiteral("resendNotificationLabel"));
resendNotificationLabel->setBuddy(mIntervalSpin);
......@@ -175,7 +175,7 @@ VacationEditWidget::VacationEditWidget(QWidget *parent)
mMailAction->addItem(VacationUtils::mailAction((VacationUtils::MailAction)i));
}
mMailAction->setObjectName(QStringLiteral("mMailAction"));
connect(mMailAction, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged), this, &VacationEditWidget::mailActionChanged);
connect(mMailAction, QOverload<int>::of(&QComboBox::currentIndexChanged), this, &VacationEditWidget::mailActionChanged);
mMailActionRecipient = new QLineEdit(this);
mMailActionRecipient->setObjectName(QStringLiteral("mMailActionRecipient"));
......
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