From e0cb30ffbf65cd81884c28ee272b6918fa1e6e9d Mon Sep 17 00:00:00 2001 From: Pino Toscano Date: Sun, 28 Jan 2007 16:10:12 +0000 Subject: [PATCH] Ok, now really load the generators that are supposed to have a setting widget when we want to configure them. svn path=/trunk/playground/graphics/okular/; revision=627921 --- core/document.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/core/document.cpp b/core/document.cpp index e34680666..a3526de4a 100644 --- a/core/document.cpp +++ b/core/document.cpp @@ -119,6 +119,7 @@ class Document::Private bool openRelativeFile( const QString & fileName ); Generator * loadGeneratorLibrary( const QString& name, const QString& libname ); void loadAllGeneratorLibraries(); + void loadServiceList( const KService::List& offers ); // private slots void saveDocumentInfo() const; @@ -485,6 +486,11 @@ void Document::Private::loadAllGeneratorLibraries() QString constraint("([X-KDE-Priority] > 0) and (exist Library)") ; KService::List offers = KServiceTypeTrader::self()->query( "okular/Generator", constraint ); + loadServiceList( offers ); +} + +void Document::Private::loadServiceList( const KService::List& offers ) +{ int count = offers.count(); if ( count <= 0 ) return; @@ -2088,8 +2094,10 @@ void Document::fillConfigDialog( KConfigDialog * dialog ) if ( !dialog ) return; - // ensure that we have all the generators loaded - d->loadAllGeneratorLibraries(); + // ensure that we have all the generators with settings loaded + QString constraint( "([X-KDE-Priority] > 0) and (exist Library) and ([X-KDE-okularHasInternalSettings])" ); + KService::List offers = KServiceTypeTrader::self()->query( "okular/Generator", constraint ); + d->loadServiceList( offers ); QHash< QString, GeneratorInfo >::iterator it = d->m_loadedGenerators.begin(); QHash< QString, GeneratorInfo >::iterator itEnd = d->m_loadedGenerators.end();