mirror of
https://invent.kde.org/graphics/okular
synced 2024-08-25 10:55:37 +00:00
add a private reimplementation of metaData() so the text document generator can show the title of a document
svn path=/trunk/KDE/kdegraphics/okular/; revision=785821
This commit is contained in:
parent
89064c11bf
commit
c44ce52719
|
@ -131,6 +131,11 @@ QMutex* GeneratorPrivate::threadsLock()
|
|||
return m_threadsMutex;
|
||||
}
|
||||
|
||||
QVariant GeneratorPrivate::metaData( const QString &, const QVariant & ) const
|
||||
{
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
|
||||
Generator::Generator( QObject *parent, const QVariantList &args )
|
||||
: QObject( parent ), d_ptr( new GeneratorPrivate() )
|
||||
|
@ -291,9 +296,10 @@ bool Generator::print( QPrinter& )
|
|||
return false;
|
||||
}
|
||||
|
||||
QVariant Generator::metaData( const QString&, const QVariant& ) const
|
||||
QVariant Generator::metaData( const QString &key, const QVariant &option ) const
|
||||
{
|
||||
return QVariant();
|
||||
Q_D( const Generator );
|
||||
return d->metaData( key, option );
|
||||
}
|
||||
|
||||
ExportFormat::List Generator::exportFormats() const
|
||||
|
|
|
@ -46,6 +46,8 @@ class GeneratorPrivate
|
|||
|
||||
QMutex* threadsLock();
|
||||
|
||||
virtual QVariant metaData( const QString &key, const QVariant &option ) const;
|
||||
|
||||
DocumentPrivate *m_document;
|
||||
// NOTE: the following should be a QSet< GeneratorFeature >,
|
||||
// but it is not to avoid #include'ing generator.h
|
||||
|
|
|
@ -360,6 +360,16 @@ const Okular::DocumentSynopsis* TextDocumentGenerator::generateDocumentSynopsis(
|
|||
return &d->mDocumentSynopsis;
|
||||
}
|
||||
|
||||
QVariant TextDocumentGeneratorPrivate::metaData( const QString &key, const QVariant &option ) const
|
||||
{
|
||||
Q_UNUSED( option )
|
||||
if ( key == "DocumentTitle" )
|
||||
{
|
||||
return mDocumentInfo.get( "title" );
|
||||
}
|
||||
return QVariant();
|
||||
}
|
||||
|
||||
Okular::ExportFormat::List TextDocumentGenerator::exportFormats( ) const
|
||||
{
|
||||
static Okular::ExportFormat::List formats;
|
||||
|
|
|
@ -122,6 +122,8 @@ class TextDocumentGeneratorPrivate : public GeneratorPrivate
|
|||
|
||||
Q_DECLARE_PUBLIC( TextDocumentGenerator )
|
||||
|
||||
/* reimp */ QVariant metaData( const QString &key, const QVariant &option ) const;
|
||||
|
||||
void calculateBoundingRect( int startPosition, int endPosition, QRectF &rect, int &page ) const;
|
||||
void calculatePositions( int page, int &start, int &end ) const;
|
||||
Okular::TextPage* createTextPage( int ) const;
|
||||
|
|
Loading…
Reference in a new issue