Some code review

This commit is contained in:
YuSanka 2018-10-31 12:56:08 +01:00
parent d2844bc39d
commit 7f08f460f1
25 changed files with 548 additions and 522 deletions

View file

@ -315,7 +315,7 @@ void PresetBundle::load_selections(const AppConfig &config)
sla_materials.select_preset_by_name_strict(initial_sla_material_profile_name);
printers.select_preset_by_name(initial_printer_profile_name, true);
if (printers.get_selected_preset().printer_technology() == ptFFF){
if (printers.get_selected_preset().printer_technology() == ptFFF) {
// Load the names of the other filament profiles selected for a multi-material printer.
auto *nozzle_diameter = dynamic_cast<const ConfigOptionFloats*>(printers.get_selected_preset().config.option("nozzle_diameter"));
size_t num_extruders = nozzle_diameter->values.size();
@ -1179,7 +1179,7 @@ void PresetBundle::update_compatible_with_printer(bool select_other_if_incompati
prefered_print_profile.empty() ?
this->prints.update_compatible_with_printer(printer_preset, select_other_if_incompatible) :
this->prints.update_compatible_with_printer(printer_preset, select_other_if_incompatible,
[&prefered_print_profile](const std::string& profile_name){ return profile_name == prefered_print_profile; });
[&prefered_print_profile](const std::string& profile_name) { return profile_name == prefered_print_profile; });
prefered_filament_profiles.empty() ?
this->filaments.update_compatible_with_printer(printer_preset, select_other_if_incompatible) :
this->filaments.update_compatible_with_printer(printer_preset, select_other_if_incompatible,
@ -1199,7 +1199,7 @@ void PresetBundle::update_compatible_with_printer(bool select_other_if_incompati
const std::string &preferred = (idx < prefered_filament_profiles.size()) ?
prefered_filament_profiles[idx] : prefered_filament_profiles.front();
filament_name = this->filaments.first_compatible(
[&preferred](const std::string& profile_name){ return profile_name == preferred; }).name;
[&preferred](const std::string& profile_name) { return profile_name == preferred; }).name;
}
}
}
@ -1212,7 +1212,7 @@ void PresetBundle::update_compatible_with_printer(bool select_other_if_incompati
prefered_print_profile.empty() ?
this->sla_materials.update_compatible_with_printer(printer_preset, select_other_if_incompatible) :
this->sla_materials.update_compatible_with_printer(printer_preset, select_other_if_incompatible,
[&prefered_print_profile](const std::string& profile_name){ return profile_name == prefered_print_profile; });
[&prefered_print_profile](const std::string& profile_name) { return profile_name == prefered_print_profile; });
}
}
}
@ -1361,7 +1361,7 @@ void PresetBundle::update_platter_filament_ui(unsigned int idx_extruder, GUI::Pr
bitmap = m_bitmapCache->insert(bitmap_key, bmps);
}
if (preset.is_default || preset.is_system){
if (preset.is_default || preset.is_system) {
ui->Append(wxString::FromUTF8((preset.name + (preset.is_dirty ? Preset::suffix_modified() : "")).c_str()),
(bitmap == 0) ? wxNullBitmap : *bitmap);
if (selected)