Add Lensfun DB lookup fallback directory
Load from the bundled database directory if loading from the configured location fails.
This commit is contained in:
@@ -58,10 +58,20 @@ int init (const Settings* s, const Glib::ustring& baseDir, const Glib::ustring&
|
||||
#pragma omp section
|
||||
#endif
|
||||
{
|
||||
bool ok;
|
||||
|
||||
if (s->lensfunDbDirectory.empty() || Glib::path_is_absolute(s->lensfunDbDirectory)) {
|
||||
LFDatabase::init(s->lensfunDbDirectory);
|
||||
ok = LFDatabase::init(s->lensfunDbDirectory);
|
||||
} else {
|
||||
LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbDirectory));
|
||||
ok = LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbDirectory));
|
||||
}
|
||||
|
||||
if (!ok && !s->lensfunDbBundleDirectory.empty() && s->lensfunDbBundleDirectory != s->lensfunDbDirectory) {
|
||||
if (Glib::path_is_absolute(s->lensfunDbBundleDirectory)) {
|
||||
LFDatabase::init(s->lensfunDbBundleDirectory);
|
||||
} else {
|
||||
LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbBundleDirectory));
|
||||
}
|
||||
}
|
||||
}
|
||||
#ifdef _OPENMP
|
||||
|
Reference in New Issue
Block a user