Kio.KRun Segmentation fault in plasma2 widget

Nicola Felice nicola at dominiofelice.com
Mon Jul 20 20:30:05 UTC 2015


I posted this message to the plasma5 forum 
(https://forum.kde.org/viewtopic.php?f=289&t=127322) and an administrator 
replied to write here too.

I'm playing with plasma widget development, I am currently trying to write a 
widget to launch a .desktop file. I have some problems finding the 
documentation but finally I found a way to launch a program looking in the 
official SystemLoadViewer sources.
[kdeplasma-addons.git] / applets / systemloadviewer / package / contents / ui 
/ SystemLoadViewer.qml
Initialization at line 79 and launch at line 238.

Watching the program run I undestand that
    kRun.openUrl()
accepts a string representing a file to be opened with the default associated 
application or a .desktop file to launch.

I tested with various files:
- Copy-paste from the example to launch "sysguard" with the url obtained from
	the "apps" DataSource: WORKS
- Using the url "/usr/share/applications/org.kde.ksysguard.desktop" (it is the
	same string returned by the "apps" DataSource): WORKS
- If I try with another .desktop file inside my home folder: SEGFAULT
- If I copy the file "org.kde.ksysguard.desktop" in another directory and try
	with the new path: SEGFAULT
- If I try to execute a bash script: WORKS
- Using the url of a PDF file will open the file with Okular: WORKS
- Using the url of a binary application "/usr/bin/ksysguard" don't work and
	the openUrl() function returns an error value. No segfault so I think this
	is the expected behaviour.

I tested the widget directly in my plasma desktop and also using 
"plasmawindowed". The segfault happen in both cases but with the former I can 
see the console log.
Even if I am feeding the wrong data to the function I don't think the segfault 
is the expected behaviour. Maybe someone more expert can take a loot at this 
problem.
I'm using:
- updated kubuntu 15.04.
- Qt: 5.4.1
- KDE Frameworks: 5.9.0
- Plasma version 5.3.1.
I'm available to give more info if needed.

Here ends the "maybe important" stuff, the following is a newbie question.

I don't know if this is the correct place for this but I'm still searching a 
solution for the original problem.
If I can't launch an executable this way maybe this isn't the correct 
function. I am unable to find a documentation or source code for the QML 
implementation of "Kio.KRun". Inspecting the properties with javascript shows 
only three properties:

- objectName =
- objectNameChanged = function() { [code] }
- openUrl = function() { [code] }

So "openUrl()" appears to be the only function available, maybe KRun it's the 
wrong tool.

I found the interesting Plasma2 / Service but I don't know how to find the 
available DataSource ID's and the" operationDescription". I'm currently stuck 
and need some direction.

Thanks for the help. 

-- 
Nicola Felice


More information about the Plasma-devel mailing list