From 795476c41a5d45009d3f3aaa00631a1e19bf02cf Mon Sep 17 00:00:00 2001 From: Erik Verbruggen Date: Tue, 14 Jul 2015 11:06:40 +0200 Subject: QStateMachine: remove left-over method. This method was probably there in older versions of the specification, but it is no longer used now. The only caller was in QStateMachinePrivate::setError, which has been changed to use the newer methods. Change-Id: Ic4961990d8d2c902676e63193d3f30ef427e6f0c Reviewed-by: Eskil Abrahamsen Blomfeldt --- src/corelib/statemachine/qstatemachine.cpp | 70 +++--------------------------- 1 file changed, 5 insertions(+), 65 deletions(-) (limited to 'src/corelib/statemachine/qstatemachine.cpp') diff --git a/src/corelib/statemachine/qstatemachine.cpp b/src/corelib/statemachine/qstatemachine.cpp index d1a98d96f5..335610dac6 100644 --- a/src/corelib/statemachine/qstatemachine.cpp +++ b/src/corelib/statemachine/qstatemachine.cpp @@ -1041,69 +1041,6 @@ void QStateMachinePrivate::enterStates(QEvent *event, const QList &statesToEnter, - QSet &statesForDefaultEntry) -{ - if (QHistoryState *h = toHistoryState(s)) { - QList hconf = QHistoryStatePrivate::get(h)->configuration; - if (!hconf.isEmpty()) { - for (int k = 0; k < hconf.size(); ++k) { - QAbstractState *s0 = hconf.at(k); - addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry); - } -#ifdef QSTATEMACHINE_DEBUG - qDebug() << q_func() << ": restoring" - << ((QHistoryStatePrivate::get(h)->historyType == QHistoryState::DeepHistory) ? "deep" : "shallow") - << "history from" << s << ':' << hconf; -#endif - } else { - QList hlst; - if (QHistoryStatePrivate::get(h)->defaultState) - hlst.append(QHistoryStatePrivate::get(h)->defaultState); - - if (hlst.isEmpty()) { - setError(QStateMachine::NoDefaultStateInHistoryStateError, h); - } else { - for (int k = 0; k < hlst.size(); ++k) { - QAbstractState *s0 = hlst.at(k); - addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry); - } -#ifdef QSTATEMACHINE_DEBUG - qDebug() << q_func() << ": initial history targets for" << s << ':' << hlst; -#endif - } - } - } else { - if (s == rootState()) { - // Error has already been set by exitStates(). - Q_ASSERT(error != QStateMachine::NoError); - return; - } - statesToEnter.insert(s); - if (isParallel(s)) { - QState *grp = toStandardState(s); - QList lst = QStatePrivate::get(grp)->childStates(); - for (int i = 0; i < lst.size(); ++i) { - QAbstractState *child = lst.at(i); - addStatesToEnter(child, grp, statesToEnter, statesForDefaultEntry); - } - } else if (isCompound(s)) { - statesForDefaultEntry.insert(s); - QState *grp = toStandardState(s); - QAbstractState *initial = grp->initialState(); - if (initial != 0) { - Q_ASSERT(initial->machine() == q_func()); - addStatesToEnter(initial, grp, statesToEnter, statesForDefaultEntry); - } else { - setError(QStateMachine::NoInitialStateError, grp); - return; - } - } - addAncestorStatesToEnter(s, root, statesToEnter, statesForDefaultEntry); - } -} - /* The algorithm as described in http://www.w3.org/TR/2014/WD-scxml-20140529/ has a bug. See * QTBUG-44963 for details. The algorithm here is as described in * http://www.w3.org/Voice/2013/scxml-irp/SCXML.htm as of Friday March 13, 2015. @@ -1545,8 +1482,11 @@ void QStateMachinePrivate::setError(QStateMachine::Error errorCode, QAbstractSta #ifdef QSTATEMACHINE_DEBUG qDebug() << q << ": entering error state" << currentErrorState << "from" << currentContext; #endif - QState *lca = findLCA(QList() << currentErrorState << currentContext); - addStatesToEnter(currentErrorState, lca, pendingErrorStates, pendingErrorStatesForDefaultEntry); + pendingErrorStates.insert(currentErrorState); + addDescendantStatesToEnter(currentErrorState, pendingErrorStates, pendingErrorStatesForDefaultEntry); + addAncestorStatesToEnter(currentErrorState, rootState(), pendingErrorStates, pendingErrorStatesForDefaultEntry); + foreach (QAbstractState *s, configuration) + pendingErrorStates.remove(s); } else { qWarning("Unrecoverable error detected in running state machine: %s", qPrintable(errorString)); -- cgit v1.2.3