This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Configuring Dolphin's panel from externall app.

Tags: None
(comma "," separated)
chord
Registered Member
Posts
3
Karma
0
Hi all!
I've written a small app for managing drives (mounting, unmounting, retrieving drives data e.t.c) and I want to manage "Places" panel from my app: adding and deleting entries. I've searched google, but nothing helpful found. Only about manual panel managing. But I think ( and sure) it can be managed programmatically. May be via dbus commands, or via config files.
I tried to search for configs in order to edit them, but can't find any files that reflects panel changes. Though Dolphin saves some data on every exit:
Code: Select all
dolphin(1725)/kdecore (KConfigSkeleton) KCoreConfigSkeleton::writeConfig:


Can anyone point me out, where I have to start from?
Thanks.
User avatar
google01103
Manager
Posts
6668
Karma
25

Wed Oct 09, 2013 12:42 pm
a start would be to look at $KDEHOME/share/apps/kfileplaces/bookmarks.xml as this appears to be where the places panel is defined


OpenSuse Leap 42.1 x64, Plasma 5.x

chord
Registered Member
Posts
3
Karma
0
Thanks for reply!
I've played a bit with these two files (bookmarks.xml and bookmarks.xml.bak). Looks like its impossible to modify panel's content by editing these files. I modified panel's entry name (in both bookmarks.xml and bookmarks.xml.bak) and saved changed files. Dolphin was not started when I did this changes. After that I started Dolphin and saw the old entry name. Somehow bookmarks.xml and bookmarks.xml.bak was restored to previous state, though Dolphin does not running when I modified these files. Looks like some another program monitors these files and restores them. May be it is some daemon?
After that I closed Dolphin and modified bookmarks once more. This time I blocked these files by chattr +i in order to prevent their restoring. And started Dolphin again. Dolphin still showed the old entry name. Only at the second attempt (Dolphin was restarted once more) new entry name appeared.
Strange behaviour. Looks like Dolphin does not read these files and gets places entries from some other config, and these bookmarks are just reflection of previous panel state.
User avatar
google01103
Manager
Posts
6668
Karma
25
might actually be derived from ~/.local/share/user-places.xbel, found this in the following posts:
http://linuxexchange.org/questions/2726 ... for-places &
http://www.linuxquestions.org/questions ... 175453324/


OpenSuse Leap 42.1 x64, Plasma 5.x

chord
Registered Member
Posts
3
Karma
0
Yes, it is derived from user-places.xbel. I think I found who rewrites these configs: it is dbus.
I stopped dbus and closed dolphin, edited and saved user-places.xbel. After that I started dolphin - it accepted my changes. I tried to reopen dolphin few times - all looked fine. Until I started dbus again. Configs was restored to old state immediately after dbus start.
Seems it impossible to manage bookmarks via user-places.xbel or bookmarks.xml. Probably it could be done via dbus.
User avatar
bcooksley
Administrator
Posts
19765
Karma
87
OS
You could use lsof to determine what process is changing the file - or dbus-monitor to see what actions Dolphin takes.


KDE Sysadmin
[img]content/bcooksley_sig.png[/img]
freininghaus
Moderator
Posts
224
Karma
1
OS
You could also look at Dolphin's source code (kde-baseapps/dolphin/src/panels/places/) to check it modifies "Places" entries. I haven't written that code myself, and I'm rather unfamiliar with it, so I can't give you any better advice, sorry about that.


Bookmarks



Who is online

Registered users: Bing [Bot], gfielding, Google [Bot], markhm, sethaaaa, Sogou [Bot], Yahoo [Bot]