Skip to content

Commit

Permalink
Fix indentation and spacing; use print.arrange rather than making ano…
Browse files Browse the repository at this point in the history
…ther call to the config.
  • Loading branch information
lordofhyphens committed Apr 13, 2019
1 parent 7d7223e commit 0230138
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/slic3r.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,9 @@ int CLI::run(int argc, char **argv) {
c.normalize();
this->print_config.apply(c);
} catch (std::exception &e){
Slic3r::Log::error("CLI") << "Error with the config file '" << file << "': " << e.what() <<std::endl;
exit(EXIT_FAILURE);
}
Slic3r::Log::error("CLI") << "Error with the config file '" << file << "': " << e.what() <<std::endl;
exit(EXIT_FAILURE);
}
}

// apply command line options to a more specific DynamicPrintConfig which provides normalize()
Expand All @@ -87,23 +87,23 @@ int CLI::run(int argc, char **argv) {
try {
this->full_print_config.validate();
} catch (std::exception &e) {
Slic3r::Log::error("CLI") << "Config validation error: "<< e.what() << std::endl;
exit(EXIT_FAILURE);
Slic3r::Log::error("CLI") << "Config validation error: "<< e.what() << std::endl;
exit(EXIT_FAILURE);
}
Slic3r::Log::debug("CLI") << "Config validated" << std::endl;

// read input file(s) if any
for (auto const &file : input_files) {
Model model;
try {
model = Model::read_from_file(file);
} catch (std::exception &e) {
Slic3r::Log::error("CLI") << file << ": " << e.what() << std::endl;
exit(EXIT_FAILURE);
Slic3r::Log::error("CLI") << file << ": " << e.what() << std::endl;
exit(EXIT_FAILURE);
}
if (model.objects.empty()) {
Slic3r::Log::error("CLI") << "Error: file is empty: " << file << std::endl;
continue;
Slic3r::Log::error("CLI") << "Error: file is empty: " << file << std::endl;
continue;
}
this->models.push_back(model);
}
Expand Down Expand Up @@ -314,10 +314,10 @@ int CLI::run(int argc, char **argv) {
boost::nowide::cout << msg << std::endl;
};
print.apply_config(this->print_config);
print.arrange = !this->config.getBool("dont_arrange",false);
print.arrange = !this->config.getBool("dont_arrange", false);
print.center = !this->config.has("center")
&& !this->config.has("align_xy")
&& !this->config.getBool("dont_arrange",false);
&& print.arrange;
Slic3r::Log::error("CLI") << "Arrange: " << print.arrange<< ", center: " << print.center << std::endl;
print.set_model(model);

Expand Down

0 comments on commit 0230138

Please sign in to comment.