From 13f1bb2e4317b1a9329f9f3b82517ff845d0b4fa Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Sat, 21 Dec 2019 12:31:32 +0100 Subject: [PATCH 1/2] 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 e78022053..2b867c8af 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 ea4584fee..1767490d1 100644 --- a/src/slic3r/GUI/RemovableDriveManager.hpp +++ b/src/slic3r/GUI/RemovableDriveManager.hpp @@ -3,6 +3,7 @@ #include #include +#include namespace Slic3r { namespace GUI { From 37c64b1a62c4f734f083e16995e2adead77df895 Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Sat, 21 Dec 2019 14:43:22 +0100 Subject: [PATCH 2/2] Hopefully a fix for #3342 - dark mode icons lookup --- src/slic3r/GUI/wxExtensions.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index ad74e0ea0..7b36207f5 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -437,6 +438,8 @@ static std::string icon_name_respected_to_mode(const std::string& bmp_name_in) if (Slic3r::GUI::wxGetApp().dark_mode()) { bmp_name = folder + bmp_name_in; boost::replace_last(bmp_name, ".png", ""); + if (! boost::filesystem::exists(Slic3r::var(bmp_name + ".svg"))) + bmp_name.clear(); } if (bmp_name.empty()) { bmp_name = bmp_name_in;