![]() Registered Member ![]()
|
Hi,
I'm new to KDE development. I wrote a plasmoid (http://kde-look.org/content/show.php/Google+Calendar+Agenda?content=134032) that needs to store its data somewhere, namely - ical feeds need to be stored for offline usage. While I could just write it to ~/.ical/, I'd like to know what is the proper way of doing it - is there an API i can query about the path to store my private data? |
![]() Administrator ![]()
|
I think you can use KStandardDirs to create a directory inside the user's KDEHOME, in a specific path for your application (I suggest using "data" for that).
"Violence is the last refuge of the incompetent."
![]() Plasma FAQ maintainer - Plasma programming with Python |
![]() Manager ![]()
|
fyi the paste plasmiod stores it's data in ~/.kde4/share/apps/plasma_applet_paste/snippets.xml
|
![]() Administrator ![]()
|
That's exactly the use of KStandardDirs I mentioned. The good thing about using the API, rather than hardcoded directories, is that the code would work regardless if the user had the settings in .kde, .kde4, or other location.
"Violence is the last refuge of the incompetent."
![]() Plasma FAQ maintainer - Plasma programming with Python |
![]() Registered Member ![]()
|
Thank you very much einar, this solves my issue.
|
![]() Registered Member ![]()
|
Regarding what google01103 suggested - that's what exactly I wanted to avoid, from my experience hardcoding anything sooner or later becomes major pain.
|
![]() Manager ![]()
|
I never suggested anything, I only gave an example of a plasmoid that stored data in a manner similar to what you were looking to do and posted that file's path as it resides on my machine |
Registered users: Bing [Bot], Evergrowing, Google [Bot], rockscient