forked from qt-creator/qt-creator
Utils: Remove unused function BuildableHelperLibrary::copyFiles
Change-Id: Ie9631eb551e3d75da5c33dd03c218d5290dd6934 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
@@ -190,42 +190,6 @@ QStringList BuildableHelperLibrary::possibleQMakeCommands()
|
|||||||
return commands;
|
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
|
// Helper: Run a build process with merged stdout/stderr
|
||||||
static inline bool runBuildProcessI(QtcProcess &proc,
|
static inline bool runBuildProcessI(QtcProcess &proc,
|
||||||
int timeoutS,
|
int timeoutS,
|
||||||
|
@@ -55,9 +55,6 @@ public:
|
|||||||
const QStringList &validBinaryFilenames,
|
const QStringList &validBinaryFilenames,
|
||||||
bool acceptOutdatedHelper);
|
bool acceptOutdatedHelper);
|
||||||
|
|
||||||
static bool copyFiles(const FilePath &sourcePath, const QStringList &files,
|
|
||||||
const FilePath &targetDirectory, QString *errorMessage);
|
|
||||||
|
|
||||||
struct BuildHelperArguments {
|
struct BuildHelperArguments {
|
||||||
QString helperName;
|
QString helperName;
|
||||||
QString directory;
|
QString directory;
|
||||||
|
Reference in New Issue
Block a user