[Kde-bindings] Ruby Plasmoid article

Thomas Moenicke tm at php-qt.org
Fri Aug 8 09:32:34 UTC 2008


On Aug 8, 2008, at 10:11 AM, Declan McGrath wrote:

> On Wednesday 06 August 2008 12:28:05 Richard Dale wrote:
>> On Wednesday 06 August 2008 10:46:28 Richard Dale wrote:
>>> On Wednesday 06 August 2008 03:33:39 Sebastian Sauer wrote:
>>>> forwarded to kde-bindings at kde.org since probably someone there  
>>>> knows
>>>> why Ruby Plasma Applets don't work any longer?! Looks as something
>>>> essential was changed right after our bindings-sprint and before  
>>>> the
>>>> 4.1.0 release (yay, I love feature-freezes).
>>>>
>>>> On Wednesday 06 August 2008, Sebastian Sauer wrote:
>>>>> On Saturday 02 August 2008, Declan McGrath wrote:
>>>>>> Hi Sebastian,
>>>>>
>>>>> and hi Declan,
>>>>>
>>>>> first sorry for the long time till I replied. I am atm quit busy  
>>>>> with
>>>>> so much things that it's hard to react on more complex things in
>>>>> realtime ;)
>>>>>
>>>>>> Loved your article on the Ruby Plasmoids at
>>>>>> http://techbase.kde.org/Development/Tutorials/Plasma/RubyApplet.
>>>>>> Thanks!
>>>>>
>>>>> Thank you too! Feedback is a rather useful thing since it shows  
>>>>> that
>>>>> it's really worth and needed(!!!) to write such tutorials.
>>>>>
>>>>>> I had a couple of difficulties whilst trying to get the  
>>>>>> tutorial to
>>>>>> work though. I've put up a blog post on my site at
>>>>>> http://www.theirishpenguin.com/2008/08/02/getting-ruby-plasmoids-up
>>>>>> -a nd -r un ning-in-kde-41-on-kubuntu
>>>>>
>>>>> wow.
>>>>>
>>>>>> The main issue I had was around the CMakeLists.txt file  
>>>>>> initially.
>>>>>> But now I'm stuck getting a 'findServiceByDesktopPath:  not  
>>>>>> found'
>>>>>> error when trying to run the plasmoid? Everything seems to have
>>>>>> installed correctly.
>>>>>>
>>>>>> Once I get it working I can tidy up my blog post or perhaps  
>>>>>> better
>>>>>> still migrate some of the content into your Techbase wiki article
>>>>>> to add a little more explananation to things like cmake and how  
>>>>>> to
>>>>>> install the plasmoid.
>>>>>
>>>>> uhm, seems I get something similar now;
>>>>>
>>>>> plasmoidviewer(20804)/libplasma Plasma::isPluginVersionCompatible:
>>>>> plugin is compiled against incompatible Plasma version    
>>>>> 4294967295
>>>>> plasmoidviewer(20804)/libplasma
>>>>> Plasma::ContainmentPrivate::addApplet: Applet
>>>>> "plasma-ruby-web-applet" could not be loaded.
>>>>> findServiceByDesktopPath:  not found
>>>>>
>>>>> The interesting part here is the "incompatible Plasma version"  
>>>>> which
>>>>> was not the case ~2 weeks ago :-/
>>>>> hmmm... since I use trunk I try to recompile bindings right now  
>>>>> what
>>>>> may take a while. Else I would suggest to ask at the kde-bindings
>>>>> mailinglist (http://www.kde.org/mailinglists/) where more  
>>>>> developers
>>>>> hang around ;)
>>>>
>>>> I keep to get that error in trunk too :-/
>>>
>>> The C++ clock .desktop file has this line in it:
>>>
>>> X-KDE-PluginInfo-Version=pre0.1
>>>
>>> Does adding that to the ruby applet's .desktop make it work? But we
>>> really should be switching to the ScriptEngine based api for Ruby
>>> applets. I haven't had time to convert some examples and generally  
>>> try it
>>> out yet though.
>>
>> I've confirmed that script engine based ruby plasmoids don't have any
>> versioning problem at the moment, although C++ style Ruby plasmoids  
>> do.
>>
>> I've done some more investigating and found out what the problem  
>> is. There
>> is a macro you can add to a compiled C++ plugin that gives its  
>> version
>> number. But the krubypluginfactory.cpp source doesn't have it  
>> because it is
>> supposed to work for any KDE plugin. Which is a bit of a problem.  
>> So as a
>> workround you can add these lines to kpluginfactory.cpp to get just  
>> plasma
>> plugins working:
>>
>> Index: krubypluginfactory.cpp
>> ===================================================================
>> --- krubypluginfactory.cpp      (revision 842545)
>> +++ krubypluginfactory.cpp      (working copy)
>> @@ -93,6 +93,8 @@
>>         static QByteArray camelize(QByteArray name);
>> };
>> K_EXPORT_PLUGIN(KRubyPluginFactory)
>> +#include <plasma/version.h>
>> +K_EXPORT_PLUGIN_VERSION(PLASMA_VERSION)
>>
>> KRubyPluginFactory::KRubyPluginFactory()
>>
>>     : KPluginFactory() // no useful KComponentData object for now
>>
>> The macro looks like this:
>>
>> #define K_EXPORT_PLUGIN_VERSION(version) \
>> Q_EXTERN_C KDE_EXPORT const quint32 kde_plugin_version = version;
>>
>> So what we will need to do is to be able to set  
>> 'kde_plugin_version' for an
>> individual plugin at runtime, by reading the value from somewhere  
>> in the
>> directory where the plugin Ruby code is installed. Maybe a one line  
>> text
>> file called 'KDE_PLUGIN_VERSION' or something? We have the same  
>> problem
>> with C# plugins too.
>
> Hi all,
>
> Thanks for the update on this which was confusing the hell out of  
> me. What do
> I need to do to get the Ruby bindings working on my desktop (running  
> Kubuntu
> Hardy with KDE 4.1.0)? As you are mentioning .cpp files I take it  
> that some
> sort of a recompile would be necessary. As I'm not familiar with  
> doing that
> will this fix be released soon into a future version of KDE?
>
> Also, you mentioned Script Engine vs C++ style plasmoids. Am I  
> correct in
> assuming that the the problems mentioned above affect only the C++  
> style?
>
> If the Script Engine style is better is there any good resources  
> that I can
> use to switch to using this for my Ruby plasmids? I'd be happy to  
> help out
> with a TechBase tutorial article or two, time permitting.
>
> Anyway, keep up the great work. KDE 4.1.0 is fantastic (despite my  
> Ruby
> binding issues :-)
>
> All the best,
> Declan



how about I explain that to you next time at the Longstone Pub :)





More information about the Kde-bindings mailing list