forked from qt-creator/qt-creator
ProjectExplorer: Proliferate Utils::FilePath use
Move the .toString() uses into DeploymentData::addFilesFromDeploymentFile Change-Id: Ic9ef22da1918ca105c92f0231960dab27b0d80bb Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1086,8 +1086,7 @@ DeploymentData CMakeBuildSystem::deploymentData() const
|
|||||||
if (!hasDeploymentFile)
|
if (!hasDeploymentFile)
|
||||||
return result;
|
return result;
|
||||||
|
|
||||||
deploymentPrefix = result.addFilesFromDeploymentFile(deploymentFilePath.toString(),
|
deploymentPrefix = result.addFilesFromDeploymentFile(deploymentFilePath, sourceDir);
|
||||||
sourceDir.toString());
|
|
||||||
for (const CMakeBuildTarget &ct : m_buildTargets) {
|
for (const CMakeBuildTarget &ct : m_buildTargets) {
|
||||||
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) {
|
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) {
|
||||||
if (!ct.executable.isEmpty()
|
if (!ct.executable.isEmpty()
|
||||||
|
|||||||
@@ -460,8 +460,7 @@ void CompilationDatabaseBuildSystem::updateDeploymentData()
|
|||||||
const Utils::FilePath deploymentFilePath = projectDirectory()
|
const Utils::FilePath deploymentFilePath = projectDirectory()
|
||||||
.pathAppended("QtCreatorDeployment.txt");
|
.pathAppended("QtCreatorDeployment.txt");
|
||||||
DeploymentData deploymentData;
|
DeploymentData deploymentData;
|
||||||
deploymentData.addFilesFromDeploymentFile(deploymentFilePath.toString(),
|
deploymentData.addFilesFromDeploymentFile(deploymentFilePath, projectDirectory());
|
||||||
projectDirectory().toString());
|
|
||||||
setDeploymentData(deploymentData);
|
setDeploymentData(deploymentData);
|
||||||
if (m_deployFileWatcher->files() != QStringList(deploymentFilePath.toString())) {
|
if (m_deployFileWatcher->files() != QStringList(deploymentFilePath.toString())) {
|
||||||
m_deployFileWatcher->clear();
|
m_deployFileWatcher->clear();
|
||||||
|
|||||||
@@ -599,8 +599,7 @@ void GenericBuildSystem::updateDeploymentData()
|
|||||||
}
|
}
|
||||||
if (hasDeploymentData) {
|
if (hasDeploymentData) {
|
||||||
DeploymentData deploymentData;
|
DeploymentData deploymentData;
|
||||||
deploymentData.addFilesFromDeploymentFile(deploymentFilePath.toString(),
|
deploymentData.addFilesFromDeploymentFile(deploymentFilePath, projectDirectory());
|
||||||
projectDirectory().toString());
|
|
||||||
setDeploymentData(deploymentData);
|
setDeploymentData(deploymentData);
|
||||||
if (m_deployFileWatcher.filePaths() != FilePaths{deploymentFilePath}) {
|
if (m_deployFileWatcher.filePaths() != FilePaths{deploymentFilePath}) {
|
||||||
m_deployFileWatcher.clear();
|
m_deployFileWatcher.clear();
|
||||||
|
|||||||
@@ -48,11 +48,12 @@ bool DeploymentData::operator==(const DeploymentData &other) const
|
|||||||
&& m_localInstallRoot == other.m_localInstallRoot;
|
&& m_localInstallRoot == other.m_localInstallRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
QString DeploymentData::addFilesFromDeploymentFile(const QString &deploymentFilePath,
|
QString DeploymentData::addFilesFromDeploymentFile(const FilePath &deploymentFilePath,
|
||||||
const QString &sourceDir)
|
const FilePath &sourceDir_)
|
||||||
{
|
{
|
||||||
|
const QString sourceDir = sourceDir_.toString();
|
||||||
const QString sourcePrefix = sourceDir.endsWith('/') ? sourceDir : sourceDir + '/';
|
const QString sourcePrefix = sourceDir.endsWith('/') ? sourceDir : sourceDir + '/';
|
||||||
QFile deploymentFile(deploymentFilePath);
|
QFile deploymentFile(deploymentFilePath.toString());
|
||||||
QTextStream deploymentStream;
|
QTextStream deploymentStream;
|
||||||
QString deploymentPrefix;
|
QString deploymentPrefix;
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
void addFile(const DeployableFile &file);
|
void addFile(const DeployableFile &file);
|
||||||
void addFile(const Utils::FilePath &localFilePath, const QString &remoteDirectory,
|
void addFile(const Utils::FilePath &localFilePath, const QString &remoteDirectory,
|
||||||
DeployableFile::Type type = DeployableFile::TypeNormal);
|
DeployableFile::Type type = DeployableFile::TypeNormal);
|
||||||
QString addFilesFromDeploymentFile(const QString &deploymentFilePath, const QString &sourceDir);
|
QString addFilesFromDeploymentFile(const Utils::FilePath &deploymentFilePath, const Utils::FilePath &sourceDir);
|
||||||
|
|
||||||
int fileCount() const { return m_files.count(); }
|
int fileCount() const { return m_files.count(); }
|
||||||
DeployableFile fileAt(int index) const { return m_files.at(index); }
|
DeployableFile fileAt(int index) const { return m_files.at(index); }
|
||||||
|
|||||||
Reference in New Issue
Block a user