[PATCH] KFilePlacesModel : separate storage for custom items and standard items

nf2 nf2 at scheinwelt.at
Thu Mar 27 10:11:07 GMT 2008

Kevin Ottens wrote:
> Le Sunday 16 March 2008, nf2 a écrit :
>> The new approach keeps the ~/.kde4/share/apps/kfileplaces/bookmarks.xml
>> as it was and synchronizes the custom items with
>> .local/share/shortcuts.xbel. The Synchronization is done by the new
>> class KFilePlacesSharedBookmarks.
> It looks fine here. I'd only have one complaint about this one, it blindly 
> copies the whole bookmark to .local/share/shortcuts.xbel, while it should 
> probably avoid copying all the KFilePlacesModel specific metadata (like ID, 
> isSystemItem, etc.). Could you try to tidy that up before committing?

That's intentional. They have to be a 1:1copy (otherwise my comparator 
won't work and we might run into an endless synchronization ping pong). 
According to the xbel spec it's perfectly ok to have such private 
metadata (that's the whole point of the owner= attribute):

"Within an info element,
          each metadata element is required
          to have a unique value for the owner attribute. Programs which 
          the contents of metadata elements
          should ensure that only one metadata exists for any owner 
value normally modified by the
          application within affected info
          elements. metadata elements for
          other owners should remain unaffected."

But of course only the custom items (not isSystemItem=true) should be 
synchronized (no home, /, remote:, trash: should appear in the 

> Testing your patch I noticed that now the default places have wrong icons... 
> Actually after reverting I still see this behavior, so I wonder if it could 
> be related to your previous changes to KBookmark.
Could be. I got some migration code for the icons, but who knows. Here 
it works, but of course i have deleted the bookmark files, so 
KFilePlacesModel re-created the default places.

>> The minor changes to KFilePlacesModel:
>> * System items are tagged with a <isSystemItem>true</isSystemItem>.
>> * I improved the ID-generator for more unique id's.
> They look fine.

Thanks for testing,


More information about the kde-core-devel mailing list