From e2433214a370977a6837c6977e167b11b9fc36b4 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Thu, 19 Oct 2017 16:20:31 +0200 Subject: [PATCH] Fixed bug in updating the GUI value of the lensfun lens when maker name consists of multiple words It might happen in the lensfun DB that there are multiple makers sharing a similar name (at present, this only happens for "Leica" and "Leica Camera AG"). The logic for finding the lens in the combo box was not considering this... --- rtgui/lensprofile.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/rtgui/lensprofile.cc b/rtgui/lensprofile.cc index 3efe54347..6415c1fce 100644 --- a/rtgui/lensprofile.cc +++ b/rtgui/lensprofile.cc @@ -420,7 +420,8 @@ bool LensProfilePanel::setLensfunLens(const Glib::ustring &lens) if (it && (*it)[lf->lensfunModelLens.lens] == lens) { return true; } - + + bool first_maker_found = false; for (auto row : lf->lensfunLensModel->children()) { if (lens.find(row[lf->lensfunModelLens.lens]) == 0) { auto &c = row.children(); @@ -431,6 +432,11 @@ bool LensProfilePanel::setLensfunLens(const Glib::ustring &lens) return true; } } + // we do not break immediately here, because there might be multiple makers + // sharing the same prefix (e.g. "Leica" and "Leica Camera AG"). + // therefore, we break below when the lens doesn't match any of them + first_maker_found = true; + } else if (first_maker_found) { break; } }