mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
okular: handle negative dates in okularTime() function
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>
This commit is contained in:
parent
42d278939a
commit
ecbdf67627
1 changed files with 6 additions and 3 deletions
|
@ -13,7 +13,6 @@
|
|||
#include <qpainter.h>
|
||||
#include <kaboutdata.h>
|
||||
#include <klocale.h>
|
||||
#include <kdatetime.h>
|
||||
#include <kdebug.h>
|
||||
#include <kglobal.h>
|
||||
|
||||
|
@ -48,8 +47,12 @@ static QString okularString(const poppler::ustring &popplerstring)
|
|||
|
||||
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)
|
||||
|
|
Loading…
Add table
Reference in a new issue