Use rating from EXIF/XMP where available
This commit is contained in:
@@ -1006,15 +1006,22 @@ void Thumbnail::setFileName (const Glib::ustring &fn)
|
||||
|
||||
int Thumbnail::getRank () const
|
||||
{
|
||||
return pparams->rank;
|
||||
// prefer the user-set rank over the embedded Rating
|
||||
// pparams->rank == -1 means that there is no saved rank yet, so we should
|
||||
// next look for the embedded Rating metadata.
|
||||
if (pparams->rank != -1) {
|
||||
return pparams->rank;
|
||||
} else {
|
||||
return cfs.rating;
|
||||
}
|
||||
}
|
||||
|
||||
void Thumbnail::setRank (int rank)
|
||||
{
|
||||
if (pparams->rank != rank) {
|
||||
pparams->rank = rank;
|
||||
pparamsValid = true;
|
||||
}
|
||||
pparamsValid = true;
|
||||
}
|
||||
|
||||
int Thumbnail::getColorLabel () const
|
||||
|
@@ -164,17 +164,8 @@ public:
|
||||
return cfs.md5;
|
||||
}
|
||||
|
||||
int getRank () const
|
||||
{
|
||||
return cfs.rating;
|
||||
}
|
||||
void setRank (int rank)
|
||||
{
|
||||
if (cfs.rating != rank) {
|
||||
cfs.rating = rank;
|
||||
}
|
||||
pparamsValid = true; // FIXME-piotr Is this the right way to refresh the cache? Probably not since pparams and cache should be 2 different things
|
||||
}
|
||||
int getRank () const;
|
||||
void setRank (int rank);
|
||||
|
||||
int getColorLabel () const;
|
||||
void setColorLabel (int colorlabel);
|
||||
|
Reference in New Issue
Block a user