make doc.meta an unordered_map
This commit is contained in:
@@ -954,11 +954,10 @@ void PreviewTextEdit::displayFields()
|
||||
txt += "|" + QString::fromUtf8(m_ipath.c_str());
|
||||
txt += "</b><br><br>";
|
||||
txt += "<dl>\n";
|
||||
for (map<string,string>::const_iterator it = m_fdoc.meta.begin();
|
||||
it != m_fdoc.meta.end(); it++) {
|
||||
if (!it->second.empty())
|
||||
txt += "<dt>" + QString::fromUtf8(it->first.c_str()) + "</dt> "
|
||||
+ "<dd>" + QString::fromUtf8(escapeHtml(it->second).c_str())
|
||||
for (const auto& entry: m_fdoc.meta) {
|
||||
if (!entry.second.empty())
|
||||
txt += "<dt>" + QString::fromUtf8(entry.first.c_str()) + "</dt> "
|
||||
+ "<dd>" + QString::fromUtf8(escapeHtml(entry.second).c_str())
|
||||
+ "</dd>\n";
|
||||
}
|
||||
txt += "</dl></body></html>";
|
||||
|
||||
@@ -416,9 +416,8 @@ void RclMain::startNativeViewer(Rcl::Doc doc, int pagenum, QString term)
|
||||
subs["U"] = url_encode(url);
|
||||
subs["u"] = url;
|
||||
// Let %(xx) access all metadata.
|
||||
for (map<string,string>::const_iterator it = doc.meta.begin();
|
||||
it != doc.meta.end(); it++) {
|
||||
subs[it->first] = it->second;
|
||||
for (const auto& ent :doc.meta) {
|
||||
subs[ent.first] = ent.second;
|
||||
}
|
||||
execViewer(subs, enterHistory, execpath, lcmd, cmd, doc, execwflags);
|
||||
}
|
||||
|
||||
@@ -162,7 +162,7 @@ void ResTableDetailArea::createPopupMenu(const QPoint& pos)
|
||||
// little processing
|
||||
static string gengetter(const string& fld, const Rcl::Doc& doc)
|
||||
{
|
||||
map<string, string>::const_iterator it = doc.meta.find(fld);
|
||||
const auto it = doc.meta.find(fld);
|
||||
if (it == doc.meta.end()) {
|
||||
return string();
|
||||
}
|
||||
@@ -171,7 +171,7 @@ static string gengetter(const string& fld, const Rcl::Doc& doc)
|
||||
|
||||
static string sizegetter(const string& fld, const Rcl::Doc& doc)
|
||||
{
|
||||
map<string, string>::const_iterator it = doc.meta.find(fld);
|
||||
const auto it = doc.meta.find(fld);
|
||||
if (it == doc.meta.end()) {
|
||||
return string();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user