[Marble-devel] Review Request: Added addFeature and removeFeature support to GeoDataTreeModel

Javier Becerra Elcinto javier at auva.es
Wed Sep 14 10:54:59 UTC 2011


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
http://git.reviewboard.kde.org/r/102610/
-----------------------------------------------------------

Review request for Marble.


Summary
-------

GeoDataTreeModel allows for insertion of a GeoDataDocument using the function addDocument(GeoDataDocument*). However it is not possible to modify an existing document (i.e. by adding or removing a feature) while keeping the model/view synchonised other than calling the GeoDataTreeModel::update() function, which updates the whole treemodel and demands a lot of ressources. 
Adding new addFeature and removeFeature allows the modification of the tree while keeping the view automatically updated.
GeoDataTreeModel::addDocument and GeoDataTreeModel::removeDocument are modified to call addFeature and removeFeature, minimising the code modifying the treemodel.

This patch has been proved to work in single-threaded mode, however marblewidget crashes on KDescendantsProxyModel::mapFromSource(const QModelIndex &sourceIndex) when a new feature/document is added from a thread different from main. This behaviour is independent of this patch, as it can be reproduced in unpatched marblewidget calling GeoDataTreeModel::addDocument from another thread. The test code below can be used to test this bug uncommenting the last two lines of code of main.cpp.


Diffs
-----

  src/lib/GeoDataTreeModel.h eda4c53 
  src/lib/GeoDataTreeModel.cpp 2c17cfa 

Diff: http://git.reviewboard.kde.org/r/102610/diff


Testing
-------


Thanks,

Javier

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/marble-devel/attachments/20110914/e68cb6eb/attachment.html>


More information about the Marble-devel mailing list