Commit b9dfb0f0 authored by Volker Krause's avatar Volker Krause

Some more KDateTime to QDateTime porting

parent e1f2c268
......@@ -273,7 +273,7 @@ public:
// insertAtDateTime is in the view's timezone
void insertIncidence(const KCalCore::Incidence::Ptr &, const KDateTime &recurrenceId,
const KDateTime &insertAtDateTime, bool createSelected);
const QDateTime &insertAtDateTime, bool createSelected);
void reevaluateIncidence(const KCalCore::Incidence::Ptr &incidence);
bool datesEqual(const KCalCore::Incidence::Ptr &one, const KCalCore::Incidence::Ptr &two) const;
......@@ -300,10 +300,10 @@ private:
bool AgendaView::Private::datesEqual(const KCalCore::Incidence::Ptr &one, const KCalCore::Incidence::Ptr &two) const
{
const KDateTime start1 = one->dtStart();
const KDateTime start2 = two->dtStart();
const KDateTime end1 = one->dateTime(KCalCore::Incidence::RoleDisplayEnd);
const KDateTime end2 = two->dateTime(KCalCore::Incidence::RoleDisplayEnd);
const auto start1 = one->dtStart().dateTime();
const auto start2 = two->dtStart().dateTime();
const auto end1 = one->dateTime(KCalCore::Incidence::RoleDisplayEnd).dateTime();
const auto end2 = two->dateTime(KCalCore::Incidence::RoleDisplayEnd).dateTime();
if (start1.isValid() ^ start2.isValid()) {
return false;
......@@ -535,7 +535,7 @@ void AgendaView::Private::clearView()
}
void AgendaView::Private::insertIncidence(const KCalCore::Incidence::Ptr &incidence,
const KDateTime &recurrenceId, const KDateTime &insertAtDateTime,
const KDateTime &recurrenceId, const QDateTime &insertAtDateTime,
bool createSelected)
{
if (!q->filterByCollectionSelection(incidence)) {
......@@ -1847,7 +1847,7 @@ bool AgendaView::displayIncidence(const KCalCore::Incidence::Ptr &incidence, bo
startDateTimeWithOffset, lastVisibleDateTime);
while (rIt.hasNext()) {
rIt.next();
const KDateTime occurrenceDate(rIt.occurrenceStartDate().toLocalZone());
const auto occurrenceDate = rIt.occurrenceStartDate().toLocalZone().dateTime();
const bool makesDayBusy =
preferences()->colorAgendaBusyDays() && makesWholeDayBusy(rIt.incidence());
if (makesDayBusy) {
......@@ -1913,7 +1913,7 @@ bool AgendaView::displayIncidence(const KCalCore::Incidence::Ptr &incidence, bo
busyEvents.append(event);
}
d->insertIncidence(incidence, t->toLocalZone(), t->toLocalZone(), createSelected);
d->insertIncidence(incidence, t->toLocalZone(), t->toLocalZone().dateTime(), createSelected);
}
// Can be multiday
......
......@@ -210,8 +210,8 @@ int TodoViewSortFilterProxyModel::compareStartDates(const QModelIndex &left,
// For sorting, no date is considered a very big date
return rightIsEmpty ? -1 : 1;
} else if (!leftIsEmpty) { // Both have start dates
const KDateTime leftDateTime = leftTodo->dtStart();
const KDateTime rightDateTime = rightTodo->dtStart();
const auto leftDateTime = leftTodo->dtStart().dateTime();
const auto rightDateTime = rightTodo->dtStart().dateTime();
if (leftDateTime == rightDateTime) {
return 0;
......@@ -257,8 +257,8 @@ int TodoViewSortFilterProxyModel::compareDueDates(const QModelIndex &left,
// For sorting, no date is considered a very big date
return rightIsEmpty ? -1 : 1;
} else if (!leftIsEmpty) { // Both have due dates
const KDateTime leftDateTime = leftTodo->dtDue();
const KDateTime rightDateTime = rightTodo->dtDue();
const auto leftDateTime = leftTodo->dtDue().dateTime();
const auto rightDateTime = rightTodo->dtDue().dateTime();
if (leftDateTime == rightDateTime) {
return 0;
......
......@@ -70,8 +70,8 @@ void MainWindow::addView(const QString &viewName)
{
EventView *eventView = 0;
const KDateTime start = KDateTime::currentLocalDateTime().addDays(-1);
const KDateTime end = KDateTime::currentLocalDateTime().addDays(1);
const auto start = QDateTime::currentDateTime().addDays(-1);
const auto end = QDateTime::currentDateTime().addDays(1);
if (viewName == QStringLiteral("agenda")) {
eventView = new AgendaView(start.date(), end.date(), true, false, 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