summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergio Martins <[email protected]>2015-09-15 21:29:46 +0100
committerSergio Martins <[email protected]>2015-09-15 22:26:58 +0100
commit00a13c88bd7ed1de5a1a58d256c7d4de6247c819 (patch)
tree72643f15c6fd4b0bdda2dc82352d03207c3b5df2
parent5a2ef117d456604d1d468f696dd3288d12a08710 (diff)
eventviews: Port to the new Qt5 connect style, which is faster
-rw-r--r--eventviews/src/agenda/agenda.cpp14
-rw-r--r--eventviews/src/agenda/agendaview.cpp38
-rw-r--r--eventviews/src/agenda/decorationlabel.cpp16
-rw-r--r--eventviews/src/agenda/timelabelszone.cpp8
-rw-r--r--eventviews/src/eventview.cpp8
-rw-r--r--eventviews/src/journal/journalframe.cpp22
-rw-r--r--eventviews/src/journal/journalview.cpp34
-rw-r--r--eventviews/src/list/listview.cpp8
-rw-r--r--eventviews/src/month/monthitem.cpp4
-rw-r--r--eventviews/src/month/monthview.cpp32
-rw-r--r--eventviews/src/multiagenda/multiagendaview.cpp88
-rw-r--r--eventviews/src/timeline/timelineview.cpp20
-rw-r--r--eventviews/src/todo/todoview.cpp10
13 files changed, 151 insertions, 151 deletions
diff --git a/eventviews/src/agenda/agenda.cpp b/eventviews/src/agenda/agenda.cpp
index eabc569..3fbef48 100644
--- a/eventviews/src/agenda/agenda.cpp
+++ b/eventviews/src/agenda/agenda.cpp
@@ -106,7 +106,7 @@ MarcusBains::MarcusBains(EventView *eventView, Agenda *agenda)
d->mTimer = new QTimer(this);
d->mTimer->setSingleShot(true);
- connect(d->mTimer, SIGNAL(timeout()), this, SLOT(updateLocation()));
+ connect(d->mTimer, &QTimer::timeout, this, &MarcusBains::updateLocation);
d->mTimer->start(0);
}
@@ -388,8 +388,8 @@ void Agenda::init()
// effect. Has to be fixed.
setFocusPolicy(Qt::WheelFocus);
- connect(&d->mScrollUpTimer, SIGNAL(timeout()), SLOT(scrollUp()));
- connect(&d->mScrollDownTimer, SIGNAL(timeout()), SLOT(scrollDown()));
+ connect(&d->mScrollUpTimer, &QTimer::timeout, this, &Agenda::scrollUp);
+ connect(&d->mScrollDownTimer, &QTimer::timeout, this, &Agenda::scrollDown);
d->mStartCell = QPoint(0, 0);
d->mEndCell = QPoint(0, 0);
@@ -1819,8 +1819,8 @@ AgendaItem::QPtr Agenda::createAgendaItem(const KCalCore::Incidence::Ptr &incide
AgendaItem::QPtr agendaItem = new AgendaItem(d->mAgendaView, d->mCalendar, incidence,
itemPos, itemCount, recurrenceId, isSelected, this);
- connect(agendaItem, SIGNAL(removeAgendaItem(AgendaItem::QPtr)), SLOT(removeAgendaItem(AgendaItem::QPtr)));
- connect(agendaItem, SIGNAL(showAgendaItem(AgendaItem::QPtr)), SLOT(showAgendaItem(AgendaItem::QPtr)));
+ connect(agendaItem, &AgendaItem::removeAgendaItem, this, &Agenda::removeAgendaItem);
+ connect(agendaItem, &AgendaItem::showAgendaItem, this, &Agenda::showAgendaItem);
d->mAgendaItemsById.insert(incidence->uid(), agendaItem);
@@ -1968,7 +1968,7 @@ bool Agenda::removeAgendaItem(const AgendaItem::QPtr &agendaItem)
d->mItemsToDelete.append(agendaItem);
d->mItemsQueuedForDeletion.insert(agendaItem->incidence()->uid());
agendaItem->setVisible(false);
- QTimer::singleShot(0, this, SLOT(deleteItemsToDelete()));
+ QTimer::singleShot(0, this, &Agenda::deleteItemsToDelete);
return taken;
}
@@ -2013,7 +2013,7 @@ void Agenda::resizeEvent(QResizeEvent *ev)
}
calculateWorkingHours();
- QTimer::singleShot(0, this, SLOT(resizeAllContents()));
+ QTimer::singleShot(0, this, &Agenda::resizeAllContents);
Q_EMIT gridSpacingYChanged(d->mGridSpacingY * 4);
QWidget::resizeEvent(ev);
diff --git a/eventviews/src/agenda/agendaview.cpp b/eventviews/src/agenda/agendaview.cpp
index 5161f9b..930a9ee 100644
--- a/eventviews/src/agenda/agendaview.cpp
+++ b/eventviews/src/agenda/agendaview.cpp
@@ -871,37 +871,37 @@ void AgendaView::addCalendar(const ViewCalendar::Ptr &cal)
void AgendaView::connectAgenda(Agenda *agenda, Agenda *otherAgenda)
{
- connect(agenda, SIGNAL(showNewEventPopupSignal()),
- SIGNAL(showNewEventPopupSignal()));
+ connect(agenda, &Agenda::showNewEventPopupSignal,
+ this, &AgendaView::showNewEventPopupSignal);
- connect(agenda, SIGNAL(showIncidencePopupSignal(KCalCore::Incidence::Ptr,QDate)),
- SLOT(slotShowIncidencePopup(KCalCore::Incidence::Ptr,QDate)));
+ connect(agenda, &Agenda::showIncidencePopupSignal,
+ this, &AgendaView::slotShowIncidencePopup);
agenda->setCalendar(d->mViewCalendar);
connect(agenda, SIGNAL(newEventSignal()), SIGNAL(newEventSignal()));
- connect(agenda, SIGNAL(newStartSelectSignal()),
- otherAgenda, SLOT(clearSelection()));
- connect(agenda, SIGNAL(newStartSelectSignal()),
- SIGNAL(timeSpanSelectionChanged()));
+ connect(agenda, &Agenda::newStartSelectSignal,
+ otherAgenda, &Agenda::clearSelection);
+ connect(agenda, &Agenda::newStartSelectSignal,
+ this, &AgendaView::timeSpanSelectionChanged);
- connect(agenda, SIGNAL(editIncidenceSignal(KCalCore::Incidence::Ptr)),
- SLOT(slotEditIncidence(KCalCore::Incidence::Ptr)));
- connect(agenda, SIGNAL(showIncidenceSignal(KCalCore::Incidence::Ptr)),
- SLOT(slotShowIncidence(KCalCore::Incidence::Ptr)));
- connect(agenda, SIGNAL(deleteIncidenceSignal(KCalCore::Incidence::Ptr)),
- SLOT(slotDeleteIncidence(KCalCore::Incidence::Ptr)));
+ connect(agenda, &Agenda::editIncidenceSignal,
+ this, &AgendaView::slotEditIncidence);
+ connect(agenda, &Agenda::showIncidenceSignal,
+ this, &AgendaView::slotShowIncidence);
+ connect(agenda, &Agenda::deleteIncidenceSignal,
+ this, &AgendaView::slotDeleteIncidence);
// drag signals
connect(agenda, SIGNAL(startDragSignal(KCalCore::Incidence::Ptr)),
SLOT(startDrag(KCalCore::Incidence::Ptr)));
// synchronize selections
- connect(agenda, SIGNAL(incidenceSelected(KCalCore::Incidence::Ptr,QDate)),
- otherAgenda, SLOT(deselectItem()));
- connect(agenda, SIGNAL(incidenceSelected(KCalCore::Incidence::Ptr,QDate)),
- SLOT(slotIncidenceSelected(KCalCore::Incidence::Ptr,QDate)));
+ connect(agenda, &Agenda::incidenceSelected,
+ otherAgenda, &Agenda::deselectItem);
+ connect(agenda, &Agenda::incidenceSelected,
+ this, &AgendaView::slotIncidenceSelected);
// rescheduling of todos by d'n'd
connect(agenda, SIGNAL(droppedIncidences(KCalCore::Incidence::List,QPoint,bool)),
@@ -2308,6 +2308,6 @@ void AgendaView::scheduleUpdateEventIndicators()
{
if (!d->mUpdateEventIndicatorsScheduled) {
d->mUpdateEventIndicatorsScheduled = true;
- QTimer::singleShot(0, this, SLOT(updateEventIndicators()));
+ QTimer::singleShot(0, this, &AgendaView::updateEventIndicators);
}
}
diff --git a/eventviews/src/agenda/decorationlabel.cpp b/eventviews/src/agenda/decorationlabel.cpp
index cd89902..bb4d95b 100644
--- a/eventviews/src/agenda/decorationlabel.cpp
+++ b/eventviews/src/agenda/decorationlabel.cpp
@@ -40,16 +40,16 @@ DecorationLabel::DecorationLabel(CalendarDecoration::Element *e,
mUrl = e->url();
setUrl(e->url());
- connect(e, SIGNAL(gotNewExtensiveText(QString)),
- this, SLOT(setExtensiveText(QString)));
- connect(e, SIGNAL(gotNewLongText(QString)),
- this, SLOT(setLongText(QString)));
+ connect(e, &CalendarDecoration::Element::gotNewExtensiveText,
+ this, &DecorationLabel::setExtensiveText);
+ connect(e, &CalendarDecoration::Element::gotNewLongText,
+ this, &DecorationLabel::setLongText);
connect(e, SIGNAL(gotNewPixmap(QPixmap)),
this, SLOT(setPixmap(QPixmap)));
- connect(e, SIGNAL(gotNewShortText(QString)),
- this, SLOT(setShortText(QString)));
- connect(e, SIGNAL(gotNewUrl(QUrl)),
- this, SLOT(setUrl(QUrl)));
+ connect(e, &CalendarDecoration::Element::gotNewShortText,
+ this, &DecorationLabel::setShortText);
+ connect(e, &CalendarDecoration::Element::gotNewUrl,
+ this, &DecorationLabel::setUrl);
squeezeContentsToLabel();
}
diff --git a/eventviews/src/agenda/timelabelszone.cpp b/eventviews/src/agenda/timelabelszone.cpp
index 6d670f0..a7eb7b4 100644
--- a/eventviews/src/agenda/timelabelszone.cpp
+++ b/eventviews/src/agenda/timelabelszone.cpp
@@ -100,11 +100,11 @@ void TimeLabelsZone::setupTimeLabel(QScrollArea *area)
{
if (mAgenda && mAgenda->verticalScrollBar()) {
// Scrolling the agenda will scroll the timelabel
- connect(mAgenda->verticalScrollBar(), SIGNAL(valueChanged(int)),
- area->verticalScrollBar(), SLOT(setValue(int)));
+ connect(mAgenda->verticalScrollBar(), &QAbstractSlider::valueChanged,
+ area->verticalScrollBar(), &QAbstractSlider::setValue);
// and vice-versa. ( this won't loop )
- connect(area->verticalScrollBar(), SIGNAL(valueChanged(int)),
- mAgenda->verticalScrollBar(), SLOT(setValue(int)));
+ connect(area->verticalScrollBar(), &QAbstractSlider::valueChanged,
+ mAgenda->verticalScrollBar(), &QAbstractSlider::setValue);
area->verticalScrollBar()->setValue(mAgenda->verticalScrollBar()->value());
diff --git a/eventviews/src/eventview.cpp b/eventviews/src/eventview.cpp
index 0c70923..af52b2a 100644
--- a/eventviews/src/eventview.cpp
+++ b/eventviews/src/eventview.cpp
@@ -81,8 +81,8 @@ EventView::EventView(QWidget *parent)
//editor, for each keypress.
//Thus, listen to the global focusChanged() signal (seen in Qt 4.6-stable-patched 20091112 -Frank)
connect(qobject_cast<QApplication *>(QApplication::instance()),
- SIGNAL(focusChanged(QWidget*,QWidget*)),
- this, SLOT(focusChanged(QWidget*,QWidget*)));
+ &QApplication::focusChanged,
+ this, &EventView::focusChanged);
d_ptr->setUpModels();
}
@@ -176,8 +176,8 @@ void EventView::setCalendar(const Akonadi::ETMCalendar::Ptr &calendar)
d->collectionSelectionModel->setSourceModel(calendar->model());
}
- connect(calendar.data(), SIGNAL(collectionChanged(Akonadi::Collection,QSet<QByteArray>)),
- SLOT(onCollectionChanged(Akonadi::Collection,QSet<QByteArray>)));
+ connect(calendar.data(), &ETMCalendar::collectionChanged,
+ this, &EventView::onCollectionChanged);
}
}
}
diff --git a/eventviews/src/journal/journalframe.cpp b/eventviews/src/journal/journalframe.cpp
index 9862ea9..6a628a6 100644
--- a/eventviews/src/journal/journalframe.cpp
+++ b/eventviews/src/journal/journalframe.cpp
@@ -88,16 +88,16 @@ void JournalDateView::addJournal(const Akonadi::Item &j)
entry->setIncidenceChanger(mChanger);
mEntries.insert(j.id(), entry);
- connect(this, SIGNAL(setIncidenceChangerSignal(Akonadi::IncidenceChanger*)),
- entry, SLOT(setIncidenceChanger(Akonadi::IncidenceChanger*)));
- connect(this, SIGNAL(setDateSignal(QDate)),
- entry, SLOT(setDate(QDate)));
- connect(entry, SIGNAL(deleteIncidence(Akonadi::Item)),
- this, SIGNAL(deleteIncidence(Akonadi::Item)));
- connect(entry, SIGNAL(editIncidence(Akonadi::Item)),
- this, SIGNAL(editIncidence(Akonadi::Item)));
- connect(entry, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
- SIGNAL(incidenceSelected(Akonadi::Item,QDate)));
+ connect(this, &JournalDateView::setIncidenceChangerSignal,
+ entry, &JournalFrame::setIncidenceChanger);
+ connect(this, &JournalDateView::setDateSignal,
+ entry, &JournalFrame::setDate);
+ connect(entry, &JournalFrame::deleteIncidence,
+ this, &JournalDateView::deleteIncidence);
+ connect(entry, &JournalFrame::editIncidence,
+ this, &JournalDateView::editIncidence);
+ connect(entry, &JournalFrame::incidenceSelected,
+ this, &JournalDateView::incidenceSelected);
connect(entry, SIGNAL(printJournal(KCalCore::Journal::Ptr,bool)),
SIGNAL(printJournal(KCalCore::Journal::Ptr,bool)));
}
@@ -201,7 +201,7 @@ JournalFrame::JournalFrame(const Akonadi::Item &j,
mPrintPreviewButton->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Fixed);
mPrintPreviewButton->setToolTip(i18n("Print preview this journal entry"));
buttonsLayout->addWidget(mPrintPreviewButton);
- connect(mPrintPreviewButton, SIGNAL(clicked()), this, SLOT(printPreviewJournal()));
+ connect(mPrintPreviewButton, &QAbstractButton::clicked, this, &JournalFrame::printPreviewJournal);
readJournal(mJournal);
mDirty = false;
diff --git a/eventviews/src/journal/journalview.cpp b/eventviews/src/journal/journalview.cpp
index 12cf7e4..f16b9aa 100644
--- a/eventviews/src/journal/journalview.cpp
+++ b/eventviews/src/journal/journalview.cpp
@@ -69,23 +69,23 @@ void JournalView::appendJournal(const Akonadi::Item &journal, const QDate &dt)
entry->setIncidenceChanger(mChanger);
entry->show();
connect(this, &JournalView::flushEntries, entry, &JournalDateView::flushEntries);
- connect(this, SIGNAL(setIncidenceChangerSignal(Akonadi::IncidenceChanger*)),
- entry, SLOT(setIncidenceChanger(Akonadi::IncidenceChanger*)));
- connect(this, SIGNAL(journalEdited(Akonadi::Item)),
- entry, SLOT(journalEdited(Akonadi::Item)));
- connect(this, SIGNAL(journalDeleted(Akonadi::Item)),
- entry, SLOT(journalDeleted(Akonadi::Item)));
-
- connect(entry, SIGNAL(editIncidence(Akonadi::Item)),
- this, SIGNAL(editIncidenceSignal(Akonadi::Item)));
- connect(entry, SIGNAL(deleteIncidence(Akonadi::Item)),
- this, SIGNAL(deleteIncidenceSignal(Akonadi::Item)));
- connect(entry, SIGNAL(newJournal(QDate)),
- this, SIGNAL(newJournalSignal(QDate)));
- connect(entry, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
- SIGNAL(incidenceSelected(Akonadi::Item,QDate)));
- connect(entry, SIGNAL(printJournal(KCalCore::Journal::Ptr,bool)),
- SIGNAL(printJournal(KCalCore::Journal::Ptr,bool)));
+ connect(this, &JournalView::setIncidenceChangerSignal,
+ entry, &JournalDateView::setIncidenceChanger);
+ connect(this, &JournalView::journalEdited,
+ entry, &JournalDateView::journalEdited);
+ connect(this, &JournalView::journalDeleted,
+ entry, &JournalDateView::journalDeleted);
+
+ connect(entry, &JournalDateView::editIncidence,
+ this, &EventView::editIncidenceSignal);
+ connect(entry, &JournalDateView::deleteIncidence,
+ this, &EventView::deleteIncidenceSignal);
+ connect(entry, &JournalDateView::newJournal,
+ this, &EventView::newJournalSignal);
+ connect(entry, &JournalDateView::incidenceSelected,
+ this, &EventView::incidenceSelected);
+ connect(entry, &JournalDateView::printJournal,
+ this, &JournalView::printJournal);
mEntries.insert(dt, entry);
}
diff --git a/eventviews/src/list/listview.cpp b/eventviews/src/list/listview.cpp
index 075711f..27975ff 100644
--- a/eventviews/src/list/listview.cpp
+++ b/eventviews/src/list/listview.cpp
@@ -287,10 +287,10 @@ ListView::ListView(const Akonadi::ETMCalendar::Ptr &calendar,
QObject::connect(d->mTreeWidget, SIGNAL(doubleClicked(QModelIndex)),
SLOT(defaultItemAction(QModelIndex)));
QObject::connect(d->mTreeWidget,
- SIGNAL(customContextMenuRequested(QPoint)),
- SLOT(popupMenu(QPoint)));
- QObject::connect(d->mTreeWidget, SIGNAL(itemSelectionChanged()),
- SLOT(processSelectionChange()));
+ &QWidget::customContextMenuRequested,
+ this, &ListView::popupMenu);
+ QObject::connect(d->mTreeWidget, &QTreeWidget::itemSelectionChanged,
+ this, &ListView::processSelectionChange);
// TODO
//d->mTreeWidget->restoreLayout( KOGlobals::self()->config(), "ListView Layout" );
diff --git a/eventviews/src/month/monthitem.cpp b/eventviews/src/month/monthitem.cpp
index 4f3d1ab..70846b6 100644
--- a/eventviews/src/month/monthitem.cpp
+++ b/eventviews/src/month/monthitem.cpp
@@ -322,8 +322,8 @@ IncidenceMonthItem::IncidenceMonthItem(MonthScene *monthScene,
}
}
- connect(monthScene, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
- this, SLOT(updateSelection(Akonadi::Item,QDate)));
+ connect(monthScene, &MonthScene::incidenceSelected,
+ this, &IncidenceMonthItem::updateSelection);
// first set to 0, because it's used in startDate()
mRecurDayOffset = 0;
diff --git a/eventviews/src/month/monthview.cpp b/eventviews/src/month/monthview.cpp
index cc6fb2f..6853819 100644
--- a/eventviews/src/month/monthview.cpp
+++ b/eventviews/src/month/monthview.cpp
@@ -183,8 +183,8 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
i18nc("@info:whatsthis",
"Click this button and the month view will be enlarged to fill the "
"maximum available window space / or shrunk back to its normal size."));
- connect(d->fullView, SIGNAL(clicked()),
- this, SLOT(changeFullView()));
+ connect(d->fullView, &QAbstractButton::clicked,
+ this, &MonthView::changeFullView);
QToolButton *minusMonth = new QToolButton(this);
minusMonth->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up-double")));
@@ -193,8 +193,8 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
minusMonth->setWhatsThis(
i18nc("@info:whatsthis",
"Click this button and the view will be scrolled back in time by 1 month."));
- connect(minusMonth, SIGNAL(clicked()),
- this, SLOT(moveBackMonth()));
+ connect(minusMonth, &QAbstractButton::clicked,
+ this, &MonthView::moveBackMonth);
QToolButton *minusWeek = new QToolButton(this);
minusWeek->setIcon(QIcon::fromTheme(QStringLiteral("arrow-up")));
@@ -203,8 +203,8 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
minusWeek->setWhatsThis(
i18nc("@info:whatsthis",
"Click this button and the view will be scrolled back in time by 1 week."));
- connect(minusWeek, SIGNAL(clicked()),
- this, SLOT(moveBackWeek()));
+ connect(minusWeek, &QAbstractButton::clicked,
+ this, &MonthView::moveBackWeek);
QToolButton *plusWeek = new QToolButton(this);
plusWeek->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down")));
@@ -213,8 +213,8 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
plusWeek->setWhatsThis(
i18nc("@info:whatsthis",
"Click this button and the view will be scrolled forward in time by 1 week."));
- connect(plusWeek, SIGNAL(clicked()),
- this, SLOT(moveFwdWeek()));
+ connect(plusWeek, &QAbstractButton::clicked,
+ this, &MonthView::moveFwdWeek);
QToolButton *plusMonth = new QToolButton(this);
plusMonth->setIcon(QIcon::fromTheme(QStringLiteral("arrow-down-double")));
@@ -223,8 +223,8 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
plusMonth->setWhatsThis(
i18nc("@info:whatsthis",
"Click this button and the view will be scrolled forward in time by 1 month."));
- connect(plusMonth, SIGNAL(clicked()),
- this, SLOT(moveFwdMonth()));
+ connect(plusMonth, &QAbstractButton::clicked,
+ this, &MonthView::moveFwdMonth);
rightLayout->addWidget(d->fullView);
rightLayout->addWidget(minusMonth);
@@ -237,17 +237,17 @@ MonthView::MonthView(NavButtonsVisibility visibility, QWidget *parent)
d->view->setFrameStyle(QFrame::NoFrame);
}
- connect(d->scene, SIGNAL(showIncidencePopupSignal(Akonadi::Item,QDate)),
- SIGNAL(showIncidencePopupSignal(Akonadi::Item,QDate)));
+ connect(d->scene, &MonthScene::showIncidencePopupSignal,
+ this, &MonthView::showIncidencePopupSignal);
- connect(d->scene, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
- SIGNAL(incidenceSelected(Akonadi::Item,QDate)));
+ connect(d->scene, &MonthScene::incidenceSelected,
+ this, &EventView::incidenceSelected);
connect(d->scene, SIGNAL(newEventSignal()),
SIGNAL(newEventSignal()));
- connect(d->scene, SIGNAL(showNewEventPopupSignal()),
- SIGNAL(showNewEventPopupSignal()));
+ connect(d->scene, &MonthScene::showNewEventPopupSignal,
+ this, &MonthView::showNewEventPopupSignal);
connect(&d->reloadTimer, &QTimer::timeout, this, &MonthView::reloadIncidences);
updateConfig();
diff --git a/eventviews/src/multiagenda/multiagendaview.cpp b/eventviews/src/multiagenda/multiagendaview.cpp
index 5274dd1..fba8838 100644
--- a/eventviews/src/multiagenda/multiagendaview.cpp
+++ b/eventviews/src/multiagenda/multiagendaview.cpp
@@ -235,8 +235,8 @@ void MultiAgendaView::setCalendar(const Akonadi::ETMCalendar::Ptr &calendar)
disconnect(Q_NULLPTR, SIGNAL(selectionChanged(Akonadi::Collection::List,Akonadi::Collection::List)),
this, SLOT(forceRecreateViews()));
- connect(collectionSelection(), SIGNAL(selectionChanged(Akonadi::Collection::List,Akonadi::Collection::List)),
- SLOT(forceRecreateViews()));
+ connect(collectionSelection(), &CalendarSupport::CollectionSelection::selectionChanged,
+ this, &MultiAgendaView::forceRecreateViews);
recreateViews();
}
@@ -269,17 +269,17 @@ void MultiAgendaView::recreateViews()
}
d->setupViews();
- QTimer::singleShot(0, this, SLOT(slotResizeScrollView()));
+ QTimer::singleShot(0, this, &MultiAgendaView::slotResizeScrollView);
d->mTimeLabelsZone->updateAll();
QScrollArea *timeLabel = d->mTimeLabelsZone->timeLabels().first();
- connect(timeLabel->verticalScrollBar(), SIGNAL(valueChanged(int)),
- d->mScrollBar, SLOT(setValue(int)));
- connect(d->mScrollBar, SIGNAL(valueChanged(int)),
- timeLabel->verticalScrollBar(), SLOT(setValue(int)));
+ connect(timeLabel->verticalScrollBar(), &QAbstractSlider::valueChanged,
+ d->mScrollBar, &QAbstractSlider::setValue);
+ connect(d->mScrollBar, &QAbstractSlider::valueChanged,
+ timeLabel->verticalScrollBar(), &QAbstractSlider::setValue);
resizeSplitters();
- QTimer::singleShot(0, this, SLOT(setupScrollBar()));
+ QTimer::singleShot(0, this, &MultiAgendaView::setupScrollBar);
d->mTimeLabelsZone->updateTimeLabelsPosition();
}
@@ -319,49 +319,49 @@ void MultiAgendaView::Private::setupViews()
SIGNAL(newEventSignal(QDateTime,QDateTime)),
q, SIGNAL(newEventSignal(QDateTime,QDateTime)));
- q->connect(agenda, SIGNAL(editIncidenceSignal(Akonadi::Item)),
- q, SIGNAL(editIncidenceSignal(Akonadi::Item)));
- q->connect(agenda, SIGNAL(showIncidenceSignal(Akonadi::Item)),
- q, SIGNAL(showIncidenceSignal(Akonadi::Item)));
- q->connect(agenda, SIGNAL(deleteIncidenceSignal(Akonadi::Item)),
- q, SIGNAL(deleteIncidenceSignal(Akonadi::Item)));
+ q->connect(agenda, &EventView::editIncidenceSignal,
+ q, &EventView::editIncidenceSignal);
+ q->connect(agenda, &EventView::showIncidenceSignal,
+ q, &EventView::showIncidenceSignal);
+ q->connect(agenda, &EventView::deleteIncidenceSignal,
+ q, &EventView::deleteIncidenceSignal);
- q->connect(agenda, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
- q, SIGNAL(incidenceSelected(Akonadi::Item,QDate)));
+ q->connect(agenda, &EventView::incidenceSelected,
+ q, &EventView::incidenceSelected);
- q->connect(agenda, SIGNAL(cutIncidenceSignal(Akonadi::Item)),
- q, SIGNAL(cutIncidenceSignal(Akonadi::Item)));
- q->connect(agenda, SIGNAL(copyIncidenceSignal(Akonadi::Item)),
- q, SIGNAL(copyIncidenceSignal(Akonadi::Item)));
- q->connect(agenda, SIGNAL(pasteIncidenceSignal()),
- q, SIGNAL(pasteIncidenceSignal()));
- q->connect(agenda, SIGNAL(toggleAlarmSignal(Akonadi::Item)),
- q, SIGNAL(toggleAlarmSignal(Akonadi::Item)));
- q->connect(agenda, SIGNAL(dissociateOccurrencesSignal(Akonadi::Item,QDate)),
- q, SIGNAL(dissociateOccurrencesSignal(Akonadi::Item,QDate)));
+ q->connect(agenda, &EventView::cutIncidenceSignal,
+ q, &EventView::cutIncidenceSignal);
+ q->connect(agenda, &EventView::copyIncidenceSignal,
+ q, &EventView::copyIncidenceSignal);
+ q->connect(agenda, &EventView::pasteIncidenceSignal,
+ q, &EventView::pasteIncidenceSignal);
+ q->connect(agenda, &EventView::toggleAlarmSignal,
+ q, &EventView::toggleAlarmSignal);
+ q->connect(agenda, &EventView::dissociateOccurrencesSignal,
+ q, &EventView::dissociateOccurrencesSignal);
- q->connect(agenda, SIGNAL(newTodoSignal(QDate)),
- q, SIGNAL(newTodoSignal(QDate)));
+ q->connect(agenda, &EventView::newTodoSignal,
+ q, &EventView::newTodoSignal);
- q->connect(agenda, SIGNAL(incidenceSelected(Akonadi::Item,QDate)),
- q, SLOT(slotSelectionChanged()));
+ q->connect(agenda, &EventView::incidenceSelected,
+ q, &MultiAgendaView::slotSelectionChanged);
- q->connect(agenda, SIGNAL(timeSpanSelectionChanged()),
- q, SLOT(slotClearTimeSpanSelection()));
+ q->connect(agenda, &AgendaView::timeSpanSelectionChanged,
+ q, &MultiAgendaView::slotClearTimeSpanSelection);
q->disconnect(agenda->agenda(),
SIGNAL(zoomView(int,QPoint,Qt::Orientation)),
agenda, Q_NULLPTR);
q->connect(agenda->agenda(),
- SIGNAL(zoomView(int,QPoint,Qt::Orientation)),
- q, SLOT(zoomView(int,QPoint,Qt::Orientation)));
+ &Agenda::zoomView,
+ q, &MultiAgendaView::zoomView);
}
AgendaView *lastView = mAgendaViews.last();
foreach (AgendaView *agenda, mAgendaViews) {
if (agenda != lastView) {
- connect(agenda->agenda()->verticalScrollBar(), SIGNAL(valueChanged(int)),
- lastView->agenda()->verticalScrollBar(), SLOT(setValue(int)));
+ connect(agenda->agenda()->verticalScrollBar(), &QAbstractSlider::valueChanged,
+ lastView->agenda()->verticalScrollBar(), &QAbstractSlider::setValue);
}
}
@@ -497,16 +497,16 @@ AgendaView *MultiAgendaView::Private::createView(const QString &title)
box->show();
mTimeLabelsZone->setAgendaView(av);
- q->connect(mScrollBar, SIGNAL(valueChanged(int)),
- av->agenda()->verticalScrollBar(), SLOT(setValue(int)));
+ q->connect(mScrollBar, &QAbstractSlider::valueChanged,
+ av->agenda()->verticalScrollBar(), &QAbstractSlider::setValue);
- q->connect(av->splitter(), SIGNAL(splitterMoved(int,int)),
- q, SLOT(resizeSplitters()));
- q->connect(av, SIGNAL(showIncidencePopupSignal(Akonadi::Item,QDate)),
- q, SIGNAL(showIncidencePopupSignal(Akonadi::Item,QDate)));
+ q->connect(av->splitter(), &QSplitter::splitterMoved,
+ q, &MultiAgendaView::resizeSplitters);
+ q->connect(av, &AgendaView::showIncidencePopupSignal,
+ q, &MultiAgendaView::showIncidencePopupSignal);
- q->connect(av, SIGNAL(showNewEventPopupSignal()),
- q, SIGNAL(showNewEventPopupSignal()));
+ q->connect(av, &AgendaView::showNewEventPopupSignal,
+ q, &MultiAgendaView::showNewEventPopupSignal);
const QSize minHint = av->allDayAgenda()->scrollArea()->minimumSizeHint();
diff --git a/eventviews/src/timeline/timelineview.cpp b/eventviews/src/timeline/timelineview.cpp
index e45599e..b2c3954 100644
--- a/eventviews/src/timeline/timelineview.cpp
+++ b/eventviews/src/timeline/timelineview.cpp
@@ -234,8 +234,8 @@ TimelineView::TimelineView(QWidget *parent)
d->mGantt = new KDGantt::GraphicsView();
splitter->addWidget(d->mLeftView);
splitter->addWidget(d->mGantt);
- connect(splitter, SIGNAL(splitterMoved(int,int)),
- d, SLOT(splitterMoved()));
+ connect(splitter, &QSplitter::splitterMoved,
+ d, &Private::splitterMoved);
QStandardItemModel *model = new QStandardItemModel(this);
d->mRowController = new RowController;
@@ -279,15 +279,15 @@ TimelineView::TimelineView(QWidget *parent)
#else
qCDebug(CALENDARVIEW_LOG) << "Disabled code, port to KDGantt2";
#endif
- connect(model, SIGNAL(itemChanged(QStandardItem*)),
- d, SLOT(itemChanged(QStandardItem*)));
- connect(d->mGantt, SIGNAL(doubleClicked(QModelIndex)),
- d, SLOT(itemDoubleClicked(QModelIndex)));
- connect(d->mGantt, SIGNAL(activated(QModelIndex)),
- d, SLOT(itemSelected(QModelIndex)));
+ connect(model, &QStandardItemModel::itemChanged,
+ d, &Private::itemChanged);
+ connect(d->mGantt, &KDGantt::GraphicsView::doubleClicked,
+ d, &Private::itemDoubleClicked);
+ connect(d->mGantt, &KDGantt::GraphicsView::activated,
+ d, &Private::itemSelected);
d->mGantt->setContextMenuPolicy(Qt::CustomContextMenu);
- connect(d->mGantt, SIGNAL(customContextMenuRequested(QPoint)),
- d, SLOT(contextMenuRequested(QPoint)));
+ connect(d->mGantt, &QWidget::customContextMenuRequested,
+ d, &Private::contextMenuRequested);
#if 0
connect(d->mGantt, SIGNAL(dateTimeDoubleClicked(QDateTime)),
diff --git a/eventviews/src/todo/todoview.cpp b/eventviews/src/todo/todoview.cpp
index c25366c..6a1318b 100644
--- a/eventviews/src/todo/todoview.cpp
+++ b/eventviews/src/todo/todoview.cpp
@@ -128,8 +128,8 @@ public:
delete todoTreeModel;
todoTreeModel = new IncidenceTreeModel(QStringList() << todoMimeType, parent);
foreach (TodoView *view, views) {
- QObject::connect(todoTreeModel, SIGNAL(indexChangedParent(QModelIndex)), view, SLOT(expandIndex(QModelIndex)));
- QObject::connect(todoTreeModel, SIGNAL(batchInsertionFinished()), view, SLOT(restoreViewState()));
+ QObject::connect(todoTreeModel, &IncidenceTreeModel::indexChangedParent, view, &TodoView::expandIndex);
+ QObject::connect(todoTreeModel, &IncidenceTreeModel::batchInsertionFinished, view, &TodoView::restoreViewState);
view->mView->setDragDropMode(QAbstractItemView::DragDrop);
view->setFlatView(flat, /**propagate=*/false); // So other views update their toggle icon
}
@@ -234,7 +234,7 @@ TodoView::TodoView(const EventViews::PrefsPtr &prefs,
mView->setEditTriggers(QAbstractItemView::SelectedClicked |
QAbstractItemView::EditKeyPressed);
- connect(mView->header(), SIGNAL(geometriesChanged()), SLOT(scheduleResizeColumns()));
+ connect(mView->header(), &QHeaderView::geometriesChanged, this, &TodoView::scheduleResizeColumns);
connect(mView, &TodoViewView::visibleColumnCountChanged, this, &TodoView::resizeColumns);
TodoRichTextDelegate *richTextDelegate = new TodoRichTextDelegate(mView);
@@ -259,7 +259,7 @@ TodoView::TodoView(const EventViews::PrefsPtr &prefs,
connect(mView, &TodoViewView::customContextMenuRequested, this, &TodoView::contextMenu);
connect(mView, &TodoViewView::doubleClicked, this, &TodoView::itemDoubleClicked);
- connect(mView->selectionModel(), SIGNAL(selectionChanged(QItemSelection,QItemSelection)), this, SLOT(selectionChanged(QItemSelection,QItemSelection)));
+ connect(mView->selectionModel(), &QItemSelectionModel::selectionChanged, this, &TodoView::selectionChanged);
mQuickAdd = new TodoViewQuickAddLine(this);
mQuickAdd->setClearButtonEnabled(true);
@@ -581,7 +581,7 @@ void TodoView::restoreLayout(KConfig *config, const QString &group, bool minimal
}
// We don't have any incidences (content) yet, so we delay resizing
- QTimer::singleShot(0, this, SLOT(resizeColumns()));
+ QTimer::singleShot(0, this, &TodoView::resizeColumns);
} else {
for (int i = 0;