aboutsummaryrefslogtreecommitdiffstats
path: root/src/plugins/qtsupport/baseqtversion.cpp
diff options
context:
space:
mode:
authorUlf Hermann <ulf.hermann@qt.io>2018-08-20 18:04:35 +0200
committerUlf Hermann <ulf.hermann@qt.io>2018-08-27 08:58:01 +0000
commit7b0b4c92cdd06ff94b4121e42fd8776c15115586 (patch)
treebcfaacaa6b1e11a06dcb3210d069a4265b83b5cf /src/plugins/qtsupport/baseqtversion.cpp
parent6fba0be280c93e9e80fcc6ce6d0324035685798f (diff)
FileInProjectFinder: Search DeploymentData for paths
The deployment data is the most reliable information we can get regarding where a file from the host ended up on the target. Therefore it is searched first. Since the "directories" found this way may not actually exist on the host, we return the list of entries rather than the actual path for those. Files from different host directories can be deployed to the same target directory, after all. Using the list of entries, a client can reconstruct children of the directory by appending an entry to the base path and searching again. Change-Id: Ia0f72872a4ff6313f1ae8b0f441b67f55be5a456 Reviewed-by: Vikas Pachdha <vikas.pachdha@qt.io>
Diffstat (limited to 'src/plugins/qtsupport/baseqtversion.cpp')
-rw-r--r--src/plugins/qtsupport/baseqtversion.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/plugins/qtsupport/baseqtversion.cpp b/src/plugins/qtsupport/baseqtversion.cpp
index d0e892eaed..c59c24b48e 100644
--- a/src/plugins/qtsupport/baseqtversion.cpp
+++ b/src/plugins/qtsupport/baseqtversion.cpp
@@ -33,6 +33,8 @@
#include <coreplugin/icore.h>
#include <coreplugin/progressmanager/progressmanager.h>
#include <proparser/qmakevfs.h>
+#include <projectexplorer/deployablefile.h>
+#include <projectexplorer/deploymentdata.h>
#include <projectexplorer/toolchainmanager.h>
#include <projectexplorer/toolchain.h>
#include <projectexplorer/projectexplorer.h>
@@ -1358,6 +1360,11 @@ void BaseQtVersion::populateQmlFileFinder(FileInProjectFinder *finder, const Tar
QStringList additionalSearchDirectories = qtVersion
? QStringList(qtVersion->qmlPath().toString()) : QStringList();
+ if (target) {
+ for (const ProjectExplorer::DeployableFile &file : target->deploymentData().allFiles())
+ finder->addMappedPath(file.localFilePath().toString(), file.remoteFilePath());
+ }
+
// Finally, do populate m_projectFinder
finder->setProjectDirectory(projectDirectory);
finder->setProjectFiles(sourceFiles);