Commit 0c983d6e authored by Ahmad Samir's avatar Ahmad Samir
Browse files

Port to PMF signal/slot syntax

This also fixes one invalid disconnect(nullptr, , ,) call, the sender must
never be nullptr.
parent c1792156
Pipeline #203658 failed with stage
in 2 minutes and 12 seconds
......@@ -420,7 +420,7 @@ void Agenda::init()
calculateWorkingHours();
connect(verticalScrollBar(), SIGNAL(valueChanged(int)), SLOT(checkScrollBoundaries(int)));
connect(verticalScrollBar(), &QScrollBar::valueChanged, this, qOverload<int>(&Agenda::checkScrollBoundaries));
// Create the Marcus Bains line.
if (d->mAllDayMode) {
......
......@@ -1259,7 +1259,7 @@ void AgendaView::connectAgenda(Agenda *agenda, Agenda *otherAgenda)
agenda->setCalendar(d->mViewCalendar);
connect(agenda, SIGNAL(newEventSignal()), SIGNAL(newEventSignal()));
connect(agenda, &Agenda::newEventSignal, this, qOverload<>(&EventView::newEventSignal));
connect(agenda, &Agenda::newStartSelectSignal, otherAgenda, &Agenda::clearSelection);
connect(agenda, &Agenda::newStartSelectSignal, this, &AgendaView::timeSpanSelectionChanged);
......
......@@ -213,7 +213,7 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
connect(d->scene, &MonthScene::incidenceSelected, this, &EventView::incidenceSelected);
connect(d->scene, SIGNAL(newEventSignal()), SIGNAL(newEventSignal()));
connect(d->scene, &MonthScene::newEventSignal, this, qOverload<>(&EventView::newEventSignal));
connect(d->scene, &MonthScene::showNewEventPopupSignal, this, &MonthView::showNewEventPopupSignal);
......
......@@ -136,6 +136,7 @@ public:
QLabel *mLabel = nullptr;
QWidget *mRightDummyWidget = nullptr;
QHash<QString, KViewStateMaintainer<ETMViewStateSaver> *> mSelectionSavers;
QMetaObject::Connection m_selectionChangeConn;
};
MultiAgendaView::MultiAgendaView(QWidget *parent)
......@@ -230,9 +231,9 @@ void MultiAgendaView::setCalendar(const Akonadi::ETMCalendar::Ptr &calendar)
proxy->setSourceModel(calendar->entityTreeModel());
}
disconnect(nullptr, SIGNAL(selectionChanged(Akonadi::Collection::List, Akonadi::Collection::List)), this, SLOT(forceRecreateViews()));
connect(collectionSelection(), &CalendarSupport::CollectionSelection::selectionChanged, this, &MultiAgendaView::forceRecreateViews);
disconnect(d->m_selectionChangeConn);
d->m_selectionChangeConn =
connect(collectionSelection(), &CalendarSupport::CollectionSelection::selectionChanged, this, &MultiAgendaView::forceRecreateViews);
recreateViews();
}
......@@ -304,10 +305,13 @@ void MultiAgendaViewPrivate::deleteViews()
void MultiAgendaViewPrivate::setupViews()
{
for (AgendaView *agendaView : std::as_const(mAgendaViews)) {
q->connect(agendaView, SIGNAL(newEventSignal()), q, SIGNAL(newEventSignal()));
q->connect(agendaView, SIGNAL(newEventSignal(QDate)), q, SIGNAL(newEventSignal(QDate)));
q->connect(agendaView, SIGNAL(newEventSignal(QDateTime)), q, SIGNAL(newEventSignal(QDateTime)));
q->connect(agendaView, SIGNAL(newEventSignal(QDateTime, QDateTime)), q, SIGNAL(newEventSignal(QDateTime, QDateTime)));
q->connect(agendaView, qOverload<>(&EventView::newEventSignal), q, qOverload<>(&EventView::newEventSignal));
q->connect(agendaView, qOverload<const QDate &>(&EventView::newEventSignal), q, qOverload<const QDate &>(&EventView::newEventSignal));
q->connect(agendaView, qOverload<const QDateTime &>(&EventView::newEventSignal), q, qOverload<const QDateTime &>(&EventView::newEventSignal));
q->connect(agendaView,
qOverload<const QDateTime &, const QDateTime &>(&EventView::newEventSignal),
q,
qOverload<const QDateTime &>(&EventView::newEventSignal));
q->connect(agendaView, &EventView::editIncidenceSignal, q, &EventView::editIncidenceSignal);
q->connect(agendaView, &EventView::showIncidenceSignal, q, &EventView::showIncidenceSignal);
......@@ -327,7 +331,7 @@ void MultiAgendaViewPrivate::setupViews()
q->connect(agendaView, &AgendaView::timeSpanSelectionChanged, q, &MultiAgendaView::slotClearTimeSpanSelection);
q->disconnect(agendaView->agenda(), SIGNAL(zoomView(int, QPoint, Qt::Orientation)), agendaView, nullptr);
q->disconnect(agendaView->agenda(), &Agenda::zoomView, agendaView, nullptr);
q->connect(agendaView->agenda(), &Agenda::zoomView, q, &MultiAgendaView::zoomView);
}
......
Supports Markdown
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