Fix rank, color label, and trash status reset
The rank, color label, and trash status from a previous session would reset after editing an image or clearing the processing profile.
This commit is contained in:
parent
00360a6dbb
commit
b16287ff6f
@ -485,7 +485,7 @@ void Thumbnail::clearProcParams (int whoClearedIt)
|
|||||||
pparams->setDefaults();
|
pparams->setDefaults();
|
||||||
|
|
||||||
// preserve rank, colorlabel and inTrash across clear
|
// preserve rank, colorlabel and inTrash across clear
|
||||||
updateProcParamsProperties();
|
updateProcParamsProperties(true);
|
||||||
|
|
||||||
// params could get validated by updateProcParamsProperties
|
// params could get validated by updateProcParamsProperties
|
||||||
if (pparamsValid) {
|
if (pparamsValid) {
|
||||||
@ -594,7 +594,7 @@ void Thumbnail::setProcParams (const ProcParams& pp, ParamsEdited* pe, int whoCh
|
|||||||
pparamsValid = true;
|
pparamsValid = true;
|
||||||
|
|
||||||
// do not update rank, colorlabel and inTrash
|
// do not update rank, colorlabel and inTrash
|
||||||
updateProcParamsProperties();
|
updateProcParamsProperties(true);
|
||||||
|
|
||||||
if (updateCacheNow) {
|
if (updateCacheNow) {
|
||||||
updateCache();
|
updateCache();
|
||||||
@ -1295,25 +1295,25 @@ void Thumbnail::loadProperties()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Thumbnail::updateProcParamsProperties()
|
void Thumbnail::updateProcParamsProperties(bool forceUpdate)
|
||||||
{
|
{
|
||||||
if (!properties.edited()) {
|
if (!(properties.edited() || forceUpdate)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (properties.trashed.edited && properties.trashed != pparams->inTrash) {
|
if ((properties.trashed.edited || forceUpdate) && properties.trashed != pparams->inTrash) {
|
||||||
pparams->inTrash = properties.trashed;
|
pparams->inTrash = properties.trashed;
|
||||||
pparamsValid = true;
|
pparamsValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// save procparams rank and color also when options.thumbnailRankColorMode == Options::ThumbnailPropertyMode::XMP
|
// save procparams rank and color also when options.thumbnailRankColorMode == Options::ThumbnailPropertyMode::XMP
|
||||||
// so they'll be kept in sync
|
// so they'll be kept in sync
|
||||||
if (properties.rank.edited && properties.rank != pparams->rank) {
|
if ((properties.rank.edited || forceUpdate) && properties.rank != pparams->rank) {
|
||||||
pparams->rank = properties.rank;
|
pparams->rank = properties.rank;
|
||||||
pparamsValid = true;
|
pparamsValid = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (properties.color.edited && properties.color != pparams->colorlabel) {
|
if ((properties.color.edited || forceUpdate) && properties.color != pparams->colorlabel) {
|
||||||
pparams->colorlabel = properties.color;
|
pparams->colorlabel = properties.color;
|
||||||
pparamsValid = true;
|
pparamsValid = true;
|
||||||
}
|
}
|
||||||
|
@ -115,7 +115,7 @@ class Thumbnail
|
|||||||
|
|
||||||
void saveMetadata();
|
void saveMetadata();
|
||||||
void loadProperties();
|
void loadProperties();
|
||||||
void updateProcParamsProperties();
|
void updateProcParamsProperties(bool forceUpdate = false);
|
||||||
void saveXMPSidecarProperties();
|
void saveXMPSidecarProperties();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user