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 60ebd1011..dac2e4c50 100644 --- a/src/libs/installer/fileio.cpp +++ b/src/libs/installer/fileio.cpp @@ -33,6 +33,7 @@ #include <QCoreApplication> #include <QByteArray> +#include <QDir> #include <QFileDevice> #include <QString> @@ -102,7 +103,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())); } } @@ -111,7 +113,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())); } } @@ -120,7 +123,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())); } } @@ -154,7 +158,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())); } } |