summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMontel Laurent <[email protected]>2017-08-08 13:20:28 +0200
committerMontel Laurent <[email protected]>2017-08-08 13:20:28 +0200
commit3eb30e2adc5535349236dc5525eeee67fdd8260d (patch)
tree3547fbed04f201b47cead6e2aa4893d169a17808
parent0a8b01f5bfda37bdc2f65b4a9c1b85b176d9ffa6 (diff)
Use QOverload
-rw-r--r--src/attachmenteditdialog.cpp10
-rw-r--r--src/attendeeeditor.cpp10
-rw-r--r--src/incidenceattendee.cpp6
-rw-r--r--src/incidencecompletionpriority.cpp5
-rw-r--r--src/incidencerecurrence.cpp35
-rw-r--r--src/incidencesecrecy.cpp5
-rw-r--r--src/resourcemodel.cpp18
-rw-r--r--src/visualfreebusywidget.cpp4
8 files changed, 21 insertions, 72 deletions
diff --git a/src/attachmenteditdialog.cpp b/src/attachmenteditdialog.cpp
index 099df30..4725650 100644
--- a/src/attachmenteditdialog.cpp
+++ b/src/attachmenteditdialog.cpp
@@ -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));
}
diff --git a/src/attendeeeditor.cpp b/src/attendeeeditor.cpp
index 240bb99..59a4d71 100644
--- a/src/attendeeeditor.cpp
+++ b/src/attendeeeditor.cpp
@@ -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);
}
diff --git a/src/incidenceattendee.cpp b/src/incidenceattendee.cpp
index f2a4892..8644b40 100644
--- a/src/incidenceattendee.cpp
+++ b/src/incidenceattendee.cpp
@@ -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);
diff --git a/src/incidencecompletionpriority.cpp b/src/incidencecompletionpriority.cpp
index a9dcce1..28199f8 100644
--- a/src/incidencecompletionpriority.cpp
+++ b/src/incidencecompletionpriority.cpp
@@ -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()
diff --git a/src/incidencerecurrence.cpp b/src/incidencerecurrence.cpp
index f1cbe09..a55504d 100644
--- a/src/incidencerecurrence.cpp
+++ b/src/incidencerecurrence.cpp
@@ -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,
diff --git a/src/incidencesecrecy.cpp b/src/incidencesecrecy.cpp
index a3c8a9b..f7bc59f 100644
--- a/src/incidencesecrecy.cpp
+++ b/src/incidencesecrecy.cpp
@@ -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)
diff --git a/src/resourcemodel.cpp b/src/resourcemodel.cpp
index 519e120..11f3111 100644
--- a/src/resourcemodel.cpp
+++ b/src/resourcemodel.cpp
@@ -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("*"));
}
diff --git a/src/visualfreebusywidget.cpp b/src/visualfreebusywidget.cpp
index d1a898b..0b53570 100644
--- a/src/visualfreebusywidget.cpp
+++ b/src/visualfreebusywidget.cpp
@@ -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);