From bbbe7e7560cf4c34c089a6306fb273b2ff9e3973 Mon Sep 17 00:00:00 2001 From: Joseph Lenox Date: Sun, 6 May 2018 19:39:34 -0500 Subject: [PATCH] Use std::string internally instead of wxString. --- src/GUI/Plater.cpp | 10 +++++----- src/GUI/Plater.hpp | 2 +- src/GUI/Plater/PlaterObject.hpp | 4 ++-- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/GUI/Plater.cpp b/src/GUI/Plater.cpp index 994adbe44..02cfae165 100644 --- a/src/GUI/Plater.cpp +++ b/src/GUI/Plater.cpp @@ -119,7 +119,7 @@ void Plater::add() { const auto& input_files{open_model(this, *(this->settings), wxTheApp->GetTopWindow())}; for (const auto& f : input_files) { Log::info(LogChannel, (wxString(L"Calling Load File for ") + f).ToStdWstring()); - this->load_file(f); + this->load_file(f.ToStdString()); } // abort if no objects actually added. @@ -144,7 +144,7 @@ void Plater::add() { } -std::vector Plater::load_file(const wxString& file, const int obj_idx_to_load) { +std::vector Plater::load_file(const std::string file, const int obj_idx_to_load) { auto input_file {wxFileName(file)}; settings->skein_directory = input_file.GetPath(); @@ -158,7 +158,7 @@ std::vector Plater::load_file(const wxString& file, const int obj_idx_to_lo progress_dialog->Pulse(); //TODO: Add a std::wstring so we can handle non-roman characters as file names. try { - model = Slic3r::Model::read_from_file(file.ToStdString()); + model = Slic3r::Model::read_from_file(file); } catch (std::runtime_error& e) { show_error(this, e.what()); Slic3r::Log::error(LogChannel, LOG_WSTRING(file << " failed to load: " << e.what())); @@ -177,10 +177,10 @@ std::vector Plater::load_file(const wxString& file, const int obj_idx_to_lo for (auto i = 0U; i < model.objects.size(); i++) { auto object {model.objects[i]}; - object->input_file = file.ToStdString(); + object->input_file = file; for (auto j = 0U; j < object->volumes.size(); j++) { auto volume {object->volumes.at(j)}; - volume->input_file = file.ToStdString(); + volume->input_file = file; volume->input_file_obj_idx = i; volume->input_file_vol_idx = j; } diff --git a/src/GUI/Plater.hpp b/src/GUI/Plater.hpp index 7f84f0ca1..d4eb41abf 100644 --- a/src/GUI/Plater.hpp +++ b/src/GUI/Plater.hpp @@ -61,7 +61,7 @@ private: Plate2D* canvas2D {}; //< 2D plater canvas /// Handles the actual load of the file from the dialog handoff. - std::vector load_file(const wxString& file, const int obj_idx_to_load = -1); + std::vector load_file(const std::string file, const int obj_idx_to_load = -1); const std::string LogChannel {"GUI_Plater"}; //< Which log these messages should go to. diff --git a/src/GUI/Plater/PlaterObject.hpp b/src/GUI/Plater/PlaterObject.hpp index 7fb6602cb..a99b20ca6 100644 --- a/src/GUI/Plater/PlaterObject.hpp +++ b/src/GUI/Plater/PlaterObject.hpp @@ -12,9 +12,9 @@ namespace Slic3r { namespace GUI { class PlaterObject { public: - wxString name {L""}; + std::string name {""}; size_t identifier {0U}; - wxString input_file {L""}; + std::string input_file {""}; int input_file_obj_idx {-1};