Commit aab7955c authored by Albert Astals Cid's avatar Albert Astals Cid

Remove ifdefs, we require Qt 5.14 now

parent bb635324
......@@ -20,11 +20,7 @@ using namespace KCalendarCore;
// See bug 345498.
void TestDateSerialization::testNewRecurringTodo()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QDateTime startDate = QDate(2015, 3, 24).startOfDay();
#else
QDateTime startDate { QDate(2015, 3, 24) };
#endif
QDateTime dueDate { startDate.addDays(1) };
Todo::Ptr todo(new Todo);
......@@ -55,11 +51,7 @@ void TestDateSerialization::testNewRecurringTodo()
// See bug 345565.
void TestDateSerialization::testTodoCompletedOnce()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QDateTime startDate = QDate::currentDate().startOfDay();
#else
QDateTime startDate { QDate::currentDate() };
#endif
QDateTime dueDate { startDate.addDays(1) };
Todo::Ptr todo(new Todo);
......
......@@ -84,11 +84,7 @@ void FreeBusyPeriodTest::testDataStreamOut()
void FreeBusyPeriodTest::testDataStreamIn()
{
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
const QDateTime p1DateTime = QDate(2006, 8, 30).startOfDay();
#else
const QDateTime p1DateTime(QDate(2006, 8, 30));
#endif
const Duration duration(24 * 60 * 60);
FreeBusyPeriod p1(p1DateTime, duration);
p1.setSummary(QStringLiteral("I can haz summary?"));
......
......@@ -217,11 +217,7 @@ void ICalFormatTest::testAlarm()
ICalFormat format;
Event::Ptr event(new Event);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
event->setDtStart(QDate(2017, 03, 24).startOfDay());
#else
event->setDtStart(QDateTime(QDate(2017, 03, 24)));
#endif
Alarm::Ptr alarm = event->newAlarm();
alarm->setType(Alarm::Display);
alarm->setStartOffset(Duration(0));
......
......@@ -204,11 +204,7 @@ void TimesInIntervalTest::testLocalTimeHandlingAllDay()
: QTimeZone(QByteArray("America/Toronto")));
Event event;
event.setAllDay(true);
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
event.setDtStart(QDate(2019, 10, 11).startOfDay());
#else
event.setDtStart(QDateTime(QDate(2019, 10, 11)));
#endif
RecurrenceRule * const rule = new RecurrenceRule();
rule->setRecurrenceType(RecurrenceRule::rDaily);
......@@ -227,11 +223,7 @@ void TimesInIntervalTest::testLocalTimeHandlingAllDay()
// A simple date, will apply.
recurrence->addExDate(QDate(2019, 10, 14));
// A date only local time, will apply.
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
recurrence->addExDateTime(QDate(2019, 10, 15).startOfDay());
#else
recurrence->addExDateTime(QDateTime(QDate(2019, 10, 15)));
#endif
// A date time starting at 00:00 in another zone, will not apply.
recurrence->addExDateTime(QDateTime(QDate(2019, 10, 17), QTime(), anotherZone));
// A date time starting at 00:00 in the system time zone, will apply.
......@@ -246,11 +238,7 @@ void TimesInIntervalTest::testLocalTimeHandlingAllDay()
// nor either of the exception date times.
const QList<int> expectedDays { 11, 16, 17, 18, 21, 22, 23, 25 };
for (int day : expectedDays) {
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QVERIFY(timesInInterval.contains(QDate(2019, 10, day).startOfDay()));
#else
QVERIFY(timesInInterval.contains(QDateTime(QDate(2019, 10, day))));
#endif
}
QCOMPARE(timesInInterval.size(), expectedDays.size());
}
......
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