From e2405dd63fae0eb6c3b6feb0d2979ab4bf1a64d2 Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Fri, 20 Mar 2015 10:36:16 +0100 Subject: QStateMachine: replaced Q_FOREACH with foreach. Change-Id: I2bd0f9d7ef1d6f236e2afa9fc5b75c5a6f61a250 Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/statemachine/qstatemachine.cpp | 32 +++++++++++++++--------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'src') diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index eec3febbfe..dd0ba9260e 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -198,7 +198,7 @@ static inline bool isDescendant(const QAbstractState *state1, const QAbstractSta static bool containsDecendantOf(const QSet &states, const QAbstractState *node) { - Q_FOREACH (QAbstractState *s, states) + foreach (QAbstractState *s, states) if (isDescendant(s, node)) return true; @@ -490,11 +490,11 @@ void QStateMachinePrivate::removeConflictingTransitions(QList transitionsToRemove; QSet exitSetT1 = computeExitSet_Unordered(QList() << t1); - Q_FOREACH (QAbstractTransition *t2, filteredTransitions) { + foreach (QAbstractTransition *t2, filteredTransitions) { QSet exitSetT2 = computeExitSet_Unordered(QList() << t2); if (!exitSetT1.intersect(exitSetT2).isEmpty()) { if (isDescendant(t1->sourceState(), t2->sourceState())) { @@ -506,7 +506,7 @@ void QStateMachinePrivate::removeConflictingTransitions(QList QStateMachinePrivate::computeExitSet_Unordered(const QList Q_ASSERT(domain != 0); } - Q_FOREACH (QAbstractState* s, configuration) { + foreach (QAbstractState* s, configuration) { if (isDescendant(s, domain)) statesToExit.insert(s); } @@ -685,14 +685,14 @@ QList QStateMachinePrivate::computeEntrySet(const QList statesToEnter; if (pendingErrorStates.isEmpty()) { - Q_FOREACH (QAbstractTransition *t, enabledTransitions) { - Q_FOREACH (QAbstractState *s, t->targetStates()) { + foreach (QAbstractTransition *t, enabledTransitions) { + foreach (QAbstractState *s, t->targetStates()) { addDescendantStatesToEnter(s, statesToEnter, statesForDefaultEntry); } QList effectiveTargetStates = getEffectiveTargetStates(t).toList(); QAbstractState *ancestor = getTransitionDomain(t, effectiveTargetStates); - Q_FOREACH (QAbstractState *s, effectiveTargetStates) { + foreach (QAbstractState *s, effectiveTargetStates) { addAncestorStatesToEnter(s, ancestor, statesToEnter, statesForDefaultEntry); } } @@ -738,7 +738,7 @@ QAbstractState *QStateMachinePrivate::getTransitionDomain(QAbstractTransition *t if (QState *tSource = t->sourceState()) { if (isCompound(tSource)) { bool allDescendants = true; - Q_FOREACH (QAbstractState *s, effectiveTargetStates) { + foreach (QAbstractState *s, effectiveTargetStates) { if (!isDescendant(s, tSource)) { allDescendants = false; break; @@ -970,9 +970,9 @@ void QStateMachinePrivate::addDescendantStatesToEnter(QAbstractState *state, if (QHistoryState *h = toHistoryState(state)) { QList historyConfiguration = QHistoryStatePrivate::get(h)->configuration; if (!historyConfiguration.isEmpty()) { - Q_FOREACH (QAbstractState *s, historyConfiguration) + foreach (QAbstractState *s, historyConfiguration) addDescendantStatesToEnter(s, statesToEnter, statesForDefaultEntry); - Q_FOREACH (QAbstractState *s, historyConfiguration) + foreach (QAbstractState *s, historyConfiguration) addAncestorStatesToEnter(s, state->parentState(), statesToEnter, statesForDefaultEntry); #ifdef QSTATEMACHINE_DEBUG @@ -988,9 +988,9 @@ void QStateMachinePrivate::addDescendantStatesToEnter(QAbstractState *state, if (defaultHistoryContent.isEmpty()) { setError(QStateMachine::NoDefaultStateInHistoryStateError, h); } else { - Q_FOREACH (QAbstractState *s, defaultHistoryContent) + foreach (QAbstractState *s, defaultHistoryContent) addDescendantStatesToEnter(s, statesToEnter, statesForDefaultEntry); - Q_FOREACH (QAbstractState *s, defaultHistoryContent) + foreach (QAbstractState *s, defaultHistoryContent) addAncestorStatesToEnter(s, state->parentState(), statesToEnter, statesForDefaultEntry); #ifdef QSTATEMACHINE_DEBUG qDebug() << q_func() << ": initial history targets for" << state << ':' << defaultHistoryContent; @@ -1021,7 +1021,7 @@ void QStateMachinePrivate::addDescendantStatesToEnter(QAbstractState *state, } } else if (isParallel(state)) { QState *grp = toStandardState(state); - Q_FOREACH (QAbstractState *child, QStatePrivate::get(grp)->childStates()) { + foreach (QAbstractState *child, QStatePrivate::get(grp)->childStates()) { if (!containsDecendantOf(statesToEnter, child)) addDescendantStatesToEnter(child, statesToEnter, statesForDefaultEntry); } @@ -1044,12 +1044,12 @@ void QStateMachinePrivate::addAncestorStatesToEnter(QAbstractState *s, QAbstract QSet &statesToEnter, QSet &statesForDefaultEntry) { - Q_FOREACH (QState *anc, getProperAncestors(s, ancestor)) { + foreach (QState *anc, getProperAncestors(s, ancestor)) { if (!anc->parentState()) continue; statesToEnter.insert(anc); if (isParallel(anc)) { - Q_FOREACH (QAbstractState *child, QStatePrivate::get(anc)->childStates()) { + foreach (QAbstractState *child, QStatePrivate::get(anc)->childStates()) { if (!containsDecendantOf(statesToEnter, child)) addDescendantStatesToEnter(child, statesToEnter, statesForDefaultEntry); } -- cgit v1.2.3