diff options
author | Enrico Turri <enricoturri@seznam.cz> | 2019-07-18 16:03:05 +0300 |
---|---|---|
committer | Enrico Turri <enricoturri@seznam.cz> | 2019-07-18 16:03:05 +0300 |
commit | 1c5ff3c72d62d346940f8a1864f6b1a43a2021f1 (patch) | |
tree | 270456f460b45e1277f1eac816156be6054bc0cb /src/slic3r/GUI/BedShapeDialog.cpp | |
parent | f61d43de07ae973e701a5c516be344b251d44bfb (diff) |
Small refactoring
Diffstat (limited to 'src/slic3r/GUI/BedShapeDialog.cpp')
-rw-r--r-- | src/slic3r/GUI/BedShapeDialog.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/src/slic3r/GUI/BedShapeDialog.cpp b/src/slic3r/GUI/BedShapeDialog.cpp index 4ae91c782..60b4f37f1 100644 --- a/src/slic3r/GUI/BedShapeDialog.cpp +++ b/src/slic3r/GUI/BedShapeDialog.cpp @@ -449,7 +449,7 @@ void BedShapePanel::load_stl() return; std::string file_name = dialog.GetPath().ToUTF8().data(); - if (!boost::iequals(boost::filesystem::path(file_name).extension().string().c_str(), ".stl")) + if (!boost::algorithm::iends_with(file_name, ".stl")) { show_error(this, _(L("Invalid file format."))); return; @@ -498,9 +498,7 @@ void BedShapePanel::load_texture() m_custom_texture = NONE; std::string file_name = dialog.GetPath().ToUTF8().data(); - std::string file_ext = boost::filesystem::path(file_name).extension().string(); - - if (!boost::iequals(file_ext.c_str(), ".png") && !boost::iequals(file_ext.c_str(), ".svg")) + if (!boost::algorithm::iends_with(file_name, ".png") && !boost::algorithm::iends_with(file_name, ".svg")) { show_error(this, _(L("Invalid file format."))); return; @@ -523,7 +521,7 @@ void BedShapePanel::load_model() m_custom_model = NONE; std::string file_name = dialog.GetPath().ToUTF8().data(); - if (!boost::iequals(boost::filesystem::path(file_name).extension().string().c_str(), ".stl")) + if (!boost::algorithm::iends_with(file_name, ".stl")) { show_error(this, _(L("Invalid file format."))); return; |