added support for user-specific DCP and input ICC profiles dirs
Look for direcories dcpprofiles/ and iccprofiles/input/ under Options::rtdir (typically something like $HOME/.config/RawTherapee)
This commit is contained in:
parent
c5e606e310
commit
5d5c51d200
@ -1737,13 +1737,13 @@ void DCPStore::init(const Glib::ustring& rt_profile_dir, bool loadAll)
|
||||
file_std_profiles.clear();
|
||||
|
||||
if (!loadAll) {
|
||||
profileDir.assign (rt_profile_dir);
|
||||
profileDir = { rt_profile_dir, Glib::build_filename(options.rtdir, "dcpprofiles") };
|
||||
return;
|
||||
}
|
||||
|
||||
if (!rt_profile_dir.empty()) {
|
||||
std::deque<Glib::ustring> dirs = {
|
||||
rt_profile_dir
|
||||
rt_profile_dir,
|
||||
Glib::build_filename(options.rtdir, "dcpprofiles")
|
||||
};
|
||||
|
||||
while (!dirs.empty()) {
|
||||
@ -1784,7 +1784,6 @@ void DCPStore::init(const Glib::ustring& rt_profile_dir, bool loadAll)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool DCPStore::isValidDCPFileName(const Glib::ustring& filename) const
|
||||
@ -1839,13 +1838,15 @@ DCPProfile* DCPStore::getStdProfile(const Glib::ustring& requested_cam_short_nam
|
||||
}
|
||||
|
||||
// profile not found, looking if we're in loadAll=false mode
|
||||
if (!profileDir.empty()) {
|
||||
const Glib::ustring fname = Glib::build_filename(profileDir, requested_cam_short_name + Glib::ustring(".dcp"));
|
||||
for (const auto &dir : profileDir) {
|
||||
if (!dir.empty()) {
|
||||
const Glib::ustring fname = Glib::build_filename(dir, requested_cam_short_name + Glib::ustring(".dcp"));
|
||||
|
||||
if (Glib::file_test(fname, Glib::FILE_TEST_EXISTS)) {
|
||||
return getProfile(fname);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -166,7 +166,7 @@ private:
|
||||
DCPStore() = default;
|
||||
|
||||
mutable MyMutex mutex;
|
||||
Glib::ustring profileDir;
|
||||
std::vector<Glib::ustring> profileDir;
|
||||
|
||||
// these contain standard profiles from RT. keys are all in uppercase, file path is value
|
||||
std::map<Glib::ustring, Glib::ustring> file_std_profiles;
|
||||
|
@ -334,6 +334,8 @@ public:
|
||||
fileStdProfilesFileNames.clear();
|
||||
if (loadAll) {
|
||||
loadProfiles(stdProfilesDir, nullptr, nullptr, &fileStdProfilesFileNames, true);
|
||||
Glib::ustring user_input_icc_dir = Glib::build_filename(options.rtdir, "iccprofiles", "input");
|
||||
loadProfiles(user_input_icc_dir, nullptr, nullptr, &fileStdProfilesFileNames, true);
|
||||
}
|
||||
|
||||
defaultMonitorProfile = settings->monitorProfile;
|
||||
|
Loading…
x
Reference in New Issue
Block a user