Refresh cached image data if sidecar is changed

This commit is contained in:
Lawrence Lee
2023-05-14 18:18:27 -07:00
parent 572a75f02a
commit c557b320c2
6 changed files with 55 additions and 5 deletions

View File

@@ -26,6 +26,15 @@
#include "../rtengine/procparams.h"
#include "../rtengine/settings.h"
namespace
{
const Glib::ustring INI_GROUP_XMP_SIDECAR = "XmpSidecar";
const Glib::ustring INI_XMP_SIDECAR_MD5 = "MD5";
}
CacheImageData::CacheImageData() :
supported(false),
format(FT_Invalid),
@@ -108,6 +117,12 @@ int CacheImageData::load (const Glib::ustring& fname)
}
}
if (keyFile.has_group(INI_GROUP_XMP_SIDECAR)) {
if (keyFile.has_key(INI_GROUP_XMP_SIDECAR, INI_XMP_SIDECAR_MD5)) {
xmpSidecarMd5 = keyFile.get_string(INI_GROUP_XMP_SIDECAR, INI_XMP_SIDECAR_MD5);
}
}
timeValid = keyFile.has_group ("DateTime");
if (timeValid) {
@@ -268,6 +283,8 @@ int CacheImageData::save (const Glib::ustring& fname)
keyFile.set_boolean ("General", "RecentlySaved", recentlySaved);
keyFile.set_integer ("General", "Rating", rating);
keyFile.set_string(INI_GROUP_XMP_SIDECAR, INI_XMP_SIDECAR_MD5, xmpSidecarMd5);
// remove the old implementation of Rank and InTrash from cache
if (keyFile.has_key ("General", "Rank")) {
keyFile.remove_key("General", "Rank");