Commit 0dd5f681 authored by Marco Bubke's avatar Marco Bubke

QmlDesigner: Rename actualState in currentState

Change-Id: I49f80126a3fc0184a3b18352ed2adc24e50040c7
Reviewed-by: default avatarThomas Hartmann <Thomas.Hartmann@digia.com>
parent c3be93f2
......@@ -51,7 +51,7 @@ protected:
void startRenderTimer() Q_DECL_OVERRIDE;
private:
ServerNodeInstance m_actualState;
ServerNodeInstance m_currentState;
};
} // namespace QmlDesigner
......
......@@ -51,7 +51,7 @@ protected:
void startRenderTimer();
private:
ServerNodeInstance m_actualState;
ServerNodeInstance m_currentState;
};
} // namespace QmlDesigner
......
......@@ -154,7 +154,7 @@ public:
setupContext();
}
virtual void actualStateChanged(const ModelNode &) QTC_OVERRIDE
virtual void currentStateChanged(const ModelNode &) QTC_OVERRIDE
{
setupContext();
}
......
......@@ -63,7 +63,7 @@ bool SelectionContext::singleNodeIsSelected() const
bool SelectionContext::isInBaseState() const
{
return QmlModelState(view()->actualStateNode()).isBaseState();
return QmlModelState(view()->currentStateNode()).isBaseState();
}
ModelNode SelectionContext::currentSingleSelectedNode() const
......
......@@ -386,7 +386,7 @@ void DebugView::instancesToken(const QString &/*tokenName*/, int /*tokenNumber*/
}
void DebugView::actualStateChanged(const ModelNode &/*node*/)
void DebugView::currentStateChanged(const ModelNode &/*node*/)
{
}
......
......@@ -90,7 +90,7 @@ public:
void nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange) QTC_OVERRIDE;
void nodeAboutToBeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, PropertyChangeFlags propertyChange) QTC_OVERRIDE;
void instancesToken(const QString &tokenName, int tokenNumber, const QVector<ModelNode> &nodeVector) QTC_OVERRIDE;
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void nodeOrderChanged(const NodeListProperty &listProperty, const ModelNode &movedNode, int oldIndex) QTC_OVERRIDE;
protected:
......
......@@ -619,7 +619,7 @@ bool FormEditorView::isMoveToolAvailable() const
return true;
}
void FormEditorView::actualStateChanged(const ModelNode &/*node*/)
void FormEditorView::currentStateChanged(const ModelNode &/*node*/)
{
}
......
......@@ -123,7 +123,7 @@ public:
double spacing() const;
void deActivateItemCreator();
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void nodeRemoved(const ModelNode &removedNode, const NodeAbstractProperty &parentProperty, PropertyChangeFlags propertyChange) QTC_OVERRIDE;
void nodeAboutToBeReparented(const ModelNode &node, const NodeAbstractProperty &newPropertyParent, const NodeAbstractProperty &oldPropertyParent, PropertyChangeFlags propertyChange) QTC_OVERRIDE;
......
......@@ -178,7 +178,7 @@ void FormEditorWidget::changeRootItemHeight(const QString &heighText)
void FormEditorWidget::resetNodeInstanceView()
{
m_formEditorView->setAcutalStateNode(m_formEditorView->rootModelNode());
m_formEditorView->setCurrentStateNode(m_formEditorView->rootModelNode());
m_formEditorView->emitCustomNotification(QLatin1String("reset QmlPuppet"));
}
......
......@@ -277,7 +277,7 @@ void MoveManipulator::update(const QPointF& updatePoint, Snapper::Snapping useSn
continue;
// don't support anchors for base state because it is not needed by the droptool
if (stateToBeManipulated == UseActualState) {
if (stateToBeManipulated == UseCurrentState) {
QmlAnchors anchors(item->qmlItemNode().anchors());
if (anchors.instanceHasAnchor(AnchorLine::Top))
......
......@@ -50,7 +50,7 @@ class MoveManipulator
{
public:
enum State {
UseActualState,
UseCurrentState,
UseBaseState
};
......@@ -62,7 +62,7 @@ public:
void synchronizeParent(const QList<FormEditorItem*> &itemList, const ModelNode &parentNode);
void begin(const QPointF& beginPoint);
void update(const QPointF& updatePoint, Snapper::Snapping useSnapping, State stateToBeManipulated = UseActualState);
void update(const QPointF& updatePoint, Snapper::Snapping useSnapping, State stateToBeManipulated = UseCurrentState);
void reparentTo(FormEditorItem *newParent);
void end();
void end(Snapper::Snapping useSnapping);
......
......@@ -96,7 +96,7 @@ void MoveTool::mouseMoveEvent(const QList<QGraphicsItem*> &itemList,
FormEditorItem *containerItem = containerFormEditorItem(itemList, m_movingItems);
if (containerItem
&& QmlModelState::isBaseState(view()->actualStateNode())) {
&& QmlModelState::isBaseState(view()->currentStateNode())) {
if (containerItem != m_movingItems.first()->parentItem()
&& event->modifiers().testFlag(Qt::ShiftModifier)) {
m_moveManipulator.reparentTo(containerItem);
......
......@@ -202,7 +202,7 @@ void ComponentView::nodeSourceChanged(const ModelNode &, const QString & /*newNo
void ComponentView::rewriterBeginTransaction() {}
void ComponentView::rewriterEndTransaction() {}
void ComponentView::actualStateChanged(const ModelNode &/*node*/) {}
void ComponentView::currentStateChanged(const ModelNode &/*node*/) {}
void ComponentView::selectedNodesChanged(const QList<ModelNode> &/*selectedNodeList*/,
const QList<ModelNode> &/*lastSelectedNodeList*/) {}
......
......@@ -95,7 +95,7 @@ public:
void rewriterBeginTransaction() QTC_OVERRIDE;
void rewriterEndTransaction() QTC_OVERRIDE;
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList) QTC_OVERRIDE;
......
......@@ -119,7 +119,7 @@ void DesignDocumentView::rewriterEndTransaction()
{
}
void DesignDocumentView::actualStateChanged(const ModelNode &/*node*/)
void DesignDocumentView::currentStateChanged(const ModelNode &/*node*/)
{
}
......
......@@ -79,7 +79,7 @@ public:
void rewriterBeginTransaction();
void rewriterEndTransaction();
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports) QTC_OVERRIDE;
......
......@@ -203,7 +203,7 @@ void ItemLibraryView::rewriterEndTransaction()
{
}
void ItemLibraryView::actualStateChanged(const ModelNode &/*node*/)
void ItemLibraryView::currentStateChanged(const ModelNode &/*node*/)
{
}
......
......@@ -98,7 +98,7 @@ public:
void rewriterBeginTransaction() QTC_OVERRIDE;
void rewriterEndTransaction() QTC_OVERRIDE;
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void setResourcePath(const QString &resourcePath);
......
......@@ -275,7 +275,7 @@ void NavigatorView::rewriterEndTransaction()
{
}
void NavigatorView::actualStateChanged(const ModelNode &/*node*/)
void NavigatorView::currentStateChanged(const ModelNode &/*node*/)
{
}
......
......@@ -96,7 +96,7 @@ public:
void rewriterBeginTransaction() QTC_OVERRIDE;
void rewriterEndTransaction() QTC_OVERRIDE;
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void instancesToken(const QString &tokenName, int tokenNumber, const QVector<ModelNode> &nodeVector) QTC_OVERRIDE;
......
......@@ -738,7 +738,7 @@ void PropertyEditor::resetView()
NodeType *type = m_typeHash.value(qmlFile.toString());
QString currentStateName = QmlModelState::isValidQmlModelState(actualStateNode()) ? QmlModelState(actualStateNode()).name() : QLatin1String("invalid state");
QString currentStateName = QmlModelState::isValidQmlModelState(currentStateNode()) ? QmlModelState(currentStateNode()).name() : QLatin1String("invalid state");
if (!type) {
type = new NodeType(this);
......@@ -961,7 +961,7 @@ WidgetInfo PropertyEditor::widgetInfo()
return createWidgetInfo(m_stackedWidget, 0, QLatin1String("Properties"), WidgetInfo::RightPane, 0);
}
void PropertyEditor::actualStateChanged(const ModelNode &node)
void PropertyEditor::currentStateChanged(const ModelNode &node)
{
QmlModelState newQmlModelState(node);
Q_ASSERT(newQmlModelState.isValid());
......
......@@ -107,7 +107,7 @@ public:
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList) QTC_OVERRIDE;
void resetView();
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void instancePropertyChange(const QList<QPair<ModelNode, PropertyName> > &propertyList) QTC_OVERRIDE;
void nodeCreated(const ModelNode &createdNode) QTC_OVERRIDE;
......
......@@ -247,7 +247,7 @@ void StatesEditorView::duplicateCurrentState()
QmlModelState StatesEditorView::currentState() const
{
return QmlModelState(actualStateNode());
return QmlModelState(currentStateNode());
}
void StatesEditorView::setCurrentState(const QmlModelState &state)
......@@ -255,8 +255,8 @@ void StatesEditorView::setCurrentState(const QmlModelState &state)
if (!model() && !state.isValid())
return;
if (actualStateNode() != state.modelNode())
setAcutalStateNode(state.modelNode());
if (currentStateNode() != state.modelNode())
setCurrentStateNode(state.modelNode());
}
QmlModelState StatesEditorView::baseState() const
......@@ -383,7 +383,7 @@ void StatesEditorView::nodeOrderChanged(const NodeListProperty &listProperty, co
resetModel();
}
void StatesEditorView::actualStateChanged(const ModelNode &node)
void StatesEditorView::currentStateChanged(const ModelNode &node)
{
QmlModelState newQmlModelState(node);
......
......@@ -77,7 +77,7 @@ public:
// AbstractView
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void scriptFunctionsChanged(const ModelNode &node, const QStringList &scriptFunctionList) QTC_OVERRIDE;
void nodeIdChanged(const ModelNode &node, const QString &newId, const QString &oldId) QTC_OVERRIDE;
......
......@@ -210,7 +210,7 @@ public:
virtual void rewriterBeginTransaction() = 0;
virtual void rewriterEndTransaction() = 0;
virtual void actualStateChanged(const ModelNode &node) = 0; // base state is a invalid model node
virtual void currentStateChanged(const ModelNode &node) = 0; // base state is a invalid model node
virtual void selectedNodesChanged(const QList<ModelNode> &selectedNodeList,
const QList<ModelNode> &lastSelectedNodeList) = 0;
......@@ -233,8 +233,8 @@ public:
NodeInstanceView *nodeInstanceView() const;
RewriterView *rewriterView() const;
void setAcutalStateNode(const ModelNode &node);
ModelNode actualStateNode() const;
void setCurrentStateNode(const ModelNode &node);
ModelNode currentStateNode() const;
int majorQtQuickVersion() const;
......
......@@ -119,7 +119,7 @@ public:
void rewriterBeginTransaction() QTC_OVERRIDE;
void rewriterEndTransaction() QTC_OVERRIDE;
void actualStateChanged(const ModelNode &node);
void currentStateChanged(const ModelNode &node);
QList<NodeInstance> instances() const;
NodeInstance instanceForModelNode(const ModelNode &node) const ;
......
......@@ -151,7 +151,7 @@ public:
void rewriterBeginTransaction() QTC_OVERRIDE;
void rewriterEndTransaction() QTC_OVERRIDE;
void actualStateChanged(const ModelNode &node) QTC_OVERRIDE;
void currentStateChanged(const ModelNode &node) QTC_OVERRIDE;
void importsChanged(const QList<Import> &addedImports, const QList<Import> &removedImports) QTC_OVERRIDE;
......
......@@ -159,7 +159,7 @@ void NodeInstanceView::modelAttached(Model *model)
if (!isSkippedRootNode(rootModelNode()))
nodeInstanceServer()->createScene(createCreateSceneCommand());
ModelNode stateNode = actualStateNode();
ModelNode stateNode = currentStateNode();
if (stateNode.isValid() && stateNode.metaInfo().isSubclassOf("QtQuick.State", 1, 0)) {
NodeInstance newStateInstance = instanceForModelNode(stateNode);
activateState(newStateInstance);
......@@ -203,7 +203,7 @@ void NodeInstanceView::restartProcess()
if (!isSkippedRootNode(rootModelNode()))
nodeInstanceServer()->createScene(createCreateSceneCommand());
ModelNode stateNode = actualStateNode();
ModelNode stateNode = currentStateNode();
if (stateNode.isValid() && stateNode.metaInfo().isSubclassOf("QtQuick.State", 1, 0)) {
NodeInstance newStateInstance = instanceForModelNode(stateNode);
activateState(newStateInstance);
......@@ -539,7 +539,7 @@ void NodeInstanceView::rewriterEndTransaction()
}
void NodeInstanceView::actualStateChanged(const ModelNode &node)
void NodeInstanceView::currentStateChanged(const ModelNode &node)
{
NodeInstance newStateInstance = instanceForModelNode(node);
......
......@@ -515,11 +515,11 @@ void AbstractView::emitRewriterEndTransaction()
model()->d->notifyRewriterEndTransaction();
}
void AbstractView::setAcutalStateNode(const ModelNode &node)
void AbstractView::setCurrentStateNode(const ModelNode &node)
{
Internal::WriteLocker locker(m_model.data());
if (model())
model()->d->notifyActualStateChanged(node);
model()->d->notifyCurrentStateChanged(node);
}
void AbstractView::changeRootNodeType(const TypeName &type, int majorVersion, int minorVersion)
......@@ -529,10 +529,10 @@ void AbstractView::changeRootNodeType(const TypeName &type, int majorVersion, in
m_model.data()->d->changeRootNodeType(type, majorVersion, minorVersion);
}
ModelNode AbstractView::actualStateNode() const
ModelNode AbstractView::currentStateNode() const
{
if (model())
return ModelNode(m_model.data()->d->actualStateNode(), m_model.data(), const_cast<AbstractView*>(this));
return ModelNode(m_model.data()->d->currentStateNode(), m_model.data(), const_cast<AbstractView*>(this));
return ModelNode();
}
......
......@@ -84,7 +84,7 @@ ModelPrivate::ModelPrivate(Model *model) :
m_internalIdCounter(1)
{
m_rootInternalNode = createNode("QtQuick.Item", 1, 0, PropertyListType(), PropertyListType(), QString(), ModelNode::NodeWithoutSource,true);
m_acutalStateNode = m_rootInternalNode;
m_currentStateNode = m_rootInternalNode;
}
ModelPrivate::~ModelPrivate()
......@@ -574,16 +574,16 @@ void ModelPrivate::notifyInstancesChildrenChanged(const QVector<ModelNode> &node
resetModelByRewriter(description);
}
void ModelPrivate::notifyActualStateChanged(const ModelNode &node)
void ModelPrivate::notifyCurrentStateChanged(const ModelNode &node)
{
bool resetModel = false;
QString description;
m_acutalStateNode = node.internalNode();
m_currentStateNode = node.internalNode();
try {
if (rewriterView())
rewriterView()->actualStateChanged(ModelNode(node.internalNode(), model(), rewriterView()));
rewriterView()->currentStateChanged(ModelNode(node.internalNode(), model(), rewriterView()));
} catch (RewritingException &e) {
description = e.description();
resetModel = true;
......@@ -591,11 +591,11 @@ void ModelPrivate::notifyActualStateChanged(const ModelNode &node)
foreach (const QWeakPointer<AbstractView> &view, m_viewList) {
Q_ASSERT(view != 0);
view->actualStateChanged(ModelNode(node.internalNode(), model(), view.data()));
view->currentStateChanged(ModelNode(node.internalNode(), model(), view.data()));
}
if (nodeInstanceView())
nodeInstanceView()->actualStateChanged(ModelNode(node.internalNode(), model(), nodeInstanceView()));
nodeInstanceView()->currentStateChanged(ModelNode(node.internalNode(), model(), nodeInstanceView()));
if (resetModel)
resetModelByRewriter(description);
......@@ -1641,9 +1641,9 @@ bool ModelPrivate::isWriteLocked() const
return m_writeLock;
}
InternalNode::Pointer ModelPrivate::actualStateNode() const
InternalNode::Pointer ModelPrivate::currentStateNode() const
{
return m_acutalStateNode;
return m_currentStateNode;
}
......
......@@ -158,7 +158,7 @@ public:
void notifyInstancesChildrenChanged(const QVector<ModelNode> &nodeList);
void notifyInstanceToken(const QString &token, int number, const QVector<ModelNode> &nodeVector);
void notifyActualStateChanged(const ModelNode &node);
void notifyCurrentStateChanged(const ModelNode &node);
void notifyRewriterBeginTransaction();
void notifyRewriterEndTransaction();
......@@ -221,7 +221,7 @@ public:
void setNodeInstanceView(NodeInstanceView *nodeInstanceView);
NodeInstanceView *nodeInstanceView() const;
InternalNodePointer actualStateNode() const;
InternalNodePointer currentStateNode() const;
private: //functions
void removePropertyWithoutNotification(const InternalPropertyPointer &property);
......@@ -241,7 +241,7 @@ private:
QHash<QString,InternalNodePointer> m_idNodeHash;
QHash<qint32, InternalNodePointer> m_internalIdNodeHash;
QSet<InternalNodePointer> m_nodeSet;
InternalNodePointer m_acutalStateNode;
InternalNodePointer m_currentStateNode;
InternalNodePointer m_rootInternalNode;
QUrl m_fileUrl;
QWeakPointer<RewriterView> m_rewriterView;
......
......@@ -155,7 +155,7 @@ QmlItemNode QmlItemNode::createQmlItemNode(AbstractView *view, const ItemLibrary
newQmlItemNode.setId(view->generateNewId("image"));
if (!QmlModelState(view->actualStateNode()).isBaseState()) {
if (!QmlModelState(view->currentStateNode()).isBaseState()) {
newQmlItemNode.modelNode().variantProperty("opacity").setValue(0);
newQmlItemNode.setVariantProperty("opacity", 1);
}
......@@ -221,7 +221,7 @@ QmlItemNode QmlItemNode::createQmlItemNodeFromImage(AbstractView *view, const QS
newQmlItemNode.setId(view->generateNewId("image"));
if (!QmlModelState(view->actualStateNode()).isBaseState()) {
if (!QmlModelState(view->currentStateNode()).isBaseState()) {
newQmlItemNode.modelNode().variantProperty("opacity").setValue(0);
newQmlItemNode.setVariantProperty("opacity", 1);
}
......
......@@ -77,7 +77,7 @@ void QmlObjectNode::setBindingProperty(const PropertyName &name, const QString &
QmlModelState QmlObjectNode::currentState() const
{
if (isValid())
return QmlModelState(view()->actualStateNode());
return QmlModelState(view()->currentStateNode());
else
return QmlModelState();
}
......
......@@ -442,7 +442,7 @@ void RewriterView::rewriterEndTransaction()
}
}
void RewriterView::actualStateChanged(const ModelNode & /*node*/)
void RewriterView::currentStateChanged(const ModelNode & /*node*/)
{
}
......
......@@ -67,7 +67,7 @@ void ViewManager::detachRewriterView()
void ViewManager::switchStateEditorViewToBaseState()
{
if (m_statesEditorView.isAttached()) {
m_savedState = QmlModelState(m_statesEditorView.actualStateNode());
m_savedState = QmlModelState(m_statesEditorView.currentStateNode());
m_statesEditorView.setCurrentState(m_statesEditorView.baseState());
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment