Registered Member
|
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
accepts a string representing a file to be opened with the default associated application or a .desktop file to launch. The segmentation fault I tested with various files.
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 an updated kubuntu 15.04.
Plasma version 5.3.1. I'm available to give more info if needed, just ask. Still searching a solution 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
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. --- Edit 2015-07-26: Fix the report about the bash script
Last edited by nicolaf on Sun Jul 26, 2015 3:24 pm, edited 1 time in total.
|
Administrator
|
You may want to send your enquiries also to the plasma-devel mailing list.
"Violence is the last refuge of the incompetent."
Plasma FAQ maintainer - Plasma programming with Python |
Registered Member
|
Thanks, I sent a message to the plasma-devel mailing list. The message had probably too few informations and for now nobody replied. Meanwhile I finally succeeded in obtaining an useful backtrace:
In frame #3 I discovered the "krun" used in QML is implemented in KRunProxy. The only method available is effectively openUrl():
I'm still trying to understand how everything works. For now I think the most likely cause is the variable "service". If serviceByDesktopPath() can't get a service it will return "0". I'm still trying to understand what is "KService::Ptr" but I don't see a check on the validity of the pointer here or in the next frames. Then in frame #1 in the method runService() of the class KRun, "_service" is used this way:
But I'm still reading documentation and downloading repositories, I want to understand better this stuff. Back to "how to make a launcher". In the source of KRunProxy::openUrl() they explicitly wrote:
so this is not the correct tool to use if I want to build a launcher. I'm still trying to use "Service" and "DataSource". For listing the available data sources I found the program "plasmaengineexplorer". I even remember using it in KDE4 when I was playing with another plasma widget. I remember it worked in KDE4 but now in KDE5 not any more. Now it only displays two DataEngines, "kget" and "org.kde.kdevelopsessions". Even the existing engines "time" and "mpris2" are not listed. Well, I think I wrote enough, it's time to go back to reading documentation 8) --- Update 2015-07-26: I finally understood why plasmaengineexplorer was broken. Thanks to [RISOLTO] Info su plasma engine explorer I discovered I was using the version provided with the not any more supported "plasmate". Replacing "plasmate" with "plasma-sdk" fixed the problem, now all the services are listed. The program is not very stable but at least it's a step ahead. Still searching for a solution... |
Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]