Fix data loading of manually selected Lensfun lens

Remove requirement that the lens mount matches the camera mount. This
allows adapted lenses to work. Matching the lens mount isn't even
necessary because the make and model names together should be unique.
This commit is contained in:
Lawrence Lee 2025-05-25 15:31:08 -07:00
parent 2aa784e417
commit a3d3457bfd
No known key found for this signature in database
GPG Key ID: 048FF2B76A63895F

View File

@ -30,16 +30,6 @@
namespace
{
bool isCStringIn(const char *str, const char *const *list)
{
for (auto element_ptr = list; *element_ptr; element_ptr++) {
if (!strcmp(str, *element_ptr)) {
return true;
}
}
return false;
}
bool isNextLensCropFactorBetter(const lfLens *current_lens, const lfCamera *camera, float next_lens_crop_factor)
{
if (!current_lens) {
@ -75,8 +65,7 @@ bool isNextLensCropFactorBetter(const lfLens *current_lens, const lfCamera *came
bool isNextLensBetter(const lfCamera *camera, const lfLens *current_lens, const lfLens &next_lens, const Glib::ustring &lens_name, const Glib::ustring &next_lens_name)
{
return isNextLensCropFactorBetter(current_lens, camera, next_lens.CropFactor) &&
lens_name == next_lens_name &&
(!camera || isCStringIn(camera->Mount, next_lens.Mounts));
lens_name == next_lens_name;
}
/**