forked from qt-creator/qt-creator
ProjectExplorer: Remove one constructor overload of DeployableFile
Change-Id: I87e444349129e9370b5fec505444723d36e21448 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -1127,7 +1127,7 @@ DeploymentData CMakeBuildSystem::deploymentData() const
|
||||
if (ct.targetType == ExecutableType || ct.targetType == DynamicLibraryType) {
|
||||
if (!ct.executable.isEmpty()
|
||||
&& result.deployableForLocalFile(ct.executable).localFilePath() != ct.executable) {
|
||||
result.addFile(ct.executable.toString(),
|
||||
result.addFile(ct.executable,
|
||||
deploymentPrefix + buildDir.relativeFilePath(ct.executable.toFileInfo().dir().path()),
|
||||
DeployableFile::TypeExecutable);
|
||||
}
|
||||
|
@@ -33,10 +33,6 @@ using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
DeployableFile::DeployableFile(const QString &localFilePath, const QString &remoteDir, Type type)
|
||||
: m_localFilePath(FilePath::fromUserInput(localFilePath)), m_remoteDir(remoteDir), m_type(type)
|
||||
{ }
|
||||
|
||||
DeployableFile::DeployableFile(const FilePath &localFilePath, const QString &remoteDir, Type type)
|
||||
: m_localFilePath(localFilePath), m_remoteDir(remoteDir), m_type(type)
|
||||
{ }
|
||||
|
@@ -43,8 +43,6 @@ public:
|
||||
};
|
||||
|
||||
DeployableFile() = default;
|
||||
DeployableFile(const QString &m_localFilePath, const QString &m_remoteDir,
|
||||
Type type = TypeNormal);
|
||||
DeployableFile(const Utils::FilePath &localFilePath, const QString &remoteDir,
|
||||
Type type = TypeNormal);
|
||||
|
||||
|
@@ -35,6 +35,8 @@
|
||||
|
||||
#include <utils/algorithm.h>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
const char BUILD_STEP_LIST_COUNT[] = "ProjectExplorer.BuildConfiguration.BuildStepListCount";
|
||||
@@ -107,7 +109,7 @@ bool DeployConfiguration::fromMap(const QVariantMap &map)
|
||||
m_usesCustomDeploymentData = map.value(USES_DEPLOYMENT_DATA, false).toBool();
|
||||
const QVariantMap deployData = map.value(DEPLOYMENT_DATA).toMap();
|
||||
for (auto it = deployData.begin(); it != deployData.end(); ++it)
|
||||
m_customDeploymentData.addFile(it.key(), it.value().toString());
|
||||
m_customDeploymentData.addFile(FilePath::fromString(it.key()), it.value().toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -31,6 +31,8 @@
|
||||
#include <QFileInfo>
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace Utils;
|
||||
|
||||
namespace ProjectExplorer {
|
||||
|
||||
void DeploymentData::setLocalInstallRoot(const Utils::FilePath &installRoot)
|
||||
@@ -43,7 +45,7 @@ void DeploymentData::addFile(const DeployableFile &file)
|
||||
m_files << file;
|
||||
}
|
||||
|
||||
void DeploymentData::addFile(const QString &localFilePath, const QString &remoteDirectory,
|
||||
void DeploymentData::addFile(const FilePath &localFilePath, const QString &remoteDirectory,
|
||||
DeployableFile::Type type)
|
||||
{
|
||||
addFile(DeployableFile(localFilePath, remoteDirectory, type));
|
||||
@@ -94,7 +96,7 @@ QString DeploymentData::addFilesFromDeploymentFile(const QString &deploymentFile
|
||||
QString targetFile = line.mid(splitPoint + 1);
|
||||
if (QFileInfo(targetFile).isRelative())
|
||||
targetFile.prepend(deploymentPrefix);
|
||||
addFile(sourceFile, targetFile);
|
||||
addFile(FilePath::fromString(sourceFile), targetFile);
|
||||
}
|
||||
}
|
||||
return deploymentPrefix;
|
||||
|
@@ -54,7 +54,7 @@ public:
|
||||
Utils::FilePath localInstallRoot() const { return m_localInstallRoot; }
|
||||
|
||||
void addFile(const DeployableFile &file);
|
||||
void addFile(const QString &localFilePath, const QString &remoteDirectory,
|
||||
void addFile(const Utils::FilePath &localFilePath, const QString &remoteDirectory,
|
||||
DeployableFile::Type type = DeployableFile::TypeNormal);
|
||||
QString addFilesFromDeploymentFile(const QString &deploymentFilePath, const QString &sourceDir);
|
||||
|
||||
|
@@ -74,9 +74,9 @@ public:
|
||||
if (role != Qt::EditRole)
|
||||
return false;
|
||||
if (column == 0)
|
||||
file = DeployableFile(data.toString(), file.remoteDirectory());
|
||||
file = DeployableFile(FilePath::fromVariant(data), file.remoteDirectory());
|
||||
else if (column == 1)
|
||||
file = DeployableFile(file.localFilePath().toString(), data.toString());
|
||||
file = DeployableFile(file.localFilePath(), data.toString());
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@@ -1161,7 +1161,7 @@ void QbsBuildSystem::updateDeploymentInfo()
|
||||
const QJsonObject installData = artifact.value("install-data").toObject();
|
||||
if (installData.value("is-installable").toBool()) {
|
||||
deploymentData.addFile(
|
||||
artifact.value("file-path").toString(),
|
||||
FilePath::fromVariant(artifact.value("file-path")),
|
||||
QFileInfo(installData.value("install-file-path").toString()).path(),
|
||||
artifact.value("is-executable").toBool()
|
||||
? DeployableFile::TypeExecutable : DeployableFile::TypeNormal);
|
||||
|
@@ -1230,8 +1230,8 @@ void QmakeBuildSystem::collectData(const QmakeProFile *file, DeploymentData &dep
|
||||
if (!item.active)
|
||||
continue;
|
||||
for (const auto &localFile : item.files) {
|
||||
deploymentData.addFile(localFile.fileName, item.path, item.executable
|
||||
? DeployableFile::TypeExecutable : DeployableFile::TypeNormal);
|
||||
deploymentData.addFile(FilePath::fromString(localFile.fileName), item.path,
|
||||
item.executable ? DeployableFile::TypeExecutable : DeployableFile::TypeNormal);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1260,7 +1260,7 @@ void QmakeBuildSystem::collectApplicationData(const QmakeProFile *file, Deployme
|
||||
{
|
||||
const FilePath executable = executableFor(file);
|
||||
if (!executable.isEmpty())
|
||||
deploymentData.addFile(executable.path(), file->installsList().targetPath,
|
||||
deploymentData.addFile(executable, file->installsList().targetPath,
|
||||
DeployableFile::TypeExecutable);
|
||||
}
|
||||
|
||||
@@ -1301,7 +1301,7 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
|
||||
}
|
||||
targetFileName += targetVersionExt + QLatin1Char('.');
|
||||
targetFileName += QLatin1String(isStatic ? "lib" : "dll");
|
||||
deploymentData.addFile(destDirFor(ti).toString() + '/' + targetFileName, targetPath);
|
||||
deploymentData.addFile(destDirFor(ti) / targetFileName, targetPath);
|
||||
break;
|
||||
}
|
||||
case Abi::DarwinOS: {
|
||||
@@ -1324,7 +1324,7 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
|
||||
targetFileName += file->singleVariableValue(isStatic
|
||||
? Variable::StaticLibExtension : Variable::ShLibExtension);
|
||||
}
|
||||
deploymentData.addFile(destDir.toString() + '/' + targetFileName, targetPath);
|
||||
deploymentData.addFile(destDir / targetFileName, targetPath);
|
||||
break;
|
||||
}
|
||||
case Abi::LinuxOS:
|
||||
@@ -1339,7 +1339,7 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
|
||||
targetFileName += QLatin1Char('a');
|
||||
} else {
|
||||
targetFileName += QLatin1String("so");
|
||||
deploymentData.addFile(destDirFor(ti).toString() + '/' + targetFileName, targetPath);
|
||||
deploymentData.addFile(destDirFor(ti) / targetFileName, targetPath);
|
||||
if (nameIsVersioned) {
|
||||
QString version = file->singleVariableValue(Variable::Version);
|
||||
if (version.isEmpty())
|
||||
@@ -1350,8 +1350,8 @@ void QmakeBuildSystem::collectLibraryData(const QmakeProFile *file, DeploymentDa
|
||||
targetFileName += QLatin1Char('.');
|
||||
while (!versionComponents.isEmpty()) {
|
||||
const QString versionString = versionComponents.join(QLatin1Char('.'));
|
||||
deploymentData.addFile(destDirFor(ti).toString() + '/'
|
||||
+ targetFileName + versionString, targetPath);
|
||||
deploymentData.addFile(destDirFor(ti) / targetFileName + versionString,
|
||||
targetPath);
|
||||
versionComponents.removeLast();
|
||||
}
|
||||
}
|
||||
|
@@ -520,7 +520,7 @@ void QmlBuildSystem::updateDeploymentData()
|
||||
ProjectExplorer::DeploymentData deploymentData;
|
||||
for (const QString &file : m_projectItem->files()) {
|
||||
deploymentData.addFile(
|
||||
file,
|
||||
FilePath::fromString(file),
|
||||
targetFile(Utils::FilePath::fromString(file)).parentDir().toString());
|
||||
}
|
||||
|
||||
|
@@ -286,7 +286,8 @@ QList<DeployableFile> QnxDeployQtLibrariesDialog::gatherFiles(
|
||||
remoteDir = fullRemoteDirectory() + QLatin1Char('/') +
|
||||
baseDir.relativeFilePath(dirPath);
|
||||
}
|
||||
result.append(DeployableFile(fileInfo.absoluteFilePath(), remoteDir));
|
||||
result.append(DeployableFile(Utils::FilePath::fromString(fileInfo.absoluteFilePath()),
|
||||
remoteDir));
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -35,6 +35,7 @@
|
||||
#include <QString>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
|
||||
namespace RemoteLinux {
|
||||
namespace Internal {
|
||||
@@ -53,7 +54,7 @@ public:
|
||||
|
||||
State state;
|
||||
PackageUploader * const uploader;
|
||||
QString packageFilePath;
|
||||
Utils::FilePath packageFilePath;
|
||||
};
|
||||
|
||||
} // namespace Internal
|
||||
@@ -72,12 +73,7 @@ AbstractUploadAndInstallPackageService::~AbstractUploadAndInstallPackageService(
|
||||
|
||||
void AbstractUploadAndInstallPackageService::setPackageFilePath(const QString &filePath)
|
||||
{
|
||||
d->packageFilePath = filePath;
|
||||
}
|
||||
|
||||
QString AbstractUploadAndInstallPackageService::packageFilePath() const
|
||||
{
|
||||
return d->packageFilePath;
|
||||
d->packageFilePath = FilePath::fromString(filePath);
|
||||
}
|
||||
|
||||
QString AbstractUploadAndInstallPackageService::uploadDir() const
|
||||
@@ -87,7 +83,7 @@ QString AbstractUploadAndInstallPackageService::uploadDir() const
|
||||
|
||||
bool AbstractUploadAndInstallPackageService::isDeploymentNecessary() const
|
||||
{
|
||||
return hasLocalFileChanged(DeployableFile(packageFilePath(), QString()));
|
||||
return hasLocalFileChanged(DeployableFile(d->packageFilePath, QString()));
|
||||
}
|
||||
|
||||
void AbstractUploadAndInstallPackageService::doDeviceSetup()
|
||||
@@ -109,13 +105,13 @@ void AbstractUploadAndInstallPackageService::doDeploy()
|
||||
QTC_ASSERT(d->state == Inactive, return);
|
||||
|
||||
d->state = Uploading;
|
||||
const QString fileName = Utils::FilePath::fromString(packageFilePath()).fileName();
|
||||
const QString fileName = d->packageFilePath.fileName();
|
||||
const QString remoteFilePath = uploadDir() + QLatin1Char('/') + fileName;
|
||||
connect(d->uploader, &PackageUploader::progress,
|
||||
this, &AbstractUploadAndInstallPackageService::progressMessage);
|
||||
connect(d->uploader, &PackageUploader::uploadFinished,
|
||||
this, &AbstractUploadAndInstallPackageService::handleUploadFinished);
|
||||
d->uploader->uploadPackage(connection(), packageFilePath(), remoteFilePath);
|
||||
d->uploader->uploadPackage(connection(), d->packageFilePath.toString(), remoteFilePath);
|
||||
}
|
||||
|
||||
void AbstractUploadAndInstallPackageService::stopDeployment()
|
||||
@@ -146,8 +142,7 @@ void AbstractUploadAndInstallPackageService::handleUploadFinished(const QString
|
||||
}
|
||||
|
||||
emit progressMessage(tr("Successfully uploaded package file."));
|
||||
const QString remoteFilePath = uploadDir() + QLatin1Char('/')
|
||||
+ Utils::FilePath::fromString(packageFilePath()).fileName();
|
||||
const QString remoteFilePath = uploadDir() + '/' + d->packageFilePath.fileName();
|
||||
d->state = Installing;
|
||||
emit progressMessage(tr("Installing package to device..."));
|
||||
connect(packageInstaller(), &AbstractRemoteLinuxPackageInstaller::stdoutData,
|
||||
@@ -164,7 +159,7 @@ void AbstractUploadAndInstallPackageService::handleInstallationFinished(const QS
|
||||
QTC_ASSERT(d->state == Installing, return);
|
||||
|
||||
if (errorMsg.isEmpty()) {
|
||||
saveDeploymentTimeStamp(DeployableFile(packageFilePath(), QString()), QDateTime());
|
||||
saveDeploymentTimeStamp(DeployableFile(d->packageFilePath, QString()), QDateTime());
|
||||
emit progressMessage(tr("Package installed."));
|
||||
} else {
|
||||
emit errorMessage(errorMsg);
|
||||
|
@@ -44,8 +44,6 @@ protected:
|
||||
AbstractUploadAndInstallPackageService();
|
||||
~AbstractUploadAndInstallPackageService() override;
|
||||
|
||||
QString packageFilePath() const;
|
||||
|
||||
private:
|
||||
void handleUploadFinished(const QString &errorMsg);
|
||||
void handleInstallationFinished(const QString &errorMsg);
|
||||
|
@@ -33,9 +33,9 @@
|
||||
#include <ssh/sshconnectionmanager.h>
|
||||
|
||||
#include <QDateTime>
|
||||
#include <QFileInfo>
|
||||
|
||||
using namespace ProjectExplorer;
|
||||
using namespace Utils;
|
||||
using namespace QSsh;
|
||||
|
||||
namespace RemoteLinux {
|
||||
@@ -180,7 +180,8 @@ void DeploymentTimeInfo::importDeployTimes(const QVariantMap &map)
|
||||
sysrootList.size());
|
||||
|
||||
for (int i = 0; i < elemCount; ++i) {
|
||||
const DeployableFile df(fileList.at(i).toString(), remotePathList.at(i).toString());
|
||||
const DeployableFile df(FilePath::fromVariant(fileList.at(i)),
|
||||
remotePathList.at(i).toString());
|
||||
const DeployParameters dp{df, hostList.at(i).toString(), sysrootList.at(i).toString()};
|
||||
d->lastDeployed.insert(dp, { localTimesList.at(i).toDateTime(),
|
||||
remoteTimesList.length() > i
|
||||
|
@@ -201,7 +201,7 @@ void MakeInstallStep::finish(bool success)
|
||||
const DeployableFile::Type type = appFileNames.contains(fi.fileName())
|
||||
? DeployableFile::TypeExecutable
|
||||
: DeployableFile::TypeNormal;
|
||||
m_deploymentData.addFile(fi.filePath(),
|
||||
m_deploymentData.addFile(FilePath::fromString(fi.filePath()),
|
||||
fi.dir().path().mid(installRoot().toString().length()), type);
|
||||
}
|
||||
buildSystem()->setDeploymentData(m_deploymentData);
|
||||
|
@@ -130,7 +130,7 @@ void TarPackageCreationStep::addNeededDeploymentFiles(
|
||||
}
|
||||
|
||||
for (const QString &fileName : files) {
|
||||
const QString localFilePath = deployable.localFilePath().pathAppended(fileName).toString();
|
||||
const FilePath localFilePath = deployable.localFilePath().pathAppended(fileName);
|
||||
|
||||
const QString remoteDir = deployable.remoteDirectory() + '/' + fileInfo.fileName();
|
||||
|
||||
|
Reference in New Issue
Block a user