Commit 60575bef authored by Volker Krause's avatar Volker Krause
Browse files

Fix build without Poppler

parent d7bc98d7
......@@ -191,6 +191,7 @@ int PdfDocument::fileSize() const
return d->m_pdfData.size();
}
#ifdef HAVE_POPPLER
static QDateTime parsePdfDateTime(const char *str)
{
int year, month, day, hour, min, sec, tzHours, tzMins;
......@@ -214,9 +215,11 @@ static QDateTime parsePdfDateTime(const char *str)
}
return QDateTime(date, time, Qt::UTC);
}
#endif
QDateTime PdfDocument::creationTime() const
{
#ifdef HAVE_POPPLER
std::unique_ptr<GooString> dt(d->m_popplerDoc->getDocInfoCreatDate());
if (!dt) {
return {};
......@@ -226,10 +229,14 @@ QDateTime PdfDocument::creationTime() const
#else
return parsePdfDateTime(dt->getCString());
#endif
#else
return {};
#endif
}
QDateTime PdfDocument::modificationTime() const
{
#ifdef HAVE_POPPLER
std::unique_ptr<GooString> dt(d->m_popplerDoc->getDocInfoModDate());
if (!dt) {
return {};
......@@ -239,6 +246,9 @@ QDateTime PdfDocument::modificationTime() const
#else
return parsePdfDateTime(dt->getCString());
#endif
#else
return {};
#endif
}
QVariantList PdfDocument::pagesVariant() const
......
......@@ -21,10 +21,12 @@
#include <config-kitinerary.h>
#include <qglobal.h>
#ifdef HAVE_POPPLER
#if KPOPPLER_VERSION >= QT_VERSION_CHECK(0, 82, 0)
using PopplerMaskColors = const int;
#else
using PopplerMaskColors = int;
#endif
#endif
#endif // KITINERARY_POPPLERTYPES_P_H
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