From c524e88a3b964542e60920cafc26f471a2d03bd2 Mon Sep 17 00:00:00 2001 From: janbar Date: Sat, 5 Oct 2024 17:00:22 +0200 Subject: [PATCH] prevent deprecation of qAsConst in qt6 --- src/gpxlistmodel.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gpxlistmodel.cpp b/src/gpxlistmodel.cpp index 564a79e8..4033808b 100644 --- a/src/gpxlistmodel.cpp +++ b/src/gpxlistmodel.cpp @@ -291,8 +291,8 @@ bool GPXListModel::removeItem(const QModelIndex& index) } else if (!dir.remove(item->name())) return false; - QMultiMap::iterator it = m_items.find(item->path()); - while (it != m_items.end() && it.key() == item->path()) + QMultiMap::const_iterator it = m_items.constfind(item->path()); + while (it != m_items.cend() && it.key() == item->path()) { if (it.value()->name() == item->name()) { @@ -310,7 +310,7 @@ bool GPXListModel::removeItem(const QModelIndex& index) QString GPXListModel::findFileById(int bid) { osmin::LockGuard 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())