Editor: saving maps deletes shipped map file
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.
Related branches
- SirVer: Approve
- kaputtnik (community): Approve (testing)
-
Diff: 313 lines (+75/-11)10 files modifiedsrc/editor/ui_menus/main_menu_load_map.cc (+22/-2)
src/editor/ui_menus/main_menu_load_map.h (+2/-0)
src/editor/ui_menus/main_menu_load_or_save_map.cc (+14/-4)
src/editor/ui_menus/main_menu_load_or_save_map.h (+7/-1)
src/editor/ui_menus/main_menu_save_map.cc (+12/-3)
src/editor/ui_menus/main_menu_save_map.h (+4/-0)
src/editor/ui_menus/main_menu_save_map_make_directory.cc (+1/-0)
src/wui/mapdata.cc (+9/-0)
src/wui/mapdata.h (+3/-0)
src/wui/maptable.cc (+1/-1)
summary: |
- Editor: saving maps removes shipped map file + Editor: saving maps deletes shipped map file |
description: | updated |
Changed in widelands: | |
milestone: | none → build19-rc1 |
Changed in widelands: | |
status: | Confirmed → In Progress |
assignee: | nobody → GunChleoc (gunchleoc) |
Changed in widelands: | |
status: | In Progress → Fix Committed |
assignee: | GunChleoc (gunchleoc) → nobody |
Changed in widelands: | |
status: | Fix Committed → Fix Released |
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?