Skip to content

Commit 7d0ce2f

Browse files
authored
Merge pull request #7224 from Lawrence37/rank-reset-fix
Fix for rank, color label, and trash status reset
2 parents 3e8d581 + b16287f commit 7d0ce2f

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

rtgui/thumbnail.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,7 @@ void Thumbnail::clearProcParams (int whoClearedIt)
485485
pparams->setDefaults();
486486

487487
// preserve rank, colorlabel and inTrash across clear
488-
updateProcParamsProperties();
488+
updateProcParamsProperties(true);
489489

490490
// params could get validated by updateProcParamsProperties
491491
if (pparamsValid) {
@@ -594,7 +594,7 @@ void Thumbnail::setProcParams (const ProcParams& pp, ParamsEdited* pe, int whoCh
594594
pparamsValid = true;
595595

596596
// do not update rank, colorlabel and inTrash
597-
updateProcParamsProperties();
597+
updateProcParamsProperties(true);
598598

599599
if (updateCacheNow) {
600600
updateCache();
@@ -1295,25 +1295,25 @@ void Thumbnail::loadProperties()
12951295
}
12961296
}
12971297

1298-
void Thumbnail::updateProcParamsProperties()
1298+
void Thumbnail::updateProcParamsProperties(bool forceUpdate)
12991299
{
1300-
if (!properties.edited()) {
1300+
if (!(properties.edited() || forceUpdate)) {
13011301
return;
13021302
}
13031303

1304-
if (properties.trashed.edited && properties.trashed != pparams->inTrash) {
1304+
if ((properties.trashed.edited || forceUpdate) && properties.trashed != pparams->inTrash) {
13051305
pparams->inTrash = properties.trashed;
13061306
pparamsValid = true;
13071307
}
13081308

13091309
// save procparams rank and color also when options.thumbnailRankColorMode == Options::ThumbnailPropertyMode::XMP
13101310
// so they'll be kept in sync
1311-
if (properties.rank.edited && properties.rank != pparams->rank) {
1311+
if ((properties.rank.edited || forceUpdate) && properties.rank != pparams->rank) {
13121312
pparams->rank = properties.rank;
13131313
pparamsValid = true;
13141314
}
13151315

1316-
if (properties.color.edited && properties.color != pparams->colorlabel) {
1316+
if ((properties.color.edited || forceUpdate) && properties.color != pparams->colorlabel) {
13171317
pparams->colorlabel = properties.color;
13181318
pparamsValid = true;
13191319
}

rtgui/thumbnail.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ class Thumbnail
115115

116116
void saveMetadata();
117117
void loadProperties();
118-
void updateProcParamsProperties();
118+
void updateProcParamsProperties(bool forceUpdate = false);
119119
void saveXMPSidecarProperties();
120120

121121
public:

0 commit comments

Comments
 (0)