poppler::get_creation_date() and the other date-related functions are not
documented to return such but it happens
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
#include <qpainter.h>
#include <kaboutdata.h>
#include <klocale.h>
-#include <kdatetime.h>
#include <kdebug.h>
#include <kglobal.h>
static QString okularTime(const popplertimetype &popplertime)
{
- const KDateTime kdatetime(QDateTime::fromTime_t(popplertime));
- return KGlobal::locale()->formatDateTime(kdatetime, QLocale::NarrowFormat);
+ if (popplertime <= 0) {
+ // -1, i.e. not set
+ return QString();
+ }
+ const QDateTime qdatetime(QDateTime::fromTime_t(popplertime));
+ return KGlobal::locale()->formatDateTime(qdatetime, QLocale::NarrowFormat);
}
static QDateTime okularDateTime(const popplertimetype &popplertime)