Skip to content

Commit

Permalink
clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
janbar committed Oct 25, 2023
1 parent 97a4488 commit 8455c81
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/favoritesmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ int FavoritesModel::append(double lat, double lon, const QString& label, const Q
bool FavoritesModel::remove(int id)
{
int row = 0;
for (FavoriteItem* item : m_items)
for (FavoriteItem* item : qAsConst(m_items))
{
if (item->id() == id)
{
Expand Down Expand Up @@ -279,7 +279,7 @@ bool FavoritesModel::storeData()
{
succeeded = true;
osmin::CSVParser csv(',', '"');
for (FavoriteItem* item : m_items)
for (FavoriteItem* item : qAsConst(m_items))
{
QList<QByteArray*> row;
QString num;
Expand Down Expand Up @@ -355,7 +355,7 @@ bool FavoritesModel::loadData()
if (data.count() > 0)
{
beginInsertRows(QModelIndex(), 0, data.count()-1);
for (FavoriteItem* item : data)
for (FavoriteItem* item : qAsConst(data))
{
item->setId(++m_seq);
m_items << item;
Expand Down Expand Up @@ -391,7 +391,7 @@ void FavoritesModel::clearData()
int FavoritesModel::isFavorite(double lat, double lon)
{
osmin::LockGuard<QRecursiveMutex> g(m_lock);
for (FavoriteItem* item : m_items)
for (FavoriteItem* item : qAsConst(m_items))
{
double r = osmin::Utils::sphericalDistance(item->lat(), item->lon(), lat, lon);
if (r < AREA_RADIUS)
Expand Down
2 changes: 1 addition & 1 deletion src/gpxfilemodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,7 @@ QVariantList GPXFileModel::createOverlayObjects(int id /*=-1*/)
{
osmin::LockGuard<QRecursiveMutex> g(m_lock);
QVariantList list;
for (const GPXObject* item : m_items)
for (const GPXObject* item : qAsConst(m_items))
{
if (id >= 0 && item->id() != id)
continue;
Expand Down
2 changes: 1 addition & 1 deletion src/gpxlistmodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,7 @@ bool GPXListModel::removeItem(const QModelIndex& index)
QString GPXListModel::findFileById(int bid)
{
osmin::LockGuard<QRecursiveMutex> g(m_lock);
for (GPXItem* item : m_items)
for (GPXItem* item : qAsConst(m_items))
{
if (item->bigId() == bid)
return QDir(m_root).absolutePath().append(QDir::separator())
Expand Down

0 comments on commit 8455c81

Please sign in to comment.