Skip to content

Commit

Permalink
allow to use a relative path for Lensfun.DBDirectory in options
Browse files Browse the repository at this point in the history
  • Loading branch information
agriggio committed Sep 25, 2017
1 parent 31095d3 commit be39ef3
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
6 changes: 5 additions & 1 deletion rtengine/init.cc
Expand Up @@ -51,7 +51,11 @@ int init (const Settings* s, Glib::ustring baseDir, Glib::ustring userSettingsDi
Color::init ();
PerceptualToneCurve::init ();
RawImageSource::init ();
LFDatabase::init(s->lensfunDbDirectory);
if (s->lensfunDbDirectory.empty() || Glib::path_is_absolute(s->lensfunDbDirectory)) {
LFDatabase::init(s->lensfunDbDirectory);
} else {
LFDatabase::init(Glib::build_filename(baseDir, s->lensfunDbDirectory));
}
delete lcmsMutex;
lcmsMutex = new MyMutex;
dfm.init( s->darkFramesPath );
Expand Down
6 changes: 1 addition & 5 deletions rtgui/main-cli.cc
Expand Up @@ -145,11 +145,7 @@ int main (int argc, char **argv)
licensePath = Glib::build_filename (exePath, LICENCE_SEARCH_PATH);
}

if (Glib::path_is_absolute(LENSFUN_DB_PATH)) {
options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;
} else {
options.rtSettings.lensfunDbDirectory = Glib::build_filename(exePath, LENSFUN_DB_PATH);
}
options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;

#else
argv0 = DATA_SEARCH_PATH;
Expand Down
6 changes: 1 addition & 5 deletions rtgui/main.cc
Expand Up @@ -529,11 +529,7 @@ int main (int argc, char **argv)
licensePath = Glib::build_filename (exePath, LICENCE_SEARCH_PATH);
}

if (strlen(LENSFUN_DB_PATH) == 0 || Glib::path_is_absolute (LENSFUN_DB_PATH)) {
options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;
} else {
options.rtSettings.lensfunDbDirectory = Glib::build_filename (exePath, LENSFUN_DB_PATH);
}
options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH;

#else
argv0 = DATA_SEARCH_PATH;
Expand Down

0 comments on commit be39ef3

Please sign in to comment.