Commit dab65cd4 authored by Pino Toscano's avatar Pino Toscano

properly keep a reference to the print option widget, and create it only when necessary

BUG: 167353

svn path=/trunk/KDE/kdegraphics/okular/; revision=837341
parent 8bad2a86
......@@ -255,13 +255,12 @@ OKULAR_EXPORT_PLUGIN(PDFGenerator, createAboutData())
PDFGenerator::PDFGenerator( QObject *parent, const QVariantList &args )
: Generator( parent, args ), pdfdoc( 0 ), ready( true ),
pixmapRequest( 0 ), docInfoDirty( true ), docSynopsisDirty( true ),
docEmbeddedFilesDirty( true ), nextFontPage( 0 ), pdfOptionsPage( 0 )
docEmbeddedFilesDirty( true ), nextFontPage( 0 )
{
setFeature( TextExtraction );
setFeature( FontInfo );
setFeature( PrintPostscript );
setFeature( ReadRawData );
pdfOptionsPage = new PDFOptionsPage();
// update the configuration
reparseConfig();
// generate the pixmapGeneratorThread
......@@ -1509,6 +1508,10 @@ void PDFGenerator::loadPdfSync( const QString & filePath, QVector<Okular::Page*>
QWidget* PDFGenerator::printConfigurationWidget() const
{
if ( !pdfOptionsPage )
{
const_cast<PDFGenerator*>(this)->pdfOptionsPage = new PDFOptionsPage();
}
return pdfOptionsPage;
}
......
......@@ -15,6 +15,7 @@
#include <poppler-qt4.h>
#include <qpointer.h>
#include <qthread.h>
#include <okular/core/document.h>
......@@ -142,7 +143,7 @@ class PDFGenerator : public Okular::Generator, public Okular::ConfigInterface, p
QVector<bool> rectsGenerated;
PDFOptionsPage * pdfOptionsPage;
QPointer<PDFOptionsPage> pdfOptionsPage;
};
......
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