71 if (location.toMap().isEmpty())
74 QVariant locDesc = location.toMap().value(
"text");
75 auto it = std::find_if(m_data.begin(), m_data.end(),
76 [locDesc](QVariant v) { return v.toMap().value(
"text") == locDesc; });
77 if (!m_data.empty() && (it == m_data.begin())) {
86 if (it != m_data.end()) {
87 int existingIndex = std::distance(m_data.begin(), it);
88 beginRemoveRows(QModelIndex(), existingIndex, existingIndex);
93 beginInsertRows(QModelIndex(), 0, 0);
94 m_data.push_front(location);