Summary: | missing plugin keyword when creating generators | ||
---|---|---|---|
Product: | [Applications] okular | Reporter: | David Palacio <dpalacio> |
Component: | general | Assignee: | Okular developers <okular-devel> |
Status: | CLOSED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Compiled Sources | ||
OS: | Unspecified | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
David Palacio
2008-12-11 22:38:03 UTC
There's something I don't understand in your report, that makes me think the problem does not lie in Okular. Let's start from the Okular line: > Generator * generator = factory->create< Okular::Generator >( 0 ); and then the various create() overloads in KPluginFactory: a) T *create(QObject *parent = 0, const QVariantList &args = QVariantList()); b) T *create(const QString &keyword, QObject *parent = 0, const QVariantList &args = QVariantList()); c) T *create(QWidget *parentWidget, QObject *parent, const QString &keyword = QString(), const QVariantList &args = QVariantList()); d) KDE_DEPRECATED T *create(QObject *parent, const QStringList &args) e) KDE_DEPRECATED QObject *create(QObject *parent = 0, const char *classname = "QObject", const QStringList &args = QStringList()) f) virtual QObject *create(const char *iface, QWidget *parentWidget, QObject *parent, const QVariantList &args, const QString &keyword); it seems pretty clear that (when compiling it) the chosen one is (a). Let's go to to the implementation of (a): > inline T *KPluginFactory::create(QObject *parent, const QVariantList &args) > { > QObject *o = create(T::staticMetaObject.className(), parent && parent->isWidgetType() ? reinterpret_cast<QWidget *>(parent): 0, parent, args, QString()); Thus, the create() used by Okular in the end calls the virtual create() that is reimplemented by the KRubyPluginFactory. Parent is passed (null), keyword is empty, and there are no arguments. Other ideas? On Thursday 11 December 2008 16:57:53 Pino Toscano wrote: > There's something I don't understand in your report, that makes me think > the problem does not lie in Okular. > > Let's start from the Okular line: > > Generator * generator = factory->create< Okular::Generator >( 0 ); > > and then the various create() overloads in KPluginFactory: > > a) T *create(QObject *parent = 0, const QVariantList &args = > QVariantList()); b) T *create(const QString &keyword, QObject *parent = 0, > const QVariantList &args = QVariantList()); > c) T *create(QWidget *parentWidget, QObject *parent, const QString &keyword > = QString(), const QVariantList &args = QVariantList()); > d) KDE_DEPRECATED T *create(QObject *parent, const QStringList &args) > e) KDE_DEPRECATED QObject *create(QObject *parent = 0, const char > *classname = "QObject", const QStringList &args = QStringList()) > f) virtual QObject *create(const char *iface, QWidget *parentWidget, > QObject *parent, const QVariantList &args, const QString &keyword); > > it seems pretty clear that (when compiling it) the chosen one is (a). Correct. I said that. > Let's go to to the implementation of (a): > > inline T *KPluginFactory::create(QObject *parent, const QVariantList > > &args) { > > QObject *o = create(T::staticMetaObject.className(), parent && > > parent->isWidgetType() ? reinterpret_cast<QWidget *>(parent): 0, parent, > > args, QString()); > > Thus, the create() used by Okular in the end calls the virtual create() > that is reimplemented by the KRubyPluginFactory. > Parent is passed (null), keyword is empty, and there are no arguments. Correct. I said that too. > Other ideas? The problem is that the ruby plugin .desktop file contains a X-KDE-PluginKeyword that describes the file to load which is ignored by Okular. This keyword is the one passed to the create method. X-KDE-PluginKeyword=folder/script.rb Right now, when I execute this plugin within the Okular kpart, this appears in the program output: KRubyPluginFactory::create: Ruby script "" missing "" is the keyword parameter from KRubyPluginFactory::create I'd read the keyword from KService::keywords() http://api.kde.org/4.x-api/kdelibs-apidocs/kdecore/html/classKService.html#f770ba5a418ed2b0c8dfa5d014536e7c And pass it to the create method. > I'd read the keyword from KService::keywords()
Not really, but pluginKeyword().
Confirming and giving a better title, fix coming in a minute.
SVN commit 895926 by pino: Pass the plugin keyword when creating generators. This should make the Ruby binding work again. BUG: 177537 M +1 -1 document.cpp WebSVN link: http://websvn.kde.org/?view=rev&revision=895926 |