aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qmlpreview
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-04-30 12:58:33 +0200
committerhjk <hjk@qt.io>2019-04-30 17:10:39 +0000
commita5148b53638bdc9abe2006c7748936524f2d902c (patch)
treeea17e589f62d594bf840f71c8282098c7d9af8d6 /src/plugins/qmlpreview
parent28de30df18db15d081ccad3944cc341b8b29829b (diff)
ProjectExplorer: Rename ProjectTree::findCurrentNode to currentNode
For consistency, it's straight forwards access, similar to currentProject, not much to search and find. Change-Id: I7ce696bdc24b6a8713d6f11e02443a6f94c605f6 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'src/plugins/qmlpreview')
-rw-r--r--src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp2
-rw-r--r--src/plugins/qmlpreview/qmlpreviewplugin.cpp4
2 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp b/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp
index f08f3aeaaa3..02b8161ed29 100644
--- a/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp
+++ b/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp
@@ -72,7 +72,7 @@ QString QmlPreviewFileOnTargetFinder::findPath(const QString &filePath, bool *su
// Try the current node first. It's likely that this is the one we're looking for and if there
// is any ambiguity (same file mapped to multiple qrc paths) it should take precedence.
- ProjectExplorer::Node *currentNode = ProjectExplorer::ProjectTree::findCurrentNode();
+ ProjectExplorer::Node *currentNode = ProjectExplorer::ProjectTree::currentNode();
if (currentNode && currentNode->filePath().toString() == filePath) {
const QString path = resourceNodePath(currentNode);
if (!path.isEmpty())
diff --git a/src/plugins/qmlpreview/qmlpreviewplugin.cpp b/src/plugins/qmlpreview/qmlpreviewplugin.cpp
index 0094e9211b9..732f81ddd11 100644
--- a/src/plugins/qmlpreview/qmlpreviewplugin.cpp
+++ b/src/plugins/qmlpreview/qmlpreviewplugin.cpp
@@ -143,7 +143,7 @@ bool QmlPreviewPlugin::initialize(const QStringList &arguments, QString *errorSt
Constants::G_FILE_OTHER);
action->setVisible(false);
connect(ProjectTree::instance(), &ProjectTree::currentNodeChanged, action, [action]() {
- const Node *node = ProjectTree::findCurrentNode();
+ const Node *node = ProjectTree::currentNode();
const FileNode *fileNode = node ? node->asFileNode() : nullptr;
action->setVisible(fileNode ? fileNode->fileType() == FileType::QML : false);
});
@@ -297,7 +297,7 @@ void QmlPreviewPlugin::setFileLoader(QmlPreviewFileLoader fileLoader)
void QmlPreviewPlugin::previewCurrentFile()
{
- const Node *currentNode = ProjectTree::findCurrentNode();
+ const Node *currentNode = ProjectTree::currentNode();
if (!currentNode || !currentNode->asFileNode()
|| currentNode->asFileNode()->fileType() != FileType::QML)
return;