Commit 697315dd authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

it's a new api

parent 961d1d54
......@@ -854,18 +854,30 @@ void CalendarView::edit_paste()
endDT = agendaView->selectionEnd();
useEndTime = !agendaView->selectedIsSingleCell();
if (agendaView->selectedIsAllDay()) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
finalDateTime = QDateTime(date);
#else
finalDateTime = QDateTime(date.startOfDay());
#endif
} else {
finalDateTime = QDateTime(date, agendaView->selectionStart().time());
}
} else if (curView == monthView && monthView->selectionStart().isValid()) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
finalDateTime = QDateTime(monthView->selectionStart().date());
#else
finalDateTime = QDateTime(monthView->selectionStart().date().startOfDay());
#endif
pasteFlags = KCalUtils::DndFactory::FlagPasteAtOriginalTime;
} else if (!mDateNavigator->selectedDates().isEmpty() && curView->supportsDateNavigation()) {
// default to the selected date from the navigator
const KCalendarCore::DateList dates = mDateNavigator->selectedDates();
if (!dates.isEmpty()) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
finalDateTime = QDateTime(dates.first());
#else
finalDateTime = QDateTime(dates.first().startOfDay());
#endif
pasteFlags = KCalUtils::DndFactory::FlagPasteAtOriginalTime;
}
}
......@@ -1141,7 +1153,11 @@ void CalendarView::newJournal(const QString &text, const QDate &date)
= IncidenceEditorNG::IncidenceDefaults::minimalIncidenceDefaults();
KCalendarCore::Journal::Ptr journal(new KCalendarCore::Journal);
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
defaults.setStartDateTime(QDateTime(date));
#else
defaults.setStartDateTime(QDateTime(date.startOfDay()));
#endif
defaults.setDefaults(journal);
journal->setSummary(text);
......
......@@ -119,7 +119,11 @@ SummaryEventInfo::List SummaryEventInfo::eventsForRange(const QDate &start, cons
|| (start >= eventStart.date() && end <= eventEnd.date())) {
events << event;
if (eventStart.date() < start) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
sDateTimeByUid()->insert(event->instanceIdentifier(), QDateTime(start));
#else
sDateTimeByUid()->insert(event->instanceIdentifier(), QDateTime(start.startOfDay()));
#endif
} else {
sDateTimeByUid()->insert(event->instanceIdentifier(), eventStart);
}
......
......@@ -266,7 +266,11 @@ void KOViewManager::updateView()
void KOViewManager::updateView(const QDate &start, const QDate &end, const QDate &preferredMonth)
{
if (mCurrentView && mCurrentView != mTodoView) {
#if QT_VERSION < QT_VERSION_CHECK(5, 15, 0)
mCurrentView->setDateRange(QDateTime(start), QDateTime(end), preferredMonth);
#else
mCurrentView->setDateRange(QDateTime(start.startOfDay()), QDateTime(end.startOfDay()), preferredMonth);
#endif
} else if (mTodoView) {
mTodoView->updateView();
}
......
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