diff options
Diffstat (limited to 'src/libs/installer/fileio.cpp')
-rw-r--r-- | src/libs/installer/fileio.cpp | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libs/installer/fileio.cpp b/src/libs/installer/fileio.cpp index 5817d148c..8921f7257 100644 --- a/src/libs/installer/fileio.cpp +++ b/src/libs/installer/fileio.cpp @@ -38,6 +38,7 @@ #include <QCoreApplication> #include <QByteArray> +#include <QDir> #include <QFileDevice> #include <QString> @@ -107,7 +108,8 @@ void QInstaller::openForRead(QFileDevice *dev) Q_ASSERT(dev); if (!dev->open(QIODevice::ReadOnly)) { throw Error(QCoreApplication::translate("QInstaller", - "Cannot open file %1 for reading: %2").arg(dev->fileName(), dev->errorString())); + "Cannot open file \"%1\" for reading: %2").arg( + QDir::toNativeSeparators(dev->fileName()), dev->errorString())); } } @@ -116,7 +118,8 @@ void QInstaller::openForWrite(QFileDevice *dev) Q_ASSERT(dev); if (!dev->open(QIODevice::WriteOnly)) { throw Error(QCoreApplication::translate("QInstaller", - "Cannot open file %1 for writing: %2").arg(dev->fileName(), dev->errorString())); + "Cannot open file \"%1\" for writing: %2").arg( + QDir::toNativeSeparators(dev->fileName()), dev->errorString())); } } @@ -125,7 +128,8 @@ void QInstaller::openForAppend(QFileDevice *dev) Q_ASSERT(dev); if (!dev->open(QIODevice::WriteOnly | QIODevice::Append)) { throw Error(QCoreApplication::translate("QInstaller", - "Cannot open file %1 for writing: %2").arg(dev->fileName(), dev->errorString())); + "Cannot open file \"%1\" for writing: %2").arg( + QDir::toNativeSeparators(dev->fileName()), dev->errorString())); } } @@ -159,7 +163,7 @@ qint64 QInstaller::blockingCopy(QFileDevice *in, QFileDevice *out, qint64 size) size -= actual; actual = qMin(blockSize, size); } catch (const Error &error) { - throw Error(QCoreApplication::translate("QInstaller", "Copy failed. Error: %1") + throw Error(QCoreApplication::translate("QInstaller", "Copy failed: %1") .arg(error.message())); } } |