From bab91d04a5c7e3f77b4c1823225039b49c7d2cbc Mon Sep 17 00:00:00 2001 From: John Fultz Date: Thu, 10 Jan 2019 23:53:58 -0600 Subject: C++11-style iterators in quacker sources. --- quacker/view.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'quacker/view.cpp') diff --git a/quacker/view.cpp b/quacker/view.cpp index f7c2e09..13cf514 100644 --- a/quacker/view.cpp +++ b/quacker/view.cpp @@ -50,19 +50,19 @@ void View::positionChanged(const Quackle::GamePosition &position) void View::movesChanged(const Quackle::MoveList &moves) { - for (QList::iterator it = m_subviews.begin(); it != m_subviews.end(); ++it) - (*it)->movesChanged(moves); + for (auto& it : m_subviews) + it->movesChanged(moves); } void View::connectSubviewSignals() { - for (QList::iterator it = m_subviews.begin(); it != m_subviews.end(); ++it) + for (auto& it : m_subviews) { - connect(*it, SIGNAL(statusMessage(const QString &)), this, SIGNAL(statusMessage(const QString &))); - connect(*it, SIGNAL(setCandidateMove(const Quackle::Move &)), this, SIGNAL(setCandidateMove(const Quackle::Move &))); - connect(*it, SIGNAL(removeCandidateMoves(const Quackle::MoveList &)), this, SIGNAL(removeCandidateMoves(const Quackle::MoveList &))); - connect(*it, SIGNAL(commit()), this, SIGNAL(commit())); - connect(*it, SIGNAL(setRack(const Quackle::Rack &)), this, SIGNAL(setRack(const Quackle::Rack &))); + connect(it, SIGNAL(statusMessage(const QString &)), this, SIGNAL(statusMessage(const QString &))); + connect(it, SIGNAL(setCandidateMove(const Quackle::Move &)), this, SIGNAL(setCandidateMove(const Quackle::Move &))); + connect(it, SIGNAL(removeCandidateMoves(const Quackle::MoveList &)), this, SIGNAL(removeCandidateMoves(const Quackle::MoveList &))); + connect(it, SIGNAL(commit()), this, SIGNAL(commit())); + connect(it, SIGNAL(setRack(const Quackle::Rack &)), this, SIGNAL(setRack(const Quackle::Rack &))); } } -- cgit v1.2.3