← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/bug-1588063 into lp:widelands

 

Tino has proposed merging lp:~widelands-dev/widelands/bug-1588063 into lp:widelands.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1588063 in widelands: "Map folder gets not created"
  https://bugs.launchpad.net/widelands/+bug/1588063

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1588063/+merge/301636

Use system dependant file seperator for the My_Maps subdirectory.
Now ensure_directory_exists() does work also on win32.

I don't like the #ifdef __win32 solution, but i was not able to FileSystem::file_separator() because i lack c++ knowledge to concatenate char/char*/char[].

Suggestions welcome.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/bug-1588063 into lp:widelands.
=== modified file 'src/editor/ui_menus/main_menu_save_map.cc'
--- src/editor/ui_menus/main_menu_save_map.cc	2016-05-17 07:53:03 +0000
+++ src/editor/ui_menus/main_menu_save_map.cc	2016-08-01 11:14:29 +0000
@@ -49,8 +49,11 @@
 
 // TODO(GunChleoc): Arabic: Make directory dialog: buttons need more height for Arabic.
 MainMenuSaveMap::MainMenuSaveMap(EditorInteractive& parent)
+   #ifdef _WIN32
+   : MainMenuLoadOrSaveMap(parent, 3, "save_map_menu", _("Save Map"), "maps\\My_Maps"),
+   #elif
    : MainMenuLoadOrSaveMap(parent, 3, "save_map_menu", _("Save Map"), "maps/My_Maps"),
-
+   #endif
      make_directory_(this,
                      "make_directory",
                      right_column_x_,

=== modified file 'src/wui/mapdata.cc'
--- src/wui/mapdata.cc	2016-07-24 11:50:34 +0000
+++ src/wui/mapdata.cc	2016-08-01 11:14:29 +0000
@@ -162,7 +162,11 @@
 	if (boost::equals(directory, "maps/MP_Scenarios")) {
 		/** TRANSLATORS: Directory name for MP Scenarios in map selection */
 		localized_name = _("Multiplayer Scenarios");
+	#ifdef _WIN32
+	} else if (boost::equals(directory, "maps\\My_Maps")) {
+	#else
 	} else if (boost::equals(directory, "maps/My_Maps")) {
+	#endif
 		/** TRANSLATORS: Directory name for user maps in map selection */
 		localized_name = _("My Maps");
 	} else {


Follow ups