mirror of
https://bitbucket.org/smil3y/kde-extraapps.git
synced 2025-02-23 18:32:53 +00:00
okular: manage mutexes via QMutexLocker [ci reset]
Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
d657dbcd17
commit
62a59fb621
4 changed files with 5 additions and 19 deletions
|
@ -128,10 +128,8 @@ bool DjVuGenerator::doCloseDocument()
|
|||
|
||||
QImage DjVuGenerator::image( Okular::PixmapRequest *request )
|
||||
{
|
||||
userMutex()->lock();
|
||||
QImage img = m_djvu->image( request->pageNumber(), request->width(), request->height(), request->page()->rotation() );
|
||||
userMutex()->unlock();
|
||||
return img;
|
||||
QMutexLocker locker( userMutex() );
|
||||
return m_djvu->image( request->pageNumber(), request->width(), request->height(), request->page()->rotation() );
|
||||
}
|
||||
|
||||
const Okular::DocumentInfo * DjVuGenerator::generateDocumentInfo()
|
||||
|
@ -190,7 +188,6 @@ const Okular::DocumentSynopsis * DjVuGenerator::generateDocumentSynopsis()
|
|||
m_docSyn = new Okular::DocumentSynopsis();
|
||||
recurseCreateTOC( *m_docSyn, *doc, *m_docSyn, m_djvu );
|
||||
}
|
||||
locker.unlock();
|
||||
|
||||
return m_docSyn;
|
||||
}
|
||||
|
|
|
@ -76,8 +76,6 @@ bool DviGenerator::loadDocument( const QString & fileName, QVector< Okular::Page
|
|||
//kDebug(DviDebug) << "file:" << fileName;
|
||||
KUrl base( fileName );
|
||||
|
||||
(void)userMutex();
|
||||
|
||||
m_dviRenderer = new dviRenderer(documentMetaData("TextHinting", QVariant()).toBool());
|
||||
connect( m_dviRenderer, SIGNAL( error(QString,int) ), this, SIGNAL( error(QString,int) ) );
|
||||
connect( m_dviRenderer, SIGNAL( warning(QString,int) ), this, SIGNAL( warning(QString,int) ) );
|
||||
|
@ -265,8 +263,6 @@ QImage DviGenerator::image( Okular::PixmapRequest *request )
|
|||
}
|
||||
}
|
||||
|
||||
lock.unlock();
|
||||
|
||||
delete pageInfo;
|
||||
|
||||
return ret;
|
||||
|
|
|
@ -1041,10 +1041,8 @@ QVariant PDFGenerator::metaData( const QString & key, const QVariant & option )
|
|||
}
|
||||
else if ( key == "DocumentTitle" )
|
||||
{
|
||||
userMutex()->lock();
|
||||
QString title = pdfdoc->info( "Title" );
|
||||
userMutex()->unlock();
|
||||
return title;
|
||||
QMutexLocker ml(userMutex());
|
||||
return pdfdoc->info( "Title" );
|
||||
}
|
||||
else if ( key == "OpenTOC" )
|
||||
{
|
||||
|
@ -1692,7 +1690,7 @@ bool PDFGenerator::save( const QString &fileName, SaveOptions options, QString *
|
|||
if ( options & SaveChanges )
|
||||
pdfConv->setPDFOptions( pdfConv->pdfOptions() | Poppler::PDFConverter::WithChanges );
|
||||
|
||||
QMutexLocker locker( userMutex() );
|
||||
QMutexLocker ml(userMutex());
|
||||
bool success = pdfConv->convert();
|
||||
if (!success)
|
||||
{
|
||||
|
|
|
@ -2126,13 +2126,8 @@ XpsGenerator::XpsGenerator( QObject *parent, const QVariantList &args )
|
|||
{
|
||||
setFeature( TextExtraction );
|
||||
setFeature( PrintNative );
|
||||
// activate the threaded rendering iif:
|
||||
// 1) QFontDatabase says so
|
||||
// 2) Qt >= 4.4.0 (see Trolltech task ID: 169502)
|
||||
// 3) Qt >= 4.4.2 (see Trolltech task ID: 215090)
|
||||
if ( QFontDatabase::supportsThreadedFontRendering() )
|
||||
setFeature( Threaded );
|
||||
userMutex();
|
||||
}
|
||||
|
||||
XpsGenerator::~XpsGenerator()
|
||||
|
|
Loading…
Add table
Reference in a new issue