Commit c950ea92 authored by Albert Astals Cid's avatar Albert Astals Cid
Browse files

PDF: Add a "Using Poppler $VERSION" string

It is sometimes useful to know which version of the poppler you're using
and to which you where built

Needs feature introduced in poppler just now
parent a4a19785
......@@ -107,6 +107,15 @@ int main()
}
" HAVE_POPPLER_0_69)
check_cxx_source_compiles("
#include <poppler-version.h>
int main()
{
QString s = Poppler::Version::string();
return 0;
}
" HAVE_POPPLER_0_73)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/config-okular-poppler.h.cmake
${CMAKE_CURRENT_BINARY_DIR}/config-okular-poppler.h
......
......@@ -33,3 +33,6 @@
/* Defined if we have the 0.69 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_69 1
/* Defined if we have the 0.73 version of the Poppler library */
#cmakedefine HAVE_POPPLER_0_73 1
......@@ -53,6 +53,7 @@
#include <config-okular-poppler.h>
#include <poppler-media.h>
#include <poppler-version.h>
#include "debug_pdf.h"
#include "annots.h"
......@@ -1490,6 +1491,16 @@ QVariant PDFGenerator::metaData( const QString & key, const QVariant & option )
#ifdef HAVE_POPPLER_0_53
QMutexLocker ml(userMutex());
return QVariant::fromValue<QVector<int>>(pdfdoc->formCalculateOrder());
#endif
}
else if ( key == QLatin1String("GeneratorExtraDescription") )
{
#ifdef HAVE_POPPLER_0_73
if (Poppler::Version::string() == POPPLER_VERSION) {
return i18n("Using Poppler %1", Poppler::Version::string());
} else {
return i18n("Using Poppler %1\n\nBuilt against Poppler %2", Poppler::Version::string(), POPPLER_VERSION);
}
#endif
}
return QVariant();
......
......@@ -3166,6 +3166,11 @@ void Part::slotAboutBackend()
}
}
const QString extraDescription = m_document->metaData( QStringLiteral("GeneratorExtraDescription") ).toString();
if (!extraDescription.isEmpty()) {
aboutData.setShortDescription(aboutData.shortDescription() + QStringLiteral("\n\n") + extraDescription);
}
if (!icon.isNull()) {
// 48x48 is what KAboutApplicationDialog wants, which doesn't match any default so we hardcode it
aboutData.setProgramLogo(icon.pixmap(48, 48));
......
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