Utils: Remove unused function BuildableHelperLibrary::copyFiles

Change-Id: Ie9631eb551e3d75da5c33dd03c218d5290dd6934
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2021-08-10 14:01:47 +02:00
parent c7168d1063
commit 9312963f5e
2 changed files with 0 additions and 39 deletions

View File

@@ -190,42 +190,6 @@ QStringList BuildableHelperLibrary::possibleQMakeCommands()
return commands;
}
// Copy helper source files to a target directory, replacing older files.
bool BuildableHelperLibrary::copyFiles(const FilePath &sourcePath,
const QStringList &files,
const FilePath &targetDirectory,
QString *errorMessage)
{
// try remove the directory
if (!targetDirectory.removeRecursively(errorMessage))
return false;
if (!targetDirectory.ensureWritableDir()) {
*errorMessage = tr("The target directory %1 could not be created.")
.arg(targetDirectory.toUserOutput());
return false;
}
for (const QString &file : files) {
const FilePath source = sourcePath.pathAppended(file);
const FilePath dest = targetDirectory.pathAppended(file);
if (dest.exists()) {
if (dest.lastModified() >= source.lastModified())
continue;
if (!dest.removeFile()) {
*errorMessage = tr("The existing file %1 could not be removed.")
.arg(dest.toUserOutput());
return false;
}
}
dest.parentDir().ensureWritableDir();
if (!source.copyFile(dest)) {
*errorMessage = tr("The file %1 could not be copied to %2.")
.arg(source.toUserOutput(), dest.toUserOutput());
return false;
}
}
return true;
}
// Helper: Run a build process with merged stdout/stderr
static inline bool runBuildProcessI(QtcProcess &proc,
int timeoutS,

View File

@@ -55,9 +55,6 @@ public:
const QStringList &validBinaryFilenames,
bool acceptOutdatedHelper);
static bool copyFiles(const FilePath &sourcePath, const QStringList &files,
const FilePath &targetDirectory, QString *errorMessage);
struct BuildHelperArguments {
QString helperName;
QString directory;