diff options
Diffstat (limited to 'dev-python/qtstatemachine/files/qstatemachines_fix_history.patch_001')
-rw-r--r-- | dev-python/qtstatemachine/files/qstatemachines_fix_history.patch_001 | 155 |
1 files changed, 0 insertions, 155 deletions
diff --git a/dev-python/qtstatemachine/files/qstatemachines_fix_history.patch_001 b/dev-python/qtstatemachine/files/qstatemachines_fix_history.patch_001 deleted file mode 100644 index fff31346..00000000 --- a/dev-python/qtstatemachine/files/qstatemachines_fix_history.patch_001 +++ /dev/null @@ -1,155 +0,0 @@ ---- src/qstatemachine_orig.cpp 2009-07-26 11:41:00.000000000 +0200 -+++ src/qstatemachine.cpp 2009-07-26 12:41:26.000000000 +0200 -@@ -455,37 +455,7 @@ - QtState *lca = findLCA(lst); - for (int j = 1; j < lst.size(); ++j) { - QtAbstractState *s = lst.at(j); -- if (QtHistoryState *h = qobject_cast<QtHistoryState*>(s)) { -- QList<QtAbstractState*> hconf = QtHistoryStatePrivate::get(h)->configuration; -- if (!hconf.isEmpty()) { -- for (int k = 0; k < hconf.size(); ++k) { -- QtAbstractState *s0 = hconf.at(k); -- addStatesToEnter(s0, lca, statesToEnter, statesForDefaultEntry); -- } --#ifdef QSTATEMACHINE_DEBUG -- qDebug() << q << ": restoring" -- << ((QtHistoryStatePrivate::get(h)->historyType == QtState::DeepHistory) ? "deep" : "shallow") -- << "history from" << s << ":" << hconf; --#endif -- } else { -- QList<QtAbstractState*> hlst; -- if (QtHistoryStatePrivate::get(h)->defaultState) -- hlst.append(QtHistoryStatePrivate::get(h)->defaultState); -- if (hlst.isEmpty()) { -- setError(QtStateMachine::NoDefaultStateInHistoryState, h); -- } else { -- for (int k = 0; k < hlst.size(); ++k) { -- QtAbstractState *s0 = hlst.at(k); -- addStatesToEnter(s0, lca, statesToEnter, statesForDefaultEntry); -- } --#ifdef QSTATEMACHINE_DEBUG -- qDebug() << q << ": initial history targets for" << s << ":" << hlst; --#endif -- } -- } -- } else { -- addStatesToEnter(s, lca, statesToEnter, statesForDefaultEntry); -- } -+ addStatesToEnter(s, lca, statesToEnter, statesForDefaultEntry); - if (isParallel(lca)) { - QList<QtAbstractState*> lcac = QtStatePrivate::get(lca)->childStates(); - foreach (QtAbstractState* child,lcac) { -@@ -566,45 +536,78 @@ - QSet<QtAbstractState*> &statesToEnter, - QSet<QtAbstractState*> &statesForDefaultEntry) - { -- statesToEnter.insert(s); -- if (isParallel(s)) { -- QtState *grp = qobject_cast<QtState*>(s); -- QList<QtAbstractState*> lst = QtStatePrivate::get(grp)->childStates(); -- for (int i = 0; i < lst.size(); ++i) { -- QtAbstractState *child = lst.at(i); -- addStatesToEnter(child, grp, statesToEnter, statesForDefaultEntry); -- } -- } else if (isCompound(s)) { -- statesForDefaultEntry.insert(s); -- QtState *grp = qobject_cast<QtState*>(s); -- QtAbstractState *initial = grp->initialState(); -- if (initial != 0) { -- addStatesToEnter(initial, grp, statesToEnter, statesForDefaultEntry); -+#ifdef QSTATEMACHINE_DEBUG -+ Q_Q(QtStateMachine); -+#endif -+ if (QtHistoryState *h = qobject_cast<QtHistoryState*>(s)) { -+ QList<QtAbstractState*> hconf = QtHistoryStatePrivate::get(h)->configuration; -+ if (!hconf.isEmpty()) { -+ for (int k = 0; k < hconf.size(); ++k) { -+ QtAbstractState *s0 = hconf.at(k); -+ addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry); -+ } -+#ifdef QSTATEMACHINE_DEBUG -+ qDebug() << q << ": restoring" -+ << ((QtHistoryStatePrivate::get(h)->historyType == QtState::DeepHistory) ? "deep" : "shallow") -+ << "history from" << s << ":" << hconf; -+#endif - } else { -- setError(QtStateMachine::NoInitialStateError, grp); -- return; -+ QList<QtAbstractState*> hlst; -+ if (QtHistoryStatePrivate::get(h)->defaultState) -+ hlst.append(QtHistoryStatePrivate::get(h)->defaultState); -+ if (hlst.isEmpty()) { -+ setError(QtStateMachine::NoDefaultStateInHistoryState, h); -+ } else { -+ for (int k = 0; k < hlst.size(); ++k) { -+ QtAbstractState *s0 = hlst.at(k); -+ addStatesToEnter(s0, root, statesToEnter, statesForDefaultEntry); -+ } -+#ifdef QSTATEMACHINE_DEBUG -+ qDebug() << q << ": initial history targets for" << s << ":" << hlst; -+#endif -+ } - } -- } -- QList<QtState*> ancs = properAncestors(s, root); -- for (int i = 0; i < ancs.size(); ++i) { -- QtState *anc = ancs.at(i); -- if (!anc->parentState()) -- continue; -- statesToEnter.insert(anc); -- if (isParallel(anc)) { -- QList<QtAbstractState*> lst = QtStatePrivate::get(anc)->childStates(); -- for (int j = 0; j < lst.size(); ++j) { -- QtAbstractState *child = lst.at(j); -- bool hasDescendantInList = false; -- QSet<QtAbstractState*>::const_iterator it; -- for (it = statesToEnter.constBegin(); it != statesToEnter.constEnd(); ++it) { -- if (isDescendantOf(*it, child)) { -- hasDescendantInList = true; -- break; -+ } else { -+ statesToEnter.insert(s); -+ if (isParallel(s)) { -+ QtState *grp = qobject_cast<QtState*>(s); -+ QList<QtAbstractState*> lst = QtStatePrivate::get(grp)->childStates(); -+ for (int i = 0; i < lst.size(); ++i) { -+ QtAbstractState *child = lst.at(i); -+ addStatesToEnter(child, grp, statesToEnter, statesForDefaultEntry); -+ } -+ } else if (isCompound(s)) { -+ statesForDefaultEntry.insert(s); -+ QtState *grp = qobject_cast<QtState*>(s); -+ QtAbstractState *initial = grp->initialState(); -+ if (initial != 0) { -+ addStatesToEnter(initial, grp, statesToEnter, statesForDefaultEntry); -+ } else { -+ setError(QtStateMachine::NoInitialStateError, grp); -+ return; -+ } -+ } -+ QList<QtState*> ancs = properAncestors(s, root); -+ for (int i = 0; i < ancs.size(); ++i) { -+ QtState *anc = ancs.at(i); -+ if (!anc->parentState()) -+ continue; -+ statesToEnter.insert(anc); -+ if (isParallel(anc)) { -+ QList<QtAbstractState*> lst = QtStatePrivate::get(anc)->childStates(); -+ for (int j = 0; j < lst.size(); ++j) { -+ QtAbstractState *child = lst.at(j); -+ bool hasDescendantInList = false; -+ QSet<QtAbstractState*>::const_iterator it; -+ for (it = statesToEnter.constBegin(); it != statesToEnter.constEnd(); ++it) { -+ if (isDescendantOf(*it, child)) { -+ hasDescendantInList = true; -+ break; -+ } - } -+ if (!hasDescendantInList) -+ addStatesToEnter(child, anc, statesToEnter, statesForDefaultEntry); - } -- if (!hasDescendantInList) -- addStatesToEnter(child, anc, statesToEnter, statesForDefaultEntry); - } - } - } |