Skip to content

Commit

Permalink
Fix build against wxWidgets older than 3.1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasmatena committed Mar 1, 2021
1 parent b10d064 commit 3f1299c
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion src/slic3r/GUI/ConfigWizard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -819,7 +819,22 @@ void PageMaterials::update_lists(int sel_type, int sel_vendor, int last_selected
wxArrayInt sel_printers;
int sel_printers_count = list_printer->GetSelections(sel_printers);

if (sel_printers != sel_printers_prev) {
// Does our wxWidgets version support operator== for wxArrayInt ?
// https://github.com/prusa3d/PrusaSlicer/issues/5152#issuecomment-787208614
#if wxCHECK_VERSION(3, 1, 1)
if (sel_printers != sel_printers_prev) {
#else
auto are_equal = [](const wxArrayInt& arr_first, const wxArrayInt& arr_second) {
if (arr_first.GetCount() != arr_second.GetCount())
return false;
for (size_t i = 0; i < arr_first.GetCount(); i++)
if (arr_first[i] != arr_second[i])
return false;
return true;
};
if (!are_equal(sel_printers, sel_printers_prev)) {
#endif

// Refresh type list
list_type->Clear();
list_type->append(_L("(All)"), &EMPTY);
Expand Down

0 comments on commit 3f1299c

Please sign in to comment.