QmlDesigner: Cleanup

Change-Id: I571325fd98ed555abc19f87ac8a164d7e0c76288
Reviewed-by: Tim Jenssen <tim.jenssen@theqtcompany.com>
This commit is contained in:
Thomas Hartmann
2015-07-08 15:24:08 +02:00
committed by Thomas Hartmann
parent 94eff1ddae
commit acac9cb89a
7 changed files with 12 additions and 13 deletions

View File

@@ -125,7 +125,7 @@ NodeInstance &NodeInstance::operator=(const NodeInstance &other)
ModelNode NodeInstance::modelNode() const ModelNode NodeInstance::modelNode() const
{ {
if (d) if (d)
return d->modelNode; return d->modelNode;
else else
return ModelNode(); return ModelNode();
} }
@@ -170,7 +170,7 @@ void NodeInstance::setY(double y)
bool NodeInstance::hasAnchors() const bool NodeInstance::hasAnchors() const
{ {
return hasAnchor("anchors.fill") return hasAnchor("anchors.fill")
|| hasAnchor("anchors.centerIn") || hasAnchor("anchors.centerIn")
|| hasAnchor("anchors.top") || hasAnchor("anchors.top")
|| hasAnchor("anchors.left") || hasAnchor("anchors.left")
@@ -206,7 +206,7 @@ void NodeInstance::makeInvalid()
QRectF NodeInstance::boundingRect() const QRectF NodeInstance::boundingRect() const
{ {
if (isValid()) if (isValid())
return d->boundingRect; return d->boundingRect;
else else
return QRectF(); return QRectF();
} }
@@ -214,7 +214,7 @@ QRectF NodeInstance::boundingRect() const
QRectF NodeInstance::contentItemBoundingRect() const QRectF NodeInstance::contentItemBoundingRect() const
{ {
if (isValid()) if (isValid())
return d->contentItemBoundingRect; return d->contentItemBoundingRect;
else else
return QRectF(); return QRectF();
} }

View File

@@ -188,7 +188,7 @@ void NodeInstanceView::handleChrash()
if (elaspsedTimeSinceLastCrash > 2000) if (elaspsedTimeSinceLastCrash > 2000)
restartProcess(); restartProcess();
else else
emit qmlPuppetCrashed(); emit qmlPuppetCrashed();
emitCustomNotification(QStringLiteral("puppet crashed")); emitCustomNotification(QStringLiteral("puppet crashed"));
} }

View File

@@ -353,7 +353,6 @@ QProcessEnvironment PuppetCreator::processEnvironment() const
else else
environment.appendOrSet("QML2_IMPORT_PATH", m_model->importPaths().join(pathSep), pathSep); environment.appendOrSet("QML2_IMPORT_PATH", m_model->importPaths().join(pathSep), pathSep);
} }
return environment.toProcessEnvironment(); return environment.toProcessEnvironment();
} }

View File

@@ -109,7 +109,7 @@ const ModelNode AbstractView::rootModelNode() const
ModelNode AbstractView::rootModelNode() ModelNode AbstractView::rootModelNode()
{ {
Q_ASSERT(model()); Q_ASSERT(model());
return ModelNode(model()->d->rootNode(), model(), this); return ModelNode(model()->d->rootNode(), model(), this);
} }
/*! /*!

View File

@@ -1836,7 +1836,7 @@ QString Model::pathForImport(const Import &import)
if (!rewriterView()) if (!rewriterView())
return QString(); return QString();
return rewriterView()->pathForImport(import); return rewriterView()->pathForImport(import);
} }
QStringList Model::importPaths() const QStringList Model::importPaths() const

View File

@@ -99,7 +99,7 @@ QmlItemNode QmlItemNode::createQmlItemNode(AbstractView *view, const ItemLibrary
NodeAbstractProperty parentProperty = parentQmlItemNode.defaultNodeAbstractProperty(); NodeAbstractProperty parentProperty = parentQmlItemNode.defaultNodeAbstractProperty();
return QmlItemNode::createQmlItemNode(view, itemLibraryEntry, position, parentProperty); return QmlItemNode::createQmlItemNode(view, itemLibraryEntry, position, parentProperty);
} }
QmlItemNode QmlItemNode::createQmlItemNode(AbstractView *view, const ItemLibraryEntry &itemLibraryEntry, const QPointF &position, NodeAbstractProperty parentproperty) QmlItemNode QmlItemNode::createQmlItemNode(AbstractView *view, const ItemLibraryEntry &itemLibraryEntry, const QPointF &position, NodeAbstractProperty parentproperty)

View File

@@ -262,12 +262,12 @@ static inline QVariant convertDynamicPropertyValueToVariant(const QString &astVa
static bool isListElementType(const QmlDesigner::TypeName &type) static bool isListElementType(const QmlDesigner::TypeName &type)
{ {
return type == "ListElement" || type == "QtQuick.ListElement" || type == "Qt.ListElement"; return type == "ListElement" || type == "QtQuick.ListElement" || type == "Qt.ListElement";
} }
static bool isComponentType(const QmlDesigner::TypeName &type) static bool isComponentType(const QmlDesigner::TypeName &type)
{ {
return type == "Component" || type == "Qt.Component" || type == "QtQuick.Component" || type == "<cpp>.QQmlComponent"; return type == "Component" || type == "Qt.Component" || type == "QtQuick.Component" || type == "<cpp>.QQmlComponent";
} }
static bool isCustomParserType(const QString &type) static bool isCustomParserType(const QString &type)
@@ -281,12 +281,12 @@ static bool isCustomParserType(const QString &type)
static bool isPropertyChangesType(const QmlDesigner::TypeName &type) static bool isPropertyChangesType(const QmlDesigner::TypeName &type)
{ {
return type == "PropertyChanges" || type == "QtQuick.PropertyChanges" || type == "Qt.PropertyChanges"; return type == "PropertyChanges" || type == "QtQuick.PropertyChanges" || type == "Qt.PropertyChanges";
} }
static bool isConnectionsType(const QmlDesigner::TypeName &type) static bool isConnectionsType(const QmlDesigner::TypeName &type)
{ {
return type == "Connections" || type == "QtQuick.Connections" || type == "Qt.Connections"; return type == "Connections" || type == "QtQuick.Connections" || type == "Qt.Connections";
} }
static bool propertyIsComponentType(const QmlDesigner::NodeAbstractProperty &property, const QmlDesigner::TypeName &type, QmlDesigner::Model *model) static bool propertyIsComponentType(const QmlDesigner::NodeAbstractProperty &property, const QmlDesigner::TypeName &type, QmlDesigner::Model *model)