exifpanel: sort the list of exif tags
(cherry picked from commit 88e5ec5dc6a47d3a9cc751d2902aadc540ce0826)
This commit is contained in:
parent
9735ba5768
commit
f62f6807a7
@ -174,7 +174,7 @@ void ExifPanel::setImageData (const FramesMetaData* id)
|
|||||||
idata = id;
|
idata = id;
|
||||||
}
|
}
|
||||||
|
|
||||||
Gtk::TreeModel::Children ExifPanel::addTag(const std::string &key, const Glib::ustring &label, const Glib::ustring &value, bool editable, bool edited)
|
void ExifPanel::addTag(const std::string &key, const Glib::ustring &label, const Glib::ustring &value, bool editable, bool edited)
|
||||||
{
|
{
|
||||||
|
|
||||||
// TODO Re-fix #5923 if necessary
|
// TODO Re-fix #5923 if necessary
|
||||||
@ -184,7 +184,7 @@ Gtk::TreeModel::Children ExifPanel::addTag(const std::string &key, const Glib::u
|
|||||||
|
|
||||||
auto root = exifTreeModel->children();
|
auto root = exifTreeModel->children();
|
||||||
|
|
||||||
Gtk::TreeModel::Row row = * (exifTreeModel->append (root));
|
Gtk::TreeModel::Row row = *(exifTreeModel->append(root));
|
||||||
row[exifColumns.editable] = editable;
|
row[exifColumns.editable] = editable;
|
||||||
row[exifColumns.edited] = edited;
|
row[exifColumns.edited] = edited;
|
||||||
row[exifColumns.key] = key;
|
row[exifColumns.key] = key;
|
||||||
@ -200,8 +200,6 @@ Gtk::TreeModel::Children ExifPanel::addTag(const std::string &key, const Glib::u
|
|||||||
} else if (editable) {
|
} else if (editable) {
|
||||||
row[exifColumns.icon] = keepicon;
|
row[exifColumns.icon] = keepicon;
|
||||||
}
|
}
|
||||||
|
|
||||||
return row.children();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void ExifPanel::refreshTags()
|
void ExifPanel::refreshTags()
|
||||||
@ -244,6 +242,7 @@ void ExifPanel::refreshTags()
|
|||||||
addTag(pos->key(), pos->tagLabel(), pos->print(&exif), true, edited);
|
addTag(pos->key(), pos->tagLabel(), pos->print(&exif), true, edited);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
std::map<std::string, std::string> keymap;
|
||||||
for (const auto& tag : exif) {
|
for (const auto& tag : exif) {
|
||||||
const bool editable = ed.find(tag.key()) != ed.end();
|
const bool editable = ed.find(tag.key()) != ed.end();
|
||||||
if (
|
if (
|
||||||
@ -255,9 +254,17 @@ void ExifPanel::refreshTags()
|
|||||||
|| tag.size() < 256
|
|| tag.size() < 256
|
||||||
)
|
)
|
||||||
) {
|
) {
|
||||||
addTag(tag.key(), tag.tagLabel(), tag.print(&exif), false, false);
|
std::string lbl = tag.tagLabel();
|
||||||
|
for (auto &c : lbl) {
|
||||||
|
c = std::tolower(c);
|
||||||
|
}
|
||||||
|
keymap[lbl] = tag.key();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto &p : keymap) {
|
||||||
|
auto &tag = *(exif.findKey(Exiv2::ExifKey(p.second)));
|
||||||
|
addTag(tag.key(), tag.tagLabel(), tag.print(&exif), false, false);
|
||||||
|
}
|
||||||
} catch (const std::exception& exc) {
|
} catch (const std::exception& exc) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -82,7 +82,7 @@ private:
|
|||||||
|
|
||||||
const std::vector<std::pair<std::string, Glib::ustring>> editableTags;
|
const std::vector<std::pair<std::string, Glib::ustring>> editableTags;
|
||||||
|
|
||||||
Gtk::TreeModel::Children addTag(const std::string &key, const Glib::ustring &label, const Glib::ustring &value, bool editable, bool edited);
|
void addTag(const std::string &key, const Glib::ustring &label, const Glib::ustring &value, bool editable, bool edited);
|
||||||
void refreshTags();
|
void refreshTags();
|
||||||
void resetIt(const Gtk::TreeModel::const_iterator& iter);
|
void resetIt(const Gtk::TreeModel::const_iterator& iter);
|
||||||
void resetPressed();
|
void resetPressed();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user