mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 10:55:37 +00:00
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
This commit is contained in:
parent
a4a1978516
commit
c950ea92f5
|
@ -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();
|
||||
|
|
5
part.cpp
5
part.cpp
|
@ -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));
|
||||
|
|
Loading…
Reference in a new issue