Fix the Bookmark Import Feature in Marble
Welcome to Marble, a virtual globe and world atlas that runs on Linux, Windows, MacOS and Android. Find your way and explore the world! :-)
To complete this task you need a Marble development environment. Do one of the tasks Setup a Marble development environment on Linux | Windows to get started.
The Desktop version of Marble supports bookmarks, which can be exported to a KML file in the Bookmarks Manager (see the Bookmarks
menu). Such a KML file can be imported as well. Unfortunately there is a bug in this feature that leads to a crash. The goal of this task is to find the cause and fix it.
Hint: The problem is likely in BookmarkManagerDialog::importBookmarks()
. In there the KML file is opened as a GeoDataDocument*
and then bookmarks are copied over one by one. The method seems to mix up the ownership though: It calls d->m_manager->addBookmark( newFolder, *newPlacemark );
twice where newFolder is from the imported file. This is wrong, the first argument (newFolder) must be part of the existing bookmark document current
.
It should be helpful to study the structure of GeoDataDocument (and GeoDataContainer, GeoDataFolder) a bit wrt to ownership of placemarks. In short, a GeoDataPlacemark*
is owned by the container (GeoDataFolder or GeoDataDocument) which it is assigned to, its parent.
When you are done, please upload your code changes in a review request to phabricator.
Got a question or a problem you cannot solve on your own? Please contact your mentors.