Bug 325667 - RuntimeError when calling <containment>.toolBoxItem() method from a python plasmoid
Summary: RuntimeError when calling <containment>.toolBoxItem() method from a python pl...
Status: RESOLVED INTENTIONAL
Alias: None
Product: bindings
Classification: Developer tools
Component: pykde (show other bugs)
Version: 4.11.1
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: kde-bindings
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-10-05 13:20 UTC by Benoît Monin
Modified: 2013-12-17 22:02 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Benoît Monin 2013-10-05 13:20:30 UTC
Calling the methods toolBox or toolBoxItem of a plasma.containment object in a python plasmoid cause a runtime error with the following message :

RuntimeError: no access to protected functions or signals for objects not created from Python

This was previously working before upgrading to python-sip 4.15.1, and is still crashing after updating to 4.15.2. This is tested on a machine running openSUSE tumbleweed, on which python-sip was updated around 18-09-2013.

Reproducible: Always

Steps to Reproduce:
1. Make sure python-sip is installed with version >= 4.15.1
2. Create a basic python plasmoid based on the tutorial [http://techbase.kde.org/Development/Tutorials/Plasma/PythonPlasmoid]
3. Add one of the following line at the end of the init method:
    self.containment().toolBoxItem()
    self.containment().toolBox()
4. Start the plasmoid with plasmoidviewer
Actual Results:  
This is the output to the console running pasmoidviewer:
Connecting to battery 
you don't appear to have a battery.
Traceback (most recent call last):
  File "/usr/share/kde4/apps/plasma_scriptengine_python/pyappletscript.py", line 75, in init
    self.pyapplet.init()
  File "/home/user/plasmoid-tutorial/contents/code/main.py", line 21, in init
    self.containment().toolBox()
RuntimeError: no access to protected functions or signals for objects not created from Python


Expected Results:  
The plasmoid should run without crashing.
Comment 1 Pulfer 2013-10-09 05:19:21 UTC
I've got this issue with python-sip 4.14.5 and pykde4 4.11.2.
Comment 3 Baconmon 2013-11-13 22:08:43 UTC
I voted 20 votes for this bug..
And I bet lots of other people would vote for this bug too if they knew they could..
This regression really needs to be fixed!..
My experience with KDE is going to be more aggravating until this bug is fixed.. As I'm sure many many other KDE users' experience will be as well..

I think aaron seigo him self should have to fix this bug since he is the one that was so adamant about keeping a certain "feature" in KDE.. −_−
Comment 4 Aaron J. Seigo 2013-12-13 11:13:45 UTC
That API is not intended for external consumption.

p.s. Baconmon's comment is exactly the sort of the thing that drove me to having far less to do with KDE than I used to; the community has no problems with people taking pot-shots at other people and generally being assholes to each other, which is not the sort of environment I choose to work in.
Comment 5 Aaron J. Seigo 2013-12-13 11:16:47 UTC
Ah, and to expand on that "not intended" bit: Plasmoids are not supposed to be able to touch the containment or other plasmoids (for obvious safety and security reasons), the only reason they could was because of limitations in QGraphicsView in this regard. With QML2, Plasma 2 seals this off entirely. So even "fixing" this now will simply be broken in future.

Please stop working around things with dangerous and unsupported *hacks* and do it properly: use a containment that does not have a toolbox. That has been the option for what, 6 years now? Nobody bothers to do it even though it would be far less work than maintaining these broken-by-design plasmoids.

Why people insist on taking the wrong approach when there is a clearly supported useful approach that would do precisely what they want is beyond me.
Comment 6 Benjamin 2013-12-17 22:02:10 UTC
*** This bug has been confirmed by popular vote. ***