jump to navigation

Rocs and Plugins March 25, 2010

Posted by tumaix in planetkde-tomazcanabrava.
trackback

I wrote this post a month back, but just now I have decided to post it.

Well, some weeks back i commited an initial project for plugins on Rocs, and it’s almost finished… but i had a question about life, the universe and everything: Why i took too long (3 weeks) to put it to work ?

First, i have some others stuff to do, but, this is not a true answer…

Second, I started with QtPlugins, It worked very well! But, and it is a big but, how will Rocs know the location of the installed plugins? since plugins are shared lib loaded at runtime, I had to make this work somehow. So at IRC, #kde-dev, Rakuko told me something about KServices, unknow by me till then. So, with a little search on the KDE api, i found the rigth way (or KDE way) to make it works flawessly.

So, I had to stop doing with Qt Plugins and rewriting everything to use KServices, back from line zero. =)

After some hack. i had a problem loading the plugins, they were found in the system, but not loaded… So i started to look at other plugins (from kopete for instance) , Plugin example from kdevelop (What if some KDE programs where closed source? Maybe i will be still boring people at IRC to resolve that =). But it worked, compiled in a charmingly and cute way, then I forgot to work on them for another week.

Until the end of last week Rocs was compiled with static libs, so Tomaz made a shared lib with core classes, including plugin manager and interfaces and i went back to hack today. Looking at TextEditor plugin example, i saw 2 things that i have not noticied back then: use of library export (KDE_EXPORT/KDE_IMPORT) and use of explicit at contructor, both at interface class declaration.

With this 2 things, plugins started to load

Now Rocs have import/export and initial tools plugins suport. In next post i will give all the needs to write your own plugin… by now take a look in this screenshot of import/export and a set of nodes with some properties.


[]’s

Wagner Reck

Comments»

1. J Janz - March 25, 2010

Er … Sorry, nothing to do with it but … which is that win deco and widget style theme? Thanks, in advance.

Luis Fernando Planella Gonzalez - March 25, 2010

I’ve clicked over the item in google reader just to be able to ask the same! lol!

Wagner - April 5, 2010
2. abcv - March 28, 2010

>> how will Rocs know the location of the installed plugins?

I may be misunderstanding your problem, but this is covered in the Qt documentation:

“you can add as many paths as you need with calls to QCoreApplication::addLibraryPath()”

http://qt.nokia.com/doc/4.2/plugins-howto.html

Wagner Reck - April 5, 2010

Hi

i saw it, but, for instance a instalation on linux at /usr/bin, will need a dir called plugins (‘messing’ the user bin)

KService make more organized about it. To a Qt only app, Qt plugins are a great tool and about where plugins are intalled QCoreApplication::addLibraryPath().

Wagner


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: