diff options
author | kh1 <karsten.heimrich@digia.com> | 2013-03-22 15:01:32 +0100 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@digia.com> | 2013-03-25 09:17:39 +0100 |
commit | 3a81ca00f31e17d6995a84a4adf261c80c1d8ba7 (patch) | |
tree | dc824fe8b2b85c8f04f0eadc280763a7b46d03b7 /tools | |
parent | 537ed91a806895eb6f38bc67d81e7bcd9335d7eb (diff) |
Small cleanup, no functional change.
Change-Id: I339d99d86ab71af785a9fa7b221d255d0e1f1f9b
Reviewed-by: Niels Weber <niels.weber@digia.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/common/repositorygen.cpp | 19 |
1 files changed, 7 insertions, 12 deletions
diff --git a/tools/common/repositorygen.cpp b/tools/common/repositorygen.cpp index fdad96871..1f1a169d0 100644 --- a/tools/common/repositorygen.cpp +++ b/tools/common/repositorygen.cpp @@ -75,26 +75,21 @@ void QInstallerTools::printRepositoryGenOptions() void QInstallerTools::copyWithException(const QString &source, const QString &target, const QString &kind) { - QFile sourceFile(source); qDebug() << QString::fromLatin1("Copying associated %1 file '%2'").arg(kind, source); const QFileInfo targetFileInfo(target); - const QDir targetDir = targetFileInfo.dir(); - if (!targetDir.exists()) + if (!targetFileInfo.dir().exists()) QInstaller::mkpath(targetFileInfo.absolutePath()); - // in the case of an existing target the error String does not show the file - if (targetFileInfo.exists()) { - qDebug() << "failed!\n"; - throw QInstaller::Error(QString::fromLatin1("Could not copy the %1 file from\n'%2' to '%3'\nError: '%4'." - ).arg(kind, source, target, QLatin1String("Target already exist."))); - } - + QFile sourceFile(source); if (!sourceFile.copy(target)) { qDebug() << "failed!\n"; - throw QInstaller::Error(QString::fromLatin1("Could not copy the %1 file.\nError: '%2'" - ).arg(kind, sourceFile.errorString())); + throw QInstaller::Error(QString::fromLatin1("Could not copy the %1 file from\n'%2' to '%3'\nError: " + "'%4'.").arg(kind, source, target, + /* in case of an existing target the error String does not show the file */ + (targetFileInfo.exists() ? QLatin1String("Target already exist.") : sourceFile.errorString()))); } + qDebug() << "done.\n"; } |