[Kde-pim] Handling virtual collections in applications

Stephen Kelly steveire at gmail.com
Tue Mar 3 15:25:15 GMT 2009


Hi,

Sorry, this is another in the series of 'Steve's long emails' :)

Something that came to mind while implementing the models stuff is how the 
model should handle virtual collections. I think it should not be possible 
to move, or insert an entity from a virtual collection using regular user 
actions (like drag and drop). However, I don't think there's currently any 
way to know if a particular collection is a virtual collection. Do we need a 
Collection::isVirtual()? Does a collection know that it's virtual?

It would be necessary to know that in the EntityTreeModel::dropMimeData 
method to for example stop the meaningless action of dropping a contact into 
the Search collection or any other virtual collection. Dragging from a 
virtual collection would have meaning, but it might also be confusing.

Consider some tree like

(root)
-> Col 0
-> -> Item 0-0
-> Col 1
-> -> Item 0-1
-> Search [virtual]
-> -> Item 0-0

And imagine that the user drags Item 0-0 from Search into Col 1. That could 
behave exactly like dragging the item from Col 0 into Col 1, but the user 
might be confused that they dragged the item from the Search collection, but 
the item actually disappeared from Col 1, and it's still in the Search 
collection (because it still contains their search term). An option would be 
to disable internal moves as well from virtual collections, and only allow 
copy actions.

Any thoughts on that?

What else are virtual collections used for, apart from search? Are there any 
other use cases for them?

Virtual collections can't contain collections as far as I can see (there is 
an itemLinkJob, but not a CollectionLinkJob). Is there a usecase for 
(dis)allowing that?

Is there actually anything special about virtual collections, or is it 
simply any collection which has an item linked in it? In the same way that I 
can symlink files and directories in my filesystem. Can I link an item to any 
collection?

What happens if I list a collection which contains (sym)links to items? Will 
the list job return a list including linked items? Will I have any way of 
knowing whether the returned item is really in the listed collection, or if 
it is just a link to an item in another collection?

All the best,

teve


_______________________________________________
KDE PIM mailing list kde-pim at kde.org
https://mail.kde.org/mailman/listinfo/kde-pim
KDE PIM home page at http://pim.kde.org/



More information about the kde-pim mailing list