Registered Member
|
Hi,
I want to read a local file. I go crazy on how to use LocalIO::userDataPath(...) and LocalIO::getUrl(...). My metadata.desktop already contains the extension tag (as described in http://techbase.kde.org/Development/Tutorials/Plasma/JavaScript/API-Extensions):
In my js file I tried following:
Resulting this error: Reference Error: Can't find variable userDataPath
Resulting this error: Type Error: Result of expression 'plasmoid.userDataPath' [undefined] is not a function. At KDE-Examples I didn't find a code snippet. Also didn't find any usefull links with google 'plasmoid localio'. Could somebody explain me the usage of userDataPath and getUrl, please? Thx! André |
Administrator
|
I would recommend asking about this on the Plasma development mailing list, plasma-devel@kde.org.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
Registered Member
|
Thx for reply. I solved it by myself.
The method userDataPath is only available at script version > 4 which I don't have. The getUrl method works! Here is my example code:
This is a small example which show the usage of LocalIO and the connections with the signal of IOJob. At getUrl you can link to any file in your local filesystem or to a file at the web. This script writes out the contents of the file at /some/directory/file.name. Greets André |
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot], ourcraft