[Okular-devel] [Bug 177537] Use of deprecated method makes ruby bindings unusable

David Palacio dpalacio at uninorte.edu.co
Thu Dec 11 23:56:49 CET 2008


http://bugs.kde.org/show_bug.cgi?id=177537





--- Comment #2 from David Palacio <dpalacio uninorte edu co>  2008-12-11 23:56:49 ---
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


-- 
Configure bugmail: http://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Okular-devel mailing list