Editor: saving maps deletes shipped map file

Bug #1560454 reported by kaputtnik
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
widelands
Fix Released
High
Unassigned

Bug Description

This happens only if a user have appropriate rights on the folder where the maps are stored. So it is not valid for a normal widelands installation (at least on linux, on windows i couldn't check this)
Also only when saving with the same name.

Steps to reproduce:
Make sure not to have saved maps in ~/.widelands/maps , especially maps named like shipped maps
Start widelands from one of your bzr branches (where you have read/write permissions)
Start editor and load a shipped map (i used "Glacier_Lake")
Open Save window and give the map the exact same filename
Press "Save"

Result:
1. A Window pops up "The File already exists" -> This is strange, because normally the folder ~/.widelands/maps is used and not the maps folder of the branch where you started widelands
2. If you save nevertheless, the map from your branch/data/maps folder gets deleted and the new map is stored in ~/.widelands/maps

If you use the --datadir option the file from that map folder get deleted.

I have tested this with a normal installation on linux and here all is fine. I believe because a normal user haven't the rights to delete a file outsite his home folder.

I mark it as "High", feel free to set it to medium because it affects only folders where read/write permission is given.

Tags: editor

Related branches

Revision history for this message
GunChleoc (gunchleoc) wrote :

Whether this is a bug depends on user intent: Say I want to replace the map, then this is exactly what it looks like from the Widelands user interface - the official map has been replaced with my edited map.

How about we change the warning message if the user is about to replace an official map?

tags: added: editor
Revision history for this message
kaputtnik (franku) wrote :

> Say I want to replace the map, then this is exactly what it looks like from the Widelands user interface - the official map has been replaced with my edited map.

It is optical replaced in the user interface, yes. For a normal installation the behavior is ok, because the shipped map doesn't get deleted.

The problem is that if you use an other datadir the original map file get physically deleted. It is optical replaced, but if you delete the map in ~/.widelands/maps there is no possibility to get the original (shipped) map back.

kaputtnik (franku)
summary: - Editor: saving maps removes shipped map file
+ Editor: saving maps deletes shipped map file
description: updated
GunChleoc (gunchleoc)
Changed in widelands:
milestone: none → build19-rc1
Revision history for this message
kaputtnik (franku) wrote :

One thing i find annoying too is that the shipped maps are shown like as they are in the "main folder". "Main folder'" means here ~/.widelands/maps. If you save an additional map in this folder, you have a mix of shipped maps and self created maps in the UI. Searching for the self created map is then hard to do. Personally i solved this by creating subfolder(s) over the ui and save self created maps in this subfolder(s).

A better solution would maybe to have a "virtual" sub folder called "Shipped Maps" in the UI where the shipped maps could be found. Saving maps in this "virtual" folder should then be prevented (show a message or remove the "virtual" folder entry from the save menu).

What do you think?

Revision history for this message
GunChleoc (gunchleoc) wrote :

I agree that a separate folder is a good idea - ".maps"/"My Maps" should appear as a subfolder in the UI rather than being an alias for the main folder.

Another thing that I find annoying is that the editor doesn't remember the folder that you last loaded a map from.

Changed in widelands:
status: New → Confirmed
Revision history for this message
kaputtnik (franku) wrote :

> ".maps"/"My Maps" should appear as a subfolder in the UI rather than being an alias for the main folder.

When saving a map the subfolder "/maps/My maps" should be used as standard then.

> Another thing that I find annoying is that the editor doesn't remember the folder that you last loaded a map from.

Yes :-) This has disturbed me a lot, but i never wanted to make a bug report for this... because other things are much important.

GunChleoc (gunchleoc)
Changed in widelands:
status: Confirmed → In Progress
assignee: nobody → GunChleoc (gunchleoc)
GunChleoc (gunchleoc)
Changed in widelands:
status: In Progress → Fix Committed
assignee: GunChleoc (gunchleoc) → nobody
GunChleoc (gunchleoc)
Changed in widelands:
status: Fix Committed → Fix Released
Revision history for this message
GunChleoc (gunchleoc) wrote :

Fixed in build19-rc1.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.