summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/simplemovefileoperation.cpp
diff options
context:
space:
mode:
authorKai Koehne <kai.koehne@theqtcompany.com>2015-06-24 10:15:16 +0200
committerKai Koehne <kai.koehne@theqtcompany.com>2015-06-24 09:22:42 +0000
commit1e589e37a991b29076e9a661f92dfa178421c208 (patch)
treeccdae70edb75b1bc17f0efc61086e16554e3f4eb /src/libs/installer/simplemovefileoperation.cpp
parent65a5d4d33c7dcb27ce99ce59535733a28991c544 (diff)
Unify translated error messages
* Enclose file paths in "" * Localize file paths with QDir::toNativeSeparators. * Make sure sentences end with a '.' * Append error details always by ':', e.g. tr("Failed to copy file '%1': %2").(...) * Use 'directory' instead of 'folder' everywhere Change-Id: Ie045f429f72ad5045c96537465c5fb9d2e99d250 Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/simplemovefileoperation.cpp')
-rw-r--r--src/libs/installer/simplemovefileoperation.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/libs/installer/simplemovefileoperation.cpp b/src/libs/installer/simplemovefileoperation.cpp
index 54a5583ee..ce643020d 100644
--- a/src/libs/installer/simplemovefileoperation.cpp
+++ b/src/libs/installer/simplemovefileoperation.cpp
@@ -34,6 +34,7 @@
#include "simplemovefileoperation.h"
+#include <QDir>
#include <QtCore/QFileInfo>
namespace QInstaller {
@@ -58,8 +59,8 @@ bool SimpleMoveFileOperation::performOperation()
if (source.isEmpty() || target.isEmpty()) {
setError(UserDefinedError);
- setErrorString(tr("None of the arguments can be empty: source '%1', target '%2'.")
- .arg(source, target));
+ setErrorString(tr("None of the arguments can be empty: source \"%1\", target \"%2\".")
+ .arg(QDir::toNativeSeparators(source), QDir::toNativeSeparators(target)));
return false;
}
@@ -69,8 +70,8 @@ bool SimpleMoveFileOperation::performOperation()
if (file.exists()) {
if (!file.remove()) {
setError(UserDefinedError);
- setErrorString(tr("Cannot move source '%1' to target '%2', because target exists and is "
- "not removable.").arg(source, target));
+ setErrorString(tr("Cannot move file from \"%1\" to \"%2\", because the target path exists and is "
+ "not removable.").arg(QDir::toNativeSeparators(source), QDir::toNativeSeparators(target)));
return false;
}
}
@@ -78,12 +79,14 @@ bool SimpleMoveFileOperation::performOperation()
file.setFileName(source);
if (!file.rename(target)) {
setError(UserDefinedError);
- setErrorString(tr("Cannot move source '%1' to target '%2': %3").arg(source, target,
- file.errorString()));
+ setErrorString(tr("Cannot move file \"%1\" to \"%2\": %3").arg(
+ QDir::toNativeSeparators(source), QDir::toNativeSeparators(target),
+ file.errorString()));
return false;
}
- emit outputTextChanged(tr("Move '%1' to '%2'.").arg(source, target));
+ emit outputTextChanged(tr("Moving file \"%1\" to \"%2\".").arg(QDir::toNativeSeparators(source),
+ QDir::toNativeSeparators(target)));
return true;
}
@@ -93,7 +96,8 @@ bool SimpleMoveFileOperation::undoOperation()
const QString target = arguments().at(1);
QFile(target).rename(source);
- emit outputTextChanged(tr("Move '%1' to '%2'.").arg(target, source));
+ emit outputTextChanged(tr("Moving file \"%1\" to \"%2\".").arg(QDir::toNativeSeparators(target),
+ QDir::toNativeSeparators(source)));
return true;
}