Removed calls to foreach.

This commit is contained in:
Leonardo Zide 2018-02-21 16:12:18 -08:00
parent 10491629b7
commit 172528ac1f
6 changed files with 8 additions and 7 deletions

View file

@ -753,7 +753,7 @@ void lcMainWindow::dragEnterEvent(QDragEnterEvent* Event)
void lcMainWindow::dropEvent(QDropEvent* Event)
{
const QMimeData* MimeData = Event->mimeData();
foreach (const QUrl &Url, MimeData->urls())
for (const QUrl& Url : MimeData->urls())
if (OpenProject(Url.toLocalFile()))
break;
}

View file

@ -1,6 +1,7 @@
#include "lc_global.h"
#include "lc_model.h"
#include <locale.h>
#include <functional>
#include "piece.h"
#include "camera.h"
#include "light.h"
@ -63,7 +64,7 @@ void lcModelProperties::SaveLDraw(QTextStream& Stream) const
if (!mComments.isEmpty())
{
QStringList Comments = mComments.split('\n');
foreach (const QString& Comment, Comments)
for (const QString& Comment : Comments)
Stream << QLatin1String("0 !LEOCAD MODEL COMMENT ") << Comment << LineEnding;
}

View file

@ -67,7 +67,7 @@ void lcPartSelectionListModel::ClearRequests()
{
lcPiecesLibrary* Library = lcGetPiecesLibrary();
foreach(int RequestIdx, mRequestedPreviews)
for (int RequestIdx : mRequestedPreviews)
{
PieceInfo* Info = mParts[RequestIdx].first;
Library->ReleasePieceInfo(Info);

View file

@ -183,7 +183,7 @@ bool lcMouseShortcuts::Load(const QStringList& Shortcuts)
{
memset(mShortcuts, 0, sizeof(mShortcuts));
foreach (const QString& Shortcut, Shortcuts)
for (const QString& Shortcut : Shortcuts)
{
int Equals = Shortcut.indexOf('=');

View file

@ -313,7 +313,7 @@ void lcTimelineWidget::MoveSelection()
QList<QTreeWidgetItem*> SelectedItems = selectedItems();
foreach(QTreeWidgetItem* PieceItem, SelectedItems)
for (QTreeWidgetItem* PieceItem : SelectedItems)
{
QTreeWidgetItem* Parent = PieceItem->parent();
@ -350,7 +350,7 @@ void lcTimelineWidget::ItemSelectionChanged()
lcArray<lcObject*> Selection;
lcStep LastStep = 1;
foreach (QTreeWidgetItem* PieceItem, selectedItems())
for (QTreeWidgetItem* PieceItem : selectedItems())
{
lcPiece* Piece = (lcPiece*)PieceItem->data(0, Qt::UserRole).value<uintptr_t>();
if (Piece)

View file

@ -71,7 +71,7 @@ void PieceInfo::SetModel(lcModel* Model, bool UpdateMesh, Project* CurrentProjec
{
lcMemFile PieceFile;
foreach(const QString& Line, MeshLines)
for (const QString& Line : MeshLines)
{
QByteArray Buffer = Line.toLatin1();
PieceFile.WriteBuffer(Buffer.constData(), Buffer.size());