GSoC/GCI Archive
Google Code-in 2010 KDE

Provide a way to delete map themes that get fully stored in the user's home directory.

completed by: marthd

mentors: tackat

The Map Creation Wizard

http://reviewboard.kde.org/r/6070/

has provided us with user-created map themes. Now a user might create a theme and something might have gone wrong or the user might decide to delete the theme for other reasons.

So far there is no way to delete themes via Marble's user interface.

We need some way to allow for deletion of the theme:

The context menu inside "Map View" / "Theme" listview should feature an entry "Delete Map Theme". This context menu entry should only show up

- If the theme is fully provided in the local home directory (this could be tested by checking for the existance of the dgml in the home directory's marble map dir using MarbleDir::localPath()).

Once the user presses the context menu entry "Delete Map Theme" a dialog pops up "Are you sure that you want to delete %1 " (Yes, No). And the user can confirm by pressing "Yes".

In this case the content of the directory (i.e. the dgml file, the legend.png, the legend.html the installmap and the tiles that got possibly created) get erased. If the directory is empty then the directory gets removed. I think that just erasing the whole directory with everything stored in it would possibly be dangerous if for whatever reason the directory path is wrong. In that malcase the user's home directory might get deleted. So deleting the files one by one and deleting the directory after checking the directory for emptiness would be safer.