From 33c6ffc6ee42387f72ddd59559dc00abc0d0b3be Mon Sep 17 00:00:00 2001 From: Thomas Hartmann <thomas.hartmann@qt.io> Date: Thu, 11 May 2017 13:32:41 +0200 Subject: [PATCH] QmlDesigner: Remove dead code from NavigatorTreeModel This code has been moved to the delegates. Change-Id: I3e44a3eb2038299d3b0a7de1e86ed92c3d835bd4 Reviewed-by: Tim Jenssen <tim.jenssen@qt.io> --- .../navigator/navigatortreemodel.cpp | 39 ------------------- .../components/navigator/navigatortreemodel.h | 5 --- 2 files changed, 44 deletions(-) diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp index fb27dde3ec5..465ab0efe80 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.cpp @@ -36,7 +36,6 @@ #include <abstractview.h> #include <invalididexception.h> #include <rewritingexception.h> -#include <modelnodecontextmenu.h> #include <qmlitemnode.h> #include <coreplugin/icore.h> @@ -411,33 +410,6 @@ QModelIndex NavigatorTreeModel::createIndexFromModelNode(int row, int column, co return index; } -void NavigatorTreeModel::setId(const QModelIndex &index, const QString &newId) -{ - ModelNode modelNode = modelNodeForIndex(index); - - if (!modelNode.isValid()) - return; - - if (modelNode.id() == newId) - return; - - if (!modelNode.isValidId(newId)) { - Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 is an invalid id.").arg(newId)); - } else if (modelNode.view()->hasId(newId)) { - Core::AsynchronousMessageBox::warning(tr("Invalid Id"), tr("%1 already exists.").arg(newId)); - } else { - modelNode.setIdWithRefactoring(newId); - } -} - -void NavigatorTreeModel::openContextMenu(const QPoint &position) -{ - QTC_ASSERT(m_view, return); -#ifndef QMLDESIGNER_TEST - ModelNodeContextMenu::showContextMenu(m_view.data(), position, QPoint(), false); -#endif -} - bool NavigatorTreeModel::dropMimeData(const QMimeData *mimeData, Qt::DropAction action, int rowNumber, @@ -670,15 +642,4 @@ void NavigatorTreeModel::notifyModelNodesMoved(const QList<ModelNode> &modelNode layoutChanged(indexes); } -bool NavigatorTreeModel::isNodeVisible(const QModelIndex &index) const -{ - return m_view->isNodeVisible(modelNodeForIndex(index)); -} - -bool NavigatorTreeModel::hasError(const QModelIndex &index) const -{ - return QmlObjectNode(modelNodeForIndex(index)).hasError(); -} - - } // QmlDesigner diff --git a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h index 78c998274be..4fb8275a074 100644 --- a/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h +++ b/src/plugins/qmldesigner/components/navigator/navigatortreemodel.h @@ -78,9 +78,6 @@ public: QModelIndex createIndexFromModelNode(int row, int column, const ModelNode &modelNode) const; - void setId(const QModelIndex &index, const QString &newId); - void openContextMenu(const QPoint &position); - Qt::DropActions supportedDropActions() const override; Qt::DropActions supportedDragActions() const override; bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) override; @@ -89,8 +86,6 @@ public: void notifyModelNodesRemoved(const QList<ModelNode> &modelNodes); void notifyModelNodesInserted(const QList<ModelNode> &modelNodes); void notifyModelNodesMoved(const QList<ModelNode> &modelNodes); - bool isNodeVisible(const QModelIndex &index) const; - bool hasError(const QModelIndex &index) const; private: void moveNodesInteractive(NodeAbstractProperty &parentProperty, const QList<ModelNode> &modelNodes, int targetIndex); -- GitLab