diff --git a/VERSION b/VERSION index 78927e95e..6cae7d717 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -okular v0.21.60 +okular v0.22.60 diff --git a/core/document.cpp b/core/document.cpp index c96760e30..2d4e85d86 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -915,6 +915,8 @@ Document::OpenResult DocumentPrivate::openDocumentInternal( const KService::Ptr& { QString propName = offer->name(); QHash< QString, GeneratorInfo >::const_iterator genIt = m_loadedGenerators.constFind( propName ); + QString catalogName; + m_walletGenerator = 0; if ( genIt != m_loadedGenerators.constEnd() ) { m_generator = genIt.value().generator; @@ -976,6 +978,12 @@ Document::OpenResult DocumentPrivate::openDocumentInternal( const KService::Ptr& { m_generator->d_func()->m_document = 0; QObject::disconnect( m_generator, 0, m_parent, 0 ); + // TODO this is a bit of a hack, since basically means that + // you can only call walletDataForFile after calling openDocument + // but since in reality it's what happens I've decided not to refactor/break API + // One solution is just kill walletDataForFile and make OpenResult be an object + // where the wallet data is also returned when OpenNeedsPassword + m_walletGenerator = m_generator; m_generator = 0; qDeleteAll( m_pagesVector ); @@ -2562,6 +2570,7 @@ void Document::closeDocument() d->m_generator = 0; d->m_generatorName = QString(); d->m_url = QUrl(); + d->m_walletGenerator = 0; d->m_docFileName = QString(); d->m_xmlFileName = QString(); delete d->m_tempFile; @@ -4553,6 +4562,8 @@ void Document::walletDataForFile( const QString &fileName, QString *walletName, { if (d->m_generator) { d->m_generator->walletDataForFile( fileName, walletName, walletFolder, walletKey ); + } else if (d->m_walletGenerator) { + d->m_walletGenerator->walletDataForFile( fileName, walletName, walletFolder, walletKey ); } } diff --git a/core/document_p.h b/core/document_p.h index 6bbe3c4fa..73f5797a5 100644 --- a/core/document_p.h +++ b/core/document_p.h @@ -92,6 +92,7 @@ class DocumentPrivate m_memCheckTimer( 0 ), m_saveBookmarksTimer( 0 ), m_generator( 0 ), + m_walletGenerator( 0 ), m_generatorsLoaded( false ), m_pageController( 0 ), m_closingLoop( 0 ), @@ -246,6 +247,7 @@ class DocumentPrivate QHash m_loadedGenerators; Generator * m_generator; QString m_generatorName; + Generator * m_walletGenerator; bool m_generatorsLoaded; QVector< Page * > m_pagesVector; QVector< VisiblePageRect * > m_pageRects;