do not save IPTC tags in the arp if they are unchanged
(cherry picked from commit c4c642794868c2b03fd824acc0a7db962162c16f)
This commit is contained in:
parent
2ce81cccc5
commit
a0e9a59606
@ -461,34 +461,41 @@ IPTCPanel::IPTCPanel():
|
|||||||
show_all();
|
show_all();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IPTCPanel::read (const ProcParams* pp, const ParamsEdited* pedited)
|
void IPTCPanel::read (const ProcParams* pp, const ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
|
|
||||||
disableListener();
|
disableListener();
|
||||||
changeList->clear();
|
changeList->clear();
|
||||||
|
|
||||||
if (!pp->metadata.iptc.empty()) {
|
if (!pp->metadata.iptc.empty()) {
|
||||||
*changeList = pp->metadata.iptc;
|
*changeList = pp->metadata.iptc;
|
||||||
|
changelist_valid_ = true;
|
||||||
} else {
|
} else {
|
||||||
*changeList = *embeddedData;
|
*changeList = *embeddedData;
|
||||||
|
changelist_valid_ = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
applyChangeList();
|
applyChangeList();
|
||||||
enableListener();
|
enableListener();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IPTCPanel::write (ProcParams* pp, ParamsEdited* pedited)
|
void IPTCPanel::write (ProcParams* pp, ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
|
if (changelist_valid_) {
|
||||||
pp->metadata.iptc = *changeList;
|
pp->metadata.iptc = *changeList;
|
||||||
|
} else {
|
||||||
|
pp->metadata.iptc.clear();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void IPTCPanel::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited)
|
void IPTCPanel::setDefaults (const ProcParams* defParams, const ParamsEdited* pedited)
|
||||||
{
|
{
|
||||||
|
|
||||||
*defChangeList = defParams->metadata.iptc;
|
*defChangeList = defParams->metadata.iptc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IPTCPanel::setImageData(const FramesMetaData* id)
|
void IPTCPanel::setImageData(const FramesMetaData* id)
|
||||||
{
|
{
|
||||||
embeddedData->clear();
|
embeddedData->clear();
|
||||||
@ -510,9 +517,9 @@ void IPTCPanel::setImageData(const FramesMetaData* id)
|
|||||||
file->set_sensitive(!embeddedData->empty());
|
file->set_sensitive(!embeddedData->empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void IPTCPanel::notifyListener()
|
void IPTCPanel::notifyListener()
|
||||||
{
|
{
|
||||||
|
|
||||||
if (listener) {
|
if (listener) {
|
||||||
listener->panelChanged(EvIPTC, M("HISTORY_CHANGED"));
|
listener->panelChanged(EvIPTC, M("HISTORY_CHANGED"));
|
||||||
}
|
}
|
||||||
@ -628,7 +635,7 @@ void IPTCPanel::delSuppCategory()
|
|||||||
|
|
||||||
void IPTCPanel::updateChangeList()
|
void IPTCPanel::updateChangeList()
|
||||||
{
|
{
|
||||||
|
changelist_valid_ = true;
|
||||||
changeList->clear();
|
changeList->clear();
|
||||||
(*changeList)[CAPTION].push_back(captionText->get_text());
|
(*changeList)[CAPTION].push_back(captionText->get_text());
|
||||||
(*changeList)[CAPTION_WRITER].push_back(captionWriter->get_text());
|
(*changeList)[CAPTION_WRITER].push_back(captionWriter->get_text());
|
||||||
@ -756,9 +763,9 @@ void IPTCPanel::applyChangeList()
|
|||||||
|
|
||||||
void IPTCPanel::resetClicked()
|
void IPTCPanel::resetClicked()
|
||||||
{
|
{
|
||||||
|
|
||||||
disableListener();
|
disableListener();
|
||||||
*changeList = *defChangeList;
|
*changeList = *defChangeList;
|
||||||
|
changelist_valid_ = false;
|
||||||
applyChangeList();
|
applyChangeList();
|
||||||
enableListener();
|
enableListener();
|
||||||
notifyListener();
|
notifyListener();
|
||||||
|
@ -34,6 +34,7 @@ private:
|
|||||||
const std::unique_ptr<rtengine::procparams::IPTCPairs> changeList;
|
const std::unique_ptr<rtengine::procparams::IPTCPairs> changeList;
|
||||||
const std::unique_ptr<rtengine::procparams::IPTCPairs> defChangeList;
|
const std::unique_ptr<rtengine::procparams::IPTCPairs> defChangeList;
|
||||||
const std::unique_ptr<rtengine::procparams::IPTCPairs> embeddedData;
|
const std::unique_ptr<rtengine::procparams::IPTCPairs> embeddedData;
|
||||||
|
bool changelist_valid_;
|
||||||
|
|
||||||
Gtk::TextView* captionView;
|
Gtk::TextView* captionView;
|
||||||
Glib::RefPtr<Gtk::TextBuffer> captionText;
|
Glib::RefPtr<Gtk::TextBuffer> captionText;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user