Added some performance changes

This commit is contained in:
YuSanka 2018-04-18 13:32:21 +02:00
parent d254c39a77
commit 3ca2dfbc1d
8 changed files with 455 additions and 181 deletions

View file

@ -629,11 +629,13 @@ bool PresetCollection::update_dirty_ui(wxBitmapComboBox *ui)
return was_dirty != is_dirty;
}
std::vector<std::string> PresetCollection::dirty_options(const Preset *edited, const Preset *reference)
std::vector<std::string> PresetCollection::dirty_options(const Preset *edited, const Preset *reference, const bool is_printer_type /*= false*/)
{
std::vector<std::string> changed;
if (edited != nullptr && reference != nullptr) {
changed = reference->config.diff(edited->config);
if (edited != nullptr && reference != nullptr) {
changed = is_printer_type ?
reference->config.deep_diff(edited->config) :
reference->config.diff(edited->config);
// The "compatible_printers" option key is handled differently from the others:
// It is not mandatory. If the key is missing, it means it is compatible with any printer.
// If the key exists and it is empty, it means it is compatible with no printer.