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:
Vojtech Bubnik 2021-01-05 12:26:05 +01:00
parent b93c2aea44
commit fb29325b14
7 changed files with 17 additions and 19 deletions

View file

@ -667,7 +667,7 @@ DynamicPrintConfig PresetBundle::full_sla_config() const
// If the file is loaded successfully, its print / filament / printer profiles will be activated.
void PresetBundle::load_config_file(const std::string &path)
{
if (boost::iends_with(path, ".gcode") || boost::iends_with(path, ".g")) {
if (is_gcode_file(path)) {
DynamicPrintConfig config;
config.apply(FullPrintConfig::defaults());
config.load_from_gcode_file(path);