From 13f1bb2e4317b1a9329f9f3b82517ff845d0b4fa Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Sat, 21 Dec 2019 12:31:32 +0100 Subject: [PATCH] An attempt to fix missing renaming from .gcode.tmp to .gcode Added a missing include --- src/libslic3r/utils.cpp | 10 +++++----- src/slic3r/GUI/RemovableDriveManager.hpp | 1 + 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/libslic3r/utils.cpp b/src/libslic3r/utils.cpp index e780220534..2b867c8af3 100644 --- a/src/libslic3r/utils.cpp +++ b/src/libslic3r/utils.cpp @@ -443,13 +443,13 @@ int copy_file(const std::string &from, const std::string &to, const bool with_ch { std::string to_temp = to + ".tmp"; int ret_val = copy_file_inner(from,to_temp); - if(ret_val == 0 && with_check) + if(ret_val == 0) { - ret_val = check_copy(from, to_temp); - if (ret_val == 0) - { + if (with_check) + ret_val = check_copy(from, to_temp); + + if (ret_val == 0) rename_file(to_temp, to); - } } return ret_val; } diff --git a/src/slic3r/GUI/RemovableDriveManager.hpp b/src/slic3r/GUI/RemovableDriveManager.hpp index ea4584feee..1767490d10 100644 --- a/src/slic3r/GUI/RemovableDriveManager.hpp +++ b/src/slic3r/GUI/RemovableDriveManager.hpp @@ -3,6 +3,7 @@ #include #include +#include namespace Slic3r { namespace GUI {