From 6d453dbd3472a8030818ffc7222ab927992f899d Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Sun, 17 Sep 2017 00:35:37 +0200 Subject: [PATCH 1/2] make sure the lensfun db is found correctly when building RT in "bundle" mode --- rtgui/main-cli.cc | 8 ++++++++ rtgui/main.cc | 8 ++++++++ rtgui/options.cc | 5 +++-- 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index 36ef4ce8b..67ec895aa 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -59,6 +59,7 @@ Glib::ustring argv0; Glib::ustring creditsPath; Glib::ustring licensePath; Glib::ustring argv1; +Glib::ustring lensfunDbPath; //bool simpleEditor; //Glib::Threads::Thread* mainThread; @@ -145,10 +146,17 @@ int main (int argc, char **argv) licensePath = Glib::build_filename (exePath, LICENCE_SEARCH_PATH); } + if (Glib::path_is_absolute(LENSFUN_DB_PATH)) { + lensfunDbPath = LENSFUN_DB_PATH; + } else { + lensfunDbPath = Glib::build_filename(exePath, LENSFUN_DB_PATH); + } + #else argv0 = DATA_SEARCH_PATH; creditsPath = CREDITS_SEARCH_PATH; licensePath = LICENCE_SEARCH_PATH; + lensfunDbPath = LENSFUN_DB_PATH; #endif bool quickstart = dontLoadCache (argc, argv); diff --git a/rtgui/main.cc b/rtgui/main.cc index f85cb6084..9adca05d4 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -60,6 +60,7 @@ extern Options options; Glib::ustring argv0; Glib::ustring creditsPath; Glib::ustring licensePath; +Glib::ustring lensfunDbPath; Glib::ustring argv1; Glib::ustring argv2; bool simpleEditor = false; @@ -529,10 +530,17 @@ int main (int argc, char **argv) licensePath = Glib::build_filename (exePath, LICENCE_SEARCH_PATH); } + if (Glib::path_is_absolute (LENSFUN_DB_PATH)) { + lensfunDbPath = LENSFUN_DB_PATH; + } else { + lensfunDbPath = Glib::build_filename (exePath, LENSFUN_DB_PATH); + } + #else argv0 = DATA_SEARCH_PATH; creditsPath = CREDITS_SEARCH_PATH; licensePath = LICENCE_SEARCH_PATH; + lensfunDbPath = LENSFUN_DB_PATH; #endif diff --git a/rtgui/options.cc b/rtgui/options.cc index c2e2b586b..fb84082f0 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -24,7 +24,6 @@ #include "addsetids.h" #include "guiutils.h" #include "version.h" -#include "config.h" #ifdef _OPENMP #include @@ -50,6 +49,8 @@ Options options; Glib::ustring versionString = RTVERSION; Glib::ustring paramFileExtension = ".pp3"; +extern Glib::ustring lensfunDbPath; // defined in main + Options::Options () { @@ -729,7 +730,7 @@ void Options::setDefaults () gimpPluginShowInfoDialog = true; maxRecentFolders = 15; - rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; + rtSettings.lensfunDbDirectory = lensfunDbPath; } Options* Options::copyFrom (Options* other) From 6f7ca3f5ec4ca89a6c10b03a2256541bf694c447 Mon Sep 17 00:00:00 2001 From: Alberto Griggio Date: Sun, 17 Sep 2017 16:45:54 +0200 Subject: [PATCH 2/2] one more fix for locating the lensfun db in bundle mode --- rtgui/main-cli.cc | 7 +++---- rtgui/main.cc | 7 +++---- rtgui/options.cc | 5 +---- 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/rtgui/main-cli.cc b/rtgui/main-cli.cc index 67ec895aa..54f536f3a 100644 --- a/rtgui/main-cli.cc +++ b/rtgui/main-cli.cc @@ -59,7 +59,6 @@ Glib::ustring argv0; Glib::ustring creditsPath; Glib::ustring licensePath; Glib::ustring argv1; -Glib::ustring lensfunDbPath; //bool simpleEditor; //Glib::Threads::Thread* mainThread; @@ -147,16 +146,16 @@ int main (int argc, char **argv) } if (Glib::path_is_absolute(LENSFUN_DB_PATH)) { - lensfunDbPath = LENSFUN_DB_PATH; + options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; } else { - lensfunDbPath = Glib::build_filename(exePath, LENSFUN_DB_PATH); + options.rtSettings.lensfunDbDirectory = Glib::build_filename(exePath, LENSFUN_DB_PATH); } #else argv0 = DATA_SEARCH_PATH; creditsPath = CREDITS_SEARCH_PATH; licensePath = LICENCE_SEARCH_PATH; - lensfunDbPath = LENSFUN_DB_PATH; + options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; #endif bool quickstart = dontLoadCache (argc, argv); diff --git a/rtgui/main.cc b/rtgui/main.cc index 9adca05d4..ce212daf2 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -60,7 +60,6 @@ extern Options options; Glib::ustring argv0; Glib::ustring creditsPath; Glib::ustring licensePath; -Glib::ustring lensfunDbPath; Glib::ustring argv1; Glib::ustring argv2; bool simpleEditor = false; @@ -531,16 +530,16 @@ int main (int argc, char **argv) } if (Glib::path_is_absolute (LENSFUN_DB_PATH)) { - lensfunDbPath = LENSFUN_DB_PATH; + options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; } else { - lensfunDbPath = Glib::build_filename (exePath, LENSFUN_DB_PATH); + options.rtSettings.lensfunDbDirectory = Glib::build_filename (exePath, LENSFUN_DB_PATH); } #else argv0 = DATA_SEARCH_PATH; creditsPath = CREDITS_SEARCH_PATH; licensePath = LICENCE_SEARCH_PATH; - lensfunDbPath = LENSFUN_DB_PATH; + options.rtSettings.lensfunDbDirectory = LENSFUN_DB_PATH; #endif diff --git a/rtgui/options.cc b/rtgui/options.cc index fb84082f0..38be51931 100644 --- a/rtgui/options.cc +++ b/rtgui/options.cc @@ -49,8 +49,6 @@ Options options; Glib::ustring versionString = RTVERSION; Glib::ustring paramFileExtension = ".pp3"; -extern Glib::ustring lensfunDbPath; // defined in main - Options::Options () { @@ -729,8 +727,7 @@ void Options::setDefaults () lastLensProfileDir = ""; gimpPluginShowInfoDialog = true; maxRecentFolders = 15; - - rtSettings.lensfunDbDirectory = lensfunDbPath; + rtSettings.lensfunDbDirectory = ""; // set also in main.cc and main-cli.cc } Options* Options::copyFrom (Options* other)