Launcher: fix location not saving
When the history was empty, the ‘don’t re-insert’ logic was breaking, because the beginning and end of the vector range were equivalent.
This commit is contained in:
parent
dcec806337
commit
3da6d42945
1 changed files with 1 additions and 1 deletions
|
@ -71,7 +71,7 @@ void RecentLocationsModel::insert(QVariant location)
|
|||
QVariant locDesc = location.toMap().value("text");
|
||||
auto it = std::find_if(m_data.begin(), m_data.end(),
|
||||
[locDesc](QVariant v) { return v.toMap().value("text") == locDesc; });
|
||||
if (it == m_data.begin()) {
|
||||
if (!m_data.empty() && (it == m_data.begin())) {
|
||||
// special, common case - nothing to do
|
||||
return;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue