Changed "Processing profile operations -> Custom Profile Builder" to "Reset to default profile"

The behaviour has changed slightly, so that clicking the menu item now resets
to the default processing profile specified in the preferences. If this
involves calling the custom profile builder, the behaviour is the same as
before. But this is a bit more general, in that it might also simply reapply
the static default profile, or regenerate the dynamic one (depending on the
user's settings)
This commit is contained in:
Alberto Griggio
2017-03-13 23:24:12 +01:00
parent 3660ed5f95
commit e0d9090420
5 changed files with 16 additions and 11 deletions

View File

@@ -198,14 +198,13 @@ const ProcParams& Thumbnail::getProcParamsU ()
* The loaded profile may be partial, but it return a complete ProcParams (i.e. without ParamsEdited)
*
* @param returnParams Ask to return a pointer to a ProcParams object if true
* @param forceCPB True if the Custom Profile Builder has to be invoked, False if the CPB has to be invoked if the profile doesn't
* exist yet. It depends on other conditions too
* @param force True if the profile has to be re-generated even if it already exists
* @param flaggingMode True if the ProcParams will be created because the file browser is being flagging an image
* (rang, to trash, color labels). This parameter is passed to the CPB.
*
* @return Return a pointer to a ProcPamas structure to be updated if returnParams is true and if everything went fine, NULL otherwise.
*/
rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool returnParams, bool forceCPB, bool flaggingMode)
rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool returnParams, bool force, bool flaggingMode)
{
static int index = 0; // Will act as unique identifier during the session
@@ -217,7 +216,7 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu
const CacheImageData* cfs = getCacheImageData();
Glib::ustring defaultPparamsPath = options.findProfilePath(defProf);
const bool create = (!hasProcParams() || forceCPB);
const bool create = (!hasProcParams() || force);
const Glib::ustring outFName =
(options.paramsLoadLocation == PLL_Input) ?
@@ -239,6 +238,12 @@ rtengine::procparams::ProcParams* Thumbnail::createProcParamsForUpdate(bool retu
if (!err) {
loadProcParams();
}
} else if (create &&
defProf != DEFPROFILE_DYNAMIC && defProf != DEFPROFILE_INTERNAL){
const PartialProfile *p = profileStore.getProfile(defProf);
if (p && !p->pparams->save(outFName)) {
loadProcParams();
}
}
if (!options.CPBPath.empty() && !defaultPparamsPath.empty() && create && cfs && cfs->exifValid) {