mirror of
https://github.com/leozide/leocad
synced 2024-11-17 07:47:55 +01:00
Removed calls to foreach.
This commit is contained in:
parent
10491629b7
commit
172528ac1f
6 changed files with 8 additions and 7 deletions
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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('=');
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
|
|
@ -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());
|
||||
|
|
Loading…
Reference in a new issue