From 55af95b15b1208c5174568978b2b6e8cf45e1262 Mon Sep 17 00:00:00 2001 From: Hombre Date: Mon, 6 Apr 2015 23:18:32 +0200 Subject: [PATCH] Solving issue 2732: "Command-line option to use default (non)raw PP3 does not work" --- rtengine/procparams.cc | 7 +++++-- rtgui/history.cc | 10 ++++------ rtgui/main.cc | 5 ++--- rtgui/paramsedited.cc | 2 +- rtgui/partialpastedlg.cc | 7 +------ rtgui/profilepanel.cc | 2 -- rtgui/toolpanelcoord.cc | 1 - 7 files changed, 13 insertions(+), 21 deletions(-) diff --git a/rtengine/procparams.cc b/rtengine/procparams.cc index 00bed4df5..881d71cc3 100644 --- a/rtengine/procparams.cc +++ b/rtengine/procparams.cc @@ -3120,7 +3120,7 @@ PartialProfile::PartialProfile(bool createInstance) { } else { pparams = NULL; - pedited=NULL; + pedited = NULL; } } @@ -3155,7 +3155,10 @@ PartialProfile::PartialProfile(const ProcParams* pp, const ParamsEdited* pe) { int PartialProfile::load (Glib::ustring fName) { if (!pparams) pparams = new ProcParams(); if (!pedited) pedited = new ParamsEdited(); - return pparams->load(fName, pedited); + if (fName == DEFPROFILE_INTERNAL) + return 0; + else + return pparams->load(fName, pedited); } void PartialProfile::deleteInstance () { diff --git a/rtgui/history.cc b/rtgui/history.cc index 87f422139..53365d9aa 100644 --- a/rtgui/history.cc +++ b/rtgui/history.cc @@ -151,10 +151,9 @@ void History::historySelectionChanged () { if (row) bTreeView->get_selection()->unselect_all (); if (row && tpc) { - ProcParams pparams = row[historyColumns.params]; + ProcParams pparams = row[historyColumns.params]; ParamsEdited pe; - pe.set(true); - PartialProfile pp(&pparams, &pe); + PartialProfile pp(&pparams, &pe); ParamsEdited paramsEdited = row[historyColumns.paramsEdited]; tpc->profileChange (&pp, EvHistoryBrowsed, row[historyColumns.text], ¶msEdited); } @@ -177,10 +176,9 @@ void History::bookmarkSelectionChanged () { if (row) hTreeView->get_selection()->unselect_all (); if (row && tpc) { - ProcParams pparams = row[bookmarkColumns.params]; + ProcParams pparams = row[bookmarkColumns.params]; ParamsEdited pe; - pe.set(true); - PartialProfile pp(&pparams, &pe); + PartialProfile pp(&pparams, &pe); ParamsEdited paramsEdited = row[bookmarkColumns.paramsEdited]; tpc->profileChange (&pp, EvBookmarkSelected, row[bookmarkColumns.text], ¶msEdited); } diff --git a/rtgui/main.cc b/rtgui/main.cc index 9b4b20d99..f0c2e4e0c 100644 --- a/rtgui/main.cc +++ b/rtgui/main.cc @@ -544,7 +544,7 @@ int processLineParams( int argc, char **argv ) if (useDefault) { rawParams = new rtengine::procparams::PartialProfile(true); Glib::ustring profPath = options.findProfilePath(options.defProfRaw); - if (options.is_defProfRawMissing() || profPath.empty() || rawParams->load(Glib::build_filename(profPath, Glib::path_get_basename(options.defProfRaw) + paramFileExtension))) { + if (options.is_defProfRawMissing() || profPath.empty() || rawParams->load(profPath==DEFPROFILE_INTERNAL ? DEFPROFILE_INTERNAL : Glib::build_filename(profPath, Glib::path_get_basename(options.defProfRaw) + paramFileExtension))) { std::cerr << "Error: default raw processing profile not found" << std::endl; rawParams->deleteInstance(); delete rawParams; @@ -553,7 +553,7 @@ int processLineParams( int argc, char **argv ) } imgParams = new rtengine::procparams::PartialProfile(true); profPath = options.findProfilePath(options.defProfImg); - if (options.is_defProfImgMissing() || profPath.empty() || imgParams->load(Glib::build_filename(profPath, Glib::path_get_basename(options.defProfImg) + paramFileExtension))) { + if (options.is_defProfImgMissing() || profPath.empty() || imgParams->load(profPath==DEFPROFILE_INTERNAL ? DEFPROFILE_INTERNAL : Glib::build_filename(profPath, Glib::path_get_basename(options.defProfImg) + paramFileExtension))) { std::cerr << "Error: default non-raw processing profile not found" << std::endl; imgParams->deleteInstance(); delete imgParams; @@ -564,7 +564,6 @@ int processLineParams( int argc, char **argv ) } } - ParamsEdited paramsEdited; for( size_t iFile=0; iFile< inputFiles.size(); iFile++){ // Has to be reinstanciated at each profile to have a ProcParams object with default values diff --git a/rtgui/paramsedited.cc b/rtgui/paramsedited.cc index f47a78819..0306846fd 100644 --- a/rtgui/paramsedited.cc +++ b/rtgui/paramsedited.cc @@ -23,7 +23,7 @@ ParamsEdited::ParamsEdited () { - set (false); + set (true); } void ParamsEdited::set (bool v) { diff --git a/rtgui/partialpastedlg.cc b/rtgui/partialpastedlg.cc index e5bdba1af..1decc743d 100644 --- a/rtgui/partialpastedlg.cc +++ b/rtgui/partialpastedlg.cc @@ -630,15 +630,10 @@ void PartialPasteDlg::metaicmToggled () { void PartialPasteDlg::applyPaste (rtengine::procparams::ProcParams* dstPP, ParamsEdited* dstPE, const rtengine::procparams::ProcParams* srcPP, const ParamsEdited* srcPE) { ParamsEdited falsePE; // falsePE is a workaround to set a group of ParamsEdited to false - ParamsEdited filterPE; // Contains the initial information about the loaded values + ParamsEdited filterPE; // Contains the initial information about the loaded values ; filterPE is set to TRUE (default) so everything has to be copied if (srcPE) { filterPE = *srcPE; } - else { - // By default, everything has to be copied - filterPE.set(true); - } - // the general section is always ignored, whichever operation we use the PartialPaste for filterPE.general = falsePE.general; diff --git a/rtgui/profilepanel.cc b/rtgui/profilepanel.cc index 76cda5090..6bd7b0359 100644 --- a/rtgui/profilepanel.cc +++ b/rtgui/profilepanel.cc @@ -575,7 +575,6 @@ void ProfilePanel::selection_changed () { if (s) { if (fillMode->get_active() && s->pedited) { ParamsEdited pe; - pe.set(true); PartialProfile s2(s->pparams, &pe, false); changeTo (&s2, pse->label+"+"); } @@ -633,7 +632,6 @@ void ProfilePanel::initProfile (const Glib::ustring& profileFullPath, ProcParams } if (lastSaved) { ParamsEdited* pe = new ParamsEdited(); - pe->set(true); // copying the provided last saved profile to ProfilePanel::lastsaved lastsaved = new PartialProfile(lastSaved, pe); } diff --git a/rtgui/toolpanelcoord.cc b/rtgui/toolpanelcoord.cc index 77e54aa28..6f6e19864 100644 --- a/rtgui/toolpanelcoord.cc +++ b/rtgui/toolpanelcoord.cc @@ -326,7 +326,6 @@ void ToolPanelCoordinator::profileChange (const PartialProfile *nparams, rtengi ParamsEdited pe; std::vector lParams(2); lParams[0]=*params; lParams[1]=*mergedParams; - pe.set(true); pe.initFrom (lParams); filterRawRefresh = pe.raw.isUnchanged() && pe.lensProf.isUnchanged();