Skip to content

Commit

Permalink
QDateTime::fromSecsSinceEpoch is not compatible with old qt (SailfishOS)
Browse files Browse the repository at this point in the history
  • Loading branch information
jmlich committed Dec 10, 2023
1 parent 43ce5af commit 2c29d19
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions daemon/src/services/simpleweatherservice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,11 @@ void SimpleWeatherService::sendWeather(CurrentWeather *weather)
{

qDebug() << "Current weather data"
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
<< QDateTime::fromSecsSinceEpoch(weather->dateTime())
#else
<< QDateTime::fromTime_t(weather->dateTime())
#endif
<< weather->dateTime()
<< weather->temperature() - 273.15
<< weather->minTemperature() - 273.15
Expand Down Expand Up @@ -80,7 +84,11 @@ void SimpleWeatherService::sendWeather(CurrentWeather *weather)


qDebug() << "Forecast Day" << f
#if QT_VERSION >= QT_VERSION_CHECK(5, 8, 0)
<< QDateTime::fromSecsSinceEpoch(fc.dateTime())
#else
<< QDateTime::fromTime_t(fc.dateTime())
#endif
<< fc.dateTime()
<< fc.minTemperature() - 273.15
<< fc.maxTemperature() - 273.15
Expand Down

0 comments on commit 2c29d19

Please sign in to comment.