Skip to content

Commit

Permalink
prevent deprecation of qAsConst in qt6
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Oct 5, 2024
1 parent e5429d5 commit c524e88
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/gpxlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -291,8 +291,8 @@ bool GPXListModel::removeItem(const QModelIndex& index)
}
else if (!dir.remove(item->name()))
return false;
QMultiMap<QString, GPXItem*>::iterator it = m_items.find(item->path());
while (it != m_items.end() && it.key() == item->path())
QMultiMap<QString, GPXItem*>::const_iterator it = m_items.constfind(item->path());
while (it != m_items.cend() && it.key() == item->path())
{
if (it.value()->name() == item->name())
{
Expand All @@ -310,7 +310,7 @@ bool GPXListModel::removeItem(const QModelIndex& index)
QString GPXListModel::findFileById(int bid)
{
osmin::LockGuard<QRecursiveMutex> g(m_lock);
for (GPXItem* item : qAsConst(m_items))
for (GPXItem* item : std::as_const(m_items))
{
if (item->bigId() == bid)
return QDir(m_root).absolutePath().append(QDir::separator())
Expand Down

0 comments on commit c524e88

Please sign in to comment.