summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Richardson <arichardson.kde@gmail.com>2015-04-22 13:08:32 (GMT)
committerAlex Richardson <arichardson.kde@gmail.com>2015-05-22 15:33:09 (GMT)
commitc2fc0199b8f7cf1f0a4bfee0568fa68ec8d1d6ab (patch)
treebdd810455e4db23db1e66fd381465e64caf4e351
parent1049dc188a6138b0b28cb526bb7e513d61e95277 (diff)
Use KPluginFactory::createInstance<Okular::Generator>()
Now that all generators have the necessary Q_INTERFACES() it works again This restores the behaviour from before commit e4a4d400c35b3e41a60d4 REVIEW: 123466
-rw-r--r--core/document.cpp10
1 files changed, 3 insertions, 7 deletions
diff --git a/core/document.cpp b/core/document.cpp
index 2d4e85d..34218f5 100644
--- a/core/document.cpp
+++ b/core/document.cpp
@@ -824,18 +824,14 @@ Generator * DocumentPrivate::loadGeneratorLibrary( const KService::Ptr &service
return 0;
}
- QObject* plugin = service->createInstance<QObject>();
- // vHanda: qobject_cast seems to be failing. Not sure why!
- Generator* generator = dynamic_cast< Okular::Generator* >(plugin);
-#pragma message("We're using dynamic_cast over here instead of qobject_cast")
- // Generator * generator = factory->create< Okular::Generator >( service->pluginKeyword(), 0 );
+ Generator * plugin = service->createInstance<Okular::Generator>();
// GeneratorInfo info( factory->componentData() );
KComponentData data = KComponentData::mainComponent();
GeneratorInfo info( data );
- info.generator = generator;
+ info.generator = plugin;
m_loadedGenerators.insert( service->name(), info );
- return generator;
+ return plugin;
}
void DocumentPrivate::loadAllGeneratorLibraries()