mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-05-16 18:12:10 +00:00
Fix of G-code Viewer not loading .gco files #5536
".gcode", ".gco", ".g" and ".ngc" were considered to be G-code file extensions by the G-code import / export file dialogs, but not by various other functions. Now the G-code extension is tested by a single function is_gcode_file(string).
This commit is contained in:
@@ -150,15 +150,11 @@ int CLI::run(int argc, char **argv)
|
||||
}
|
||||
|
||||
// Read input file(s) if any.
|
||||
for (const std::string& file : m_input_files) {
|
||||
std::string ext = boost::filesystem::path(file).extension().string();
|
||||
if (ext == ".gcode" || ext == ".g") {
|
||||
if (boost::filesystem::exists(file)) {
|
||||
start_as_gcodeviewer = true;
|
||||
break;
|
||||
}
|
||||
for (const std::string& file : m_input_files)
|
||||
if (is_gcode_file(file) && boost::filesystem::exists(file)) {
|
||||
start_as_gcodeviewer = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!start_as_gcodeviewer) {
|
||||
for (const std::string& file : m_input_files) {
|
||||
if (!boost::filesystem::exists(file)) {
|
||||
|
||||
Reference in New Issue
Block a user