diff options
author | hjk <hjk@qt.io> | 2019-08-27 13:47:24 +0200 |
---|---|---|
committer | hjk <hjk@qt.io> | 2019-08-29 05:42:13 +0000 |
commit | ae11f30b200e3a3994e04833df2a13b21e12c6bc (patch) | |
tree | c1f5ebdd161b290f0a06b94b4f017b5afb7eb0e0 | |
parent | 6c9f75ff4a6a98cb45fa48928b1d8ef25d3d14ad (diff) | |
download | qt-creator-ae11f30b200e3a3994e04833df2a13b21e12c6bc.tar.gz |
ProjectExplorer: Proliferate FilePath
DeployableFile and fallout.
Change-Id: I9a9c56e4a4ebf8f68df70d65da2e699efedfe907
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
9 files changed, 24 insertions, 23 deletions
diff --git a/src/plugins/autotest/testconfiguration.cpp b/src/plugins/autotest/testconfiguration.cpp index d09bfd6465..a68306dfdd 100644 --- a/src/plugins/autotest/testconfiguration.cpp +++ b/src/plugins/autotest/testconfiguration.cpp @@ -171,7 +171,7 @@ void TestConfiguration::completeTestInformation(TestRunMode runMode) // deployment information should get taken into account, but it pretty much seems as if // each build system uses it differently const DeploymentData &deployData = target->deploymentData(); - const DeployableFile deploy = deployData.deployableForLocalFile(localExecutable.toString()); + const DeployableFile deploy = deployData.deployableForLocalFile(localExecutable); // we might have a deployable executable const FilePath deployedExecutable = ensureExeEnding((deploy.isValid() && deploy.isExecutable()) ? FilePath::fromString(QDir::cleanPath(deploy.remoteFilePath())) : localExecutable); diff --git a/src/plugins/boot2qt/qdbrunconfiguration.cpp b/src/plugins/boot2qt/qdbrunconfiguration.cpp index f4b98c2860..03fa4e8e42 100644 --- a/src/plugins/boot2qt/qdbrunconfiguration.cpp +++ b/src/plugins/boot2qt/qdbrunconfiguration.cpp @@ -112,12 +112,12 @@ ProjectExplorer::RunConfiguration::ConfigurationState QdbRunConfiguration::ensur void QdbRunConfiguration::updateTargetInformation() { - BuildTargetInfo bti = buildTargetInfo(); - QString localExecutable = bti.targetFilePath.toString(); - DeployableFile depFile = target()->deploymentData().deployableForLocalFile(localExecutable); + const BuildTargetInfo bti = buildTargetInfo(); + const FilePath localExecutable = bti.targetFilePath; + const DeployableFile depFile = target()->deploymentData().deployableForLocalFile(localExecutable); aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(depFile.remoteFilePath())); - aspect<SymbolFileAspect>()->setValue(localExecutable); + aspect<SymbolFileAspect>()->setFileName(localExecutable); } QString QdbRunConfiguration::defaultDisplayName() const diff --git a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp index 7aced52df7..2a96c9b1f4 100644 --- a/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp +++ b/src/plugins/cmakeprojectmanager/cmakebuildconfiguration.cpp @@ -309,7 +309,7 @@ DeploymentData CMakeBuildConfiguration::deploymentData() const for (const CMakeBuildTarget &ct : m_buildTargets) { if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) { if (!ct.executable.isEmpty() - && !result.deployableForLocalFile(ct.executable.toString()).isValid()) { + && !result.deployableForLocalFile(ct.executable).isValid()) { result.addFile(ct.executable.toString(), deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()), DeployableFile::TypeExecutable); diff --git a/src/plugins/projectexplorer/deploymentdata.cpp b/src/plugins/projectexplorer/deploymentdata.cpp index acb8878de6..98d43692b6 100644 --- a/src/plugins/projectexplorer/deploymentdata.cpp +++ b/src/plugins/projectexplorer/deploymentdata.cpp @@ -55,11 +55,10 @@ void DeploymentData::addFile(const QString &localFilePath, const QString &remote addFile(DeployableFile(localFilePath, remoteDirectory, type)); } -DeployableFile DeploymentData::deployableForLocalFile(const QString &localFilePath) const +DeployableFile DeploymentData::deployableForLocalFile(const Utils::FilePath &localFilePath) const { - return Utils::findOrDefault(m_files, [&localFilePath](const DeployableFile &d) { - return d.localFilePath().toString() == localFilePath; - }); + return Utils::findOrDefault(m_files, + Utils::equal(&DeployableFile::localFilePath, localFilePath)); } bool DeploymentData::operator==(const DeploymentData &other) const diff --git a/src/plugins/projectexplorer/deploymentdata.h b/src/plugins/projectexplorer/deploymentdata.h index e45427ebf8..ad4209330e 100644 --- a/src/plugins/projectexplorer/deploymentdata.h +++ b/src/plugins/projectexplorer/deploymentdata.h @@ -60,7 +60,7 @@ public: int fileCount() const { return m_files.count(); } DeployableFile fileAt(int index) const { return m_files.at(index); } - DeployableFile deployableForLocalFile(const QString &localFilePath) const; + DeployableFile deployableForLocalFile(const Utils::FilePath &localFilePath) const; bool operator==(const DeploymentData &other) const; diff --git a/src/plugins/projectexplorer/desktoprunconfiguration.cpp b/src/plugins/projectexplorer/desktoprunconfiguration.cpp index c4f9bd4895..a3f1f735ac 100644 --- a/src/plugins/projectexplorer/desktoprunconfiguration.cpp +++ b/src/plugins/projectexplorer/desktoprunconfiguration.cpp @@ -171,14 +171,16 @@ void DesktopRunConfiguration::doAdditionalSetup(const RunConfigurationCreationIn Utils::FilePath DesktopRunConfiguration::executableToRun(const BuildTargetInfo &targetInfo) const { const FilePath appInBuildDir = targetInfo.targetFilePath; - if (target()->deploymentData().localInstallRoot().isEmpty()) + const DeploymentData deploymentData = target()->deploymentData(); + if (deploymentData.localInstallRoot().isEmpty()) return appInBuildDir; - const QString deployedAppFilePath = target()->deploymentData() - .deployableForLocalFile(appInBuildDir.toString()).remoteFilePath(); + + const QString deployedAppFilePath = deploymentData + .deployableForLocalFile(appInBuildDir).remoteFilePath(); if (deployedAppFilePath.isEmpty()) return appInBuildDir; - const FilePath appInLocalInstallDir = target()->deploymentData().localInstallRoot() - + deployedAppFilePath; + + const FilePath appInLocalInstallDir = deploymentData.localInstallRoot() + deployedAppFilePath; return appInLocalInstallDir.exists() ? appInLocalInstallDir : appInBuildDir; } diff --git a/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp b/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp index 02b8161ed2..aebce83d5a 100644 --- a/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp +++ b/src/plugins/qmlpreview/qmlpreviewfileontargetfinder.cpp @@ -66,7 +66,7 @@ QString QmlPreviewFileOnTargetFinder::findPath(const QString &filePath, bool *su return filePath; ProjectExplorer::DeployableFile file - = m_target->deploymentData().deployableForLocalFile(filePath); + = m_target->deploymentData().deployableForLocalFile(Utils::FilePath::fromString(filePath)); if (file.isValid()) return file.remoteFilePath(); diff --git a/src/plugins/qnx/qnxrunconfiguration.cpp b/src/plugins/qnx/qnxrunconfiguration.cpp index 9648a64487..eba7121653 100644 --- a/src/plugins/qnx/qnxrunconfiguration.cpp +++ b/src/plugins/qnx/qnxrunconfiguration.cpp @@ -70,12 +70,12 @@ QnxRunConfiguration::QnxRunConfiguration(Target *target, Core::Id id) auto updateTargetInformation = [this, target, exeAspect, symbolsAspect] { - BuildTargetInfo bti = buildTargetInfo(); - QString localExecutable = bti.targetFilePath.toString(); - DeployableFile depFile = target->deploymentData().deployableForLocalFile(localExecutable); + const BuildTargetInfo bti = buildTargetInfo(); + const FilePath localExecutable = bti.targetFilePath; + const DeployableFile depFile = target->deploymentData().deployableForLocalFile(localExecutable); exeAspect->setExecutable(FilePath::fromString(depFile.remoteFilePath())); - symbolsAspect->setValue(localExecutable); + symbolsAspect->setFileName(localExecutable); emit enabledChanged(); }; diff --git a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp index 4341a6d4ec..e243661553 100644 --- a/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp +++ b/src/plugins/remotelinux/remotelinuxrunconfiguration.cpp @@ -90,11 +90,11 @@ Runnable RemoteLinuxRunConfiguration::runnable() const void RemoteLinuxRunConfiguration::updateTargetInformation() { BuildTargetInfo bti = buildTargetInfo(); - QString localExecutable = bti.targetFilePath.toString(); + const FilePath localExecutable = bti.targetFilePath; DeployableFile depFile = target()->deploymentData().deployableForLocalFile(localExecutable); aspect<ExecutableAspect>()->setExecutable(FilePath::fromString(depFile.remoteFilePath())); - aspect<SymbolFileAspect>()->setValue(localExecutable); + aspect<SymbolFileAspect>()->setFileName(localExecutable); emit enabledChanged(); } |