Commit 16bf5782 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

Make it compile without deprecated methods

parent 4c221bf7
......@@ -66,8 +66,9 @@ include_directories(${akonadi-calendar-tools_SOURCE_DIR} ${akonadi-calendar-tool
configure_file(console-version.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/console-version.h @ONLY)
#add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
if (EXISTS "${CMAKE_SOURCE_DIR}/.git")
add_definitions(-DQT_DISABLE_DEPRECATED_BEFORE=0x060000)
endif()
add_subdirectory(calendarjanitor)
add_subdirectory(konsolekalendar)
......
......@@ -52,7 +52,7 @@ KonsoleKalendarEpoch::~KonsoleKalendarEpoch()
QDateTime KonsoleKalendarEpoch::epoch2QDateTime(uint epoch)
{
QDateTime dt;
dt.setTime_t(epoch);
dt.setSecsSinceEpoch(epoch);
return dt;
}
......@@ -63,9 +63,9 @@ uint KonsoleKalendarEpoch::QDateTime2epoch(const QDateTime &dt)
// SORRY QT DOESN'T HANDLE DAYLIGHT SAVINGS TIME.
// Compute #seconds to subtract for local timezone difference from UTC.
int offset = QDateTime::currentDateTime().toUTC().toTime_t()
-QDateTime::currentDateTime().toTime_t();
return dt.toTime_t() - offset;
int offset = QDateTime::currentDateTime().toUTC().toSecsSinceEpoch()
-QDateTime::currentDateTime().toSecsSinceEpoch();
return dt.toSecsSinceEpoch() - offset;
}
#if defined (TEST)
......
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