D. Implementation notes

Menu editing

To implement menu editing, the intent is that a per-user file is created. The per-user file should specify a <MergeFile> with the system wide file, so that system changes are inherited. When the user deletes a menu item, you add <Exclude><Filename>foo.desktop</Filename></Exclude>. If the user adds a menu item, you use <Include><Filename>foo.desktop</Filename></Include>.

If the user moves a folder, you might try to use <Move> elements to represent that, but it's tricky. (Move A/B/C to D/E/F, then move D/E to D/G, note that D/E/F still contains A/B/C while only the original D/E was moved to D/G.) In order to move a folder, you have to "fix up" all moves that move things into the folder being moved to instead move things into the folder's new location.

To delete a folder, simply append the <Deleted> element.

Menu editors probably need to do some kind of consolidation/compression to avoid an XML tree that grows infinitely over time.