← Back to team overview

widelands-dev team mailing list archive

[Merge] lp:~widelands-dev/widelands/fix_windows_delete_dir into lp:widelands

 

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

Requested reviews:
  Widelands Developers (widelands-dev)

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/fix_windows_delete_dir/+merge/282114

Testing the use_texture_cache branch revealed that deleting directories on windows does not always succeeds:
If the cache dir was deleted due to recalculating it was removed but not recreated.

Checking the return value seems to solve the problem.

Includes a small codecheck and python 3 fix.
-- 
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/fix_windows_delete_dir into lp:widelands.
=== modified file 'src/io/filesystem/disk_filesystem.cc'
--- src/io/filesystem/disk_filesystem.cc	2015-01-22 18:14:06 +0000
+++ src/io/filesystem/disk_filesystem.cc	2016-01-10 12:27:11 +0000
@@ -278,7 +278,10 @@
 #ifndef _WIN32
 	rmdir(fspath.c_str());
 #else
-	RemoveDirectory(fspath.c_str());
+	if (!RemoveDirectory(fspath.c_str())) {
+		throw wexception
+				("%s could not be deleted.",
+				fspath.c_str());
 #endif
 }
 

=== modified file 'src/logic/map_objects/map_object.h'
--- src/logic/map_objects/map_object.h	2016-01-09 17:18:20 +0000
+++ src/logic/map_objects/map_object.h	2016-01-10 12:27:11 +0000
@@ -250,8 +250,8 @@
 	/**
 	 * Is called right before the object will be removed from
 	 * the game. No conncetion is handled in this class.
-	 * 
-         * param serial : the object serial (cannot use param comment as this is a callback)
+	 *
+	 * param serial : the object serial (cannot use param comment as this is a callback)
 	 */
 	boost::signals2::signal<void(uint32_t serial)> removed;
 

=== modified file 'utils/build_deps.py'
--- utils/build_deps.py	2014-11-03 06:55:18 +0000
+++ utils/build_deps.py	2016-01-10 12:27:11 +0000
@@ -52,7 +52,7 @@
         message = '%s%s%s%s' % (
             ANSI_COLORS["yellow"], ANSI_COLORS["bold"],
             message, ANSI_COLORS["reset"])
-    print "%s:%s: %s" % (filename, line_index, message)
+    print("%s:%s: %s" % (filename, line_index, message))
 
 __INCLUDE = re.compile(r'#include "([^"]+)"')
 def extract_includes(srcdir, source):
@@ -201,7 +201,7 @@
     for lib in targets.values():
         for src in lib.srcs:
             if src in owners_of_src:
-                print "%s:1 is owned by more than one target." % src
+                print("%s:1 is owned by more than one target." % src)
             owners_of_src[src] = lib
 
 


Follow ups