Commit 3eb30e2a authored by Laurent Montel's avatar Laurent Montel 😁

Use QOverload

parent 0a8b01f5
......@@ -93,14 +93,8 @@ AttachmentEditDialog::AttachmentEditDialog(AttachmentIconItem *item, QWidget *pa
connect(mUi->mInlineCheck, &QCheckBox::stateChanged, this,
&AttachmentEditDialog::inlineChanged);
connect(mUi->mURLRequester,
static_cast<void (KUrlRequester::*)(const QUrl &)>(&KUrlRequester::urlSelected),
this,
static_cast<void (AttachmentEditDialog::*)(const QUrl &)>(&AttachmentEditDialog::
urlChanged));
connect(mUi->mURLRequester, &KUrlRequester::textChanged,
this,
static_cast<void (AttachmentEditDialog::*)(const QString &)>(&AttachmentEditDialog::
connect(mUi->mURLRequester, QOverload<const QUrl &>::of(&KUrlRequester::urlSelected), this, static_cast<void (AttachmentEditDialog::*)(const QUrl &)>(&AttachmentEditDialog:: urlChanged));
connect(mUi->mURLRequester, &KUrlRequester::textChanged, this, static_cast<void (AttachmentEditDialog::*)(const QString &)>(&AttachmentEditDialog::
urlChanged));
}
......
......@@ -39,14 +39,8 @@ void AttendeeEditor::slotLineAdded(KPIM::MultiplyingLine *line)
return;
}
connect(att,
static_cast<void (AttendeeLine::*)()>(&AttendeeLine::changed), this,
&AttendeeEditor::slotCalculateTotal);
connect(att,
static_cast<void (AttendeeLine::*)(const KCalCore::Attendee::Ptr &,
const KCalCore::Attendee::Ptr &)>(&AttendeeLine::
changed), this,
&AttendeeEditor::changed);
connect(att, QOverload<>::of(&AttendeeLine::changed), this, &AttendeeEditor::slotCalculateTotal);
connect(att, QOverload<const KCalCore::Attendee::Ptr &, const KCalCore::Attendee::Ptr &>::of(&AttendeeLine:: changed), this, &AttendeeEditor::changed);
connect(att, &AttendeeLine::editingFinished, this, &AttendeeEditor::editingFinished);
}
......
......@@ -129,11 +129,9 @@ IncidenceAttendee::IncidenceAttendee(QWidget *parent, IncidenceDateTime *dateTim
connect(mUi->mSolveButton, &QPushButton::clicked, this,
&IncidenceAttendee::slotSolveConflictPressed);
/* Added as part of kolab/issue2297, which is currently under review
connect(mUi->mOrganizerCombo, static_cast<void (KComboBox::*)(const QString &)>(&KComboBox::activated), this, &IncidenceAttendee::slotOrganizerChanged);
connect(mUi->mOrganizerCombo, QOverload<const QString &>::of(&KComboBox::activated), this, &IncidenceAttendee::slotOrganizerChanged);
*/
connect(mUi->mOrganizerCombo,
static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this,
&IncidenceAttendee::checkDirtyStatus);
connect(mUi->mOrganizerCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &IncidenceAttendee::checkDirtyStatus);
connect(mDateTime, &IncidenceDateTime::startDateChanged, this,
&IncidenceAttendee::slotEventDurationChanged);
......
......@@ -71,10 +71,7 @@ IncidenceCompletionPriority::IncidenceCompletionPriority(Ui::EventOrTodoDesktop
d->mUi->mTaskSeparator->hide();
connect(d->mUi->mCompletionSlider, SIGNAL(valueChanged(int)), SLOT(sliderValueChanged(int)));
connect(d->mUi->mPriorityCombo,
static_cast<void (KComboBox::*)(
int)>(&KComboBox::currentIndexChanged), this,
&IncidenceCompletionPriority::checkDirtyStatus);
connect(d->mUi->mPriorityCombo, QOverload< int>::of(&KComboBox::currentIndexChanged), this, &IncidenceCompletionPriority::checkDirtyStatus);
}
IncidenceCompletionPriority::~IncidenceCompletionPriority()
......
......@@ -105,35 +105,20 @@ IncidenceRecurrence::IncidenceRecurrence(IncidenceDateTime *dateTime, Ui::EventO
&IncidenceRecurrence::handleExceptionDateChange);
connect(mUi->mExceptionList, &QListWidget::itemSelectionChanged, this,
&IncidenceRecurrence::updateRemoveExceptionButton);
connect(mUi->mRecurrenceTypeCombo,
static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this,
&IncidenceRecurrence::handleRecurrenceTypeChange);
connect(mUi->mEndDurationEdit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &IncidenceRecurrence::handleEndAfterOccurrencesChange);
connect(mUi->mFrequencyEdit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &IncidenceRecurrence::handleFrequencyChange);
connect(mUi->mRecurrenceTypeCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &IncidenceRecurrence::handleRecurrenceTypeChange);
connect(mUi->mEndDurationEdit, QOverload<int>::of(&QSpinBox::valueChanged), this, &IncidenceRecurrence::handleEndAfterOccurrencesChange);
connect(mUi->mFrequencyEdit, QOverload<int>::of(&QSpinBox::valueChanged), this, &IncidenceRecurrence::handleFrequencyChange);
// Check the dirty status when the user changes values.
connect(mUi->mRecurrenceTypeCombo,
static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this,
&IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mFrequencyEdit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mFrequencyEdit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mRecurrenceTypeCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mFrequencyEdit, QOverload<int>::of(&QSpinBox::valueChanged), this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mFrequencyEdit, QOverload<int>::of(&QSpinBox::valueChanged), this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mWeekDayCombo, &KPIM::KWeekdayCheckCombo::checkedItemsChanged, this,
&IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mMonthlyCombo,
static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this,
&IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mYearlyCombo,
static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this,
&IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mRecurrenceEndCombo,
static_cast<void (KComboBox::*)(int)>(&KComboBox::currentIndexChanged), this,
&IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mEndDurationEdit, static_cast<void (QSpinBox::*)(int)>(&QSpinBox::valueChanged),
this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mMonthlyCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mYearlyCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mRecurrenceEndCombo, QOverload<int>::of(&KComboBox::currentIndexChanged), this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mEndDurationEdit, QOverload<int>::of(&QSpinBox::valueChanged), this, &IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mRecurrenceEndDate, &KDateComboBox::dateChanged, this,
&IncidenceRecurrence::checkDirtyStatus);
connect(mUi->mThisAndFutureCheck, &QCheckBox::stateChanged, this,
......
......@@ -30,10 +30,7 @@ IncidenceSecrecy::IncidenceSecrecy(Ui::EventOrTodoDesktop *ui)
{
setObjectName(QStringLiteral("IncidenceSecrecy"));
mUi->mSecrecyCombo->addItems(KCalUtils::Stringify::incidenceSecrecyList());
connect(mUi->mSecrecyCombo,
static_cast<void (KComboBox::*)(
int)>(&KComboBox::currentIndexChanged), this,
&IncidenceSecrecy::checkDirtyStatus);
connect(mUi->mSecrecyCombo, QOverload< int>::of(&KComboBox::currentIndexChanged), this, &IncidenceSecrecy::checkDirtyStatus);
}
void IncidenceSecrecy::load(const KCalCore::Incidence::Ptr &incidence)
......
......@@ -45,22 +45,8 @@ ResourceModel::ResourceModel(const QStringList &headers, QObject *parent)
ldapSearchCollections.setAttributes(attrs);
ldapSearch.setAttributes(headers);
connect(&ldapSearchCollections,
static_cast<void (KLDAP::LdapClientSearch::*)(const KLDAP::LdapResultObject::List &)>(&
KLDAP
::
LdapClientSearch
::
searchData), this,
&ResourceModel::slotLDAPCollectionData);
connect(&ldapSearch,
static_cast<void (KLDAP::LdapClientSearch::*)(const KLDAP::LdapResultObject::List &)>(&
KLDAP
::
LdapClientSearch
::
searchData), this,
&ResourceModel::slotLDAPSearchData);
connect(&ldapSearchCollections, QOverload<const KLDAP::LdapResultObject::List &>::of(& KLDAP :: LdapClientSearch :: searchData), this, &ResourceModel::slotLDAPCollectionData);
connect(&ldapSearch, QOverload<const KLDAP::LdapResultObject::List &>::of(& KLDAP :: LdapClientSearch :: searchData), this, &ResourceModel::slotLDAPSearchData);
ldapSearchCollections.startSearch(QStringLiteral("*"));
}
......
......@@ -176,9 +176,7 @@ VisualFreeBusyWidget::VisualFreeBusyWidget(CalendarSupport::FreeBusyItemModel *m
mScaleCombo->addItem(i18nc("@item:inlistbox range is computed automatically", "Automatic"),
QVariant::fromValue<int>(KGantt::DateTimeGrid::ScaleAuto));
mScaleCombo->setCurrentIndex(0); // start with "hour"
connect(mScaleCombo, static_cast<void (KComboBox::*)(
int)>(&KComboBox::activated), this,
&VisualFreeBusyWidget::slotScaleChanged);
connect(mScaleCombo, QOverload< int>::of(&KComboBox::activated), this, &VisualFreeBusyWidget::slotScaleChanged);
controlLayout->addWidget(mScaleCombo);
QPushButton *button = new QPushButton(i18nc("@action:button", "Center on Start"), this);
......
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