summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Kobus <jaroslaw.kobus@theqtcompany.com>2015-12-15 11:51:47 +0100
committerErik Verbruggen <erik.verbruggen@theqtcompany.com>2015-12-16 10:21:02 +0000
commit6f021028eedad2a5b1ce71b09a42b34df8aad81b (patch)
tree6a25d4a3fa77e013b10c6d95c9cf93c09ca15b66
parent43fff6e7b01412a38f38862ccb4d0644754dcc78 (diff)
Rename activeStates() into activeStateNames(), make it const
Change-Id: I5f71f24e9c989cad7399221c0e1a59328aadad77 Reviewed-by: Erik Verbruggen <erik.verbruggen@theqtcompany.com>
-rw-r--r--src/scxml/qscxmlstatemachine.cpp14
-rw-r--r--src/scxml/qscxmlstatemachine.h2
-rw-r--r--tests/auto/scion/tst_scion.cpp2
3 files changed, 9 insertions, 9 deletions
diff --git a/src/scxml/qscxmlstatemachine.cpp b/src/scxml/qscxmlstatemachine.cpp
index a667e6a..929d72a 100644
--- a/src/scxml/qscxmlstatemachine.cpp
+++ b/src/scxml/qscxmlstatemachine.cpp
@@ -565,7 +565,7 @@ void QScxmlInternal::WrappedQStateMachine::beginMicrostep(QEvent *event)
Q_D(WrappedQStateMachine);
qCDebug(qscxmlLog) << d->m_stateMachine
- << "started microstep from state" << d->m_stateMachine->activeStates()
+ << "started microstep from state" << d->m_stateMachine->activeStateNames()
<< "with event" << stateMachinePrivate()->m_event.name()
<< "and event type" << event->type();
}
@@ -576,7 +576,7 @@ void QScxmlInternal::WrappedQStateMachine::endMicrostep(QEvent *event)
Q_UNUSED(event);
qCDebug(qscxmlLog) << d->m_stateMachine
- << "finished microstep in state (" << d->m_stateMachine->activeStates() << ")";
+ << "finished microstep in state (" << d->m_stateMachine->activeStateNames() << ")";
}
// This is a slightly modified copy of QStateMachinePrivate::event()
@@ -621,13 +621,13 @@ bool QScxmlInternal::WrappedQStateMachine::event(QEvent *e)
void QScxmlInternal::WrappedQStateMachinePrivate::noMicrostep()
{
qCDebug(qscxmlLog) << m_stateMachine
- << "had no transition, stays in state (" << m_stateMachine->activeStates() << ")";
+ << "had no transition, stays in state (" << m_stateMachine->activeStateNames() << ")";
}
void QScxmlInternal::WrappedQStateMachinePrivate::processedPendingEvents(bool didChange)
{
qCDebug(qscxmlLog) << m_stateMachine << "finishedPendingEvents" << didChange << "in state ("
- << m_stateMachine->activeStates() << ")";
+ << m_stateMachine->activeStateNames() << ")";
emit m_stateMachine->reachedStableState(didChange);
}
@@ -638,7 +638,7 @@ void QScxmlInternal::WrappedQStateMachinePrivate::beginMacrostep()
void QScxmlInternal::WrappedQStateMachinePrivate::endMacrostep(bool didChange)
{
qCDebug(qscxmlLog) << m_stateMachine << "endMacrostep" << didChange
- << "in state (" << m_stateMachine->activeStates() << ")";
+ << "in state (" << m_stateMachine->activeStateNames() << ")";
{ // handle <invoke>s
QVector<QScxmlState*> &sti = stateMachinePrivate()->m_statesToInvoke;
@@ -793,9 +793,9 @@ int QScxmlInternal::WrappedQStateMachinePrivate::eventIdForDelayedEvent(const QS
* is true (the default), these parent states will be filtered out and only the "leaf states" will
* be returned. Passing in false for \a compress will return the full list of active states.
*/
-QStringList QScxmlStateMachine::activeStates(bool compress)
+QStringList QScxmlStateMachine::activeStateNames(bool compress) const
{
- Q_D(QScxmlStateMachine);
+ Q_D(const QScxmlStateMachine);
QSet<QAbstractState *> config = QStateMachinePrivate::get(d->m_qStateMachine)->configuration;
if (compress)
diff --git a/src/scxml/qscxmlstatemachine.h b/src/scxml/qscxmlstatemachine.h
index fa32896..b90b716 100644
--- a/src/scxml/qscxmlstatemachine.h
+++ b/src/scxml/qscxmlstatemachine.h
@@ -93,7 +93,7 @@ public:
bool isRunning() const;
QString name() const;
- QStringList activeStates(bool compress = true);
+ QStringList activeStateNames(bool compress = true) const;
bool isActive(const QString &scxmlStateName) const;
using QObject::connect;
diff --git a/tests/auto/scion/tst_scion.cpp b/tests/auto/scion/tst_scion.cpp
index 93fcd8b..29fb441 100644
--- a/tests/auto/scion/tst_scion.cpp
+++ b/tests/auto/scion/tst_scion.cpp
@@ -282,7 +282,7 @@ void TestScion::compiled()
static bool verifyStates(QScxmlStateMachine *stateMachine, const QJsonObject &stateDescription, const QString &key, int counter)
{
- auto current = stateMachine->activeStates();
+ auto current = stateMachine->activeStateNames();
std::sort(current.begin(), current.end());
auto expected = getStates(stateDescription, key);
if (current == expected)