Commit 47d871c0 authored by Friedemann Kleint's avatar Friedemann Kleint Committed by hjk

Add a few missing QDir::toNativeSeparators().

Fix messages shown when trying to launch/debug a non-existing
binary.

Change-Id: I2b69904595effd97e143b57ee64df085c20bff28
Reviewed-by: default avatarhjk <hjk121@nokiamail.com>
parent 5292748b
......@@ -32,6 +32,7 @@
#include <QStringList>
#ifdef Q_OS_WIN
# include <utils/winutils.h>
# include <QDir>
# include <QDebug>
# include <climits>
# include <windows.h>
......@@ -235,19 +236,25 @@ bool getPDBFiles(const QString &peExecutableFileName, QStringList *rc, QString *
hFile = CreateFile(reinterpret_cast<const WCHAR*>(peExecutableFileName.utf16()), GENERIC_READ, FILE_SHARE_READ, NULL,
OPEN_EXISTING, FILE_ATTRIBUTE_NORMAL, NULL);
if (hFile == INVALID_HANDLE_VALUE || hFile == NULL) {
*errorMessage = QString::fromLatin1("Cannot open '%1': %2").arg(peExecutableFileName, winErrorMessage(GetLastError()));
*errorMessage = QString::fromLatin1("Cannot open '%1': %2")
.arg(QDir::toNativeSeparators(peExecutableFileName),
winErrorMessage(GetLastError()));
break;
}
hFileMap = CreateFileMapping(hFile, NULL, PAGE_READONLY, 0, 0, NULL);
if (hFileMap == NULL) {
*errorMessage = QString::fromLatin1("Cannot create file mapping of '%1': %2").arg(peExecutableFileName, winErrorMessage(GetLastError()));
*errorMessage = QString::fromLatin1("Cannot create file mapping of '%1': %2")
.arg(QDir::toNativeSeparators(peExecutableFileName),
winErrorMessage(GetLastError()));
break;
}
fileMemory = MapViewOfFile(hFileMap, FILE_MAP_READ, 0, 0, 0);
if (!fileMemory) {
*errorMessage = QString::fromLatin1("Cannot map '%1': %2").arg(peExecutableFileName, winErrorMessage(GetLastError()));
*errorMessage = QString::fromLatin1("Cannot map '%1': %2")
.arg(QDir::toNativeSeparators(peExecutableFileName),
winErrorMessage(GetLastError()));
break;
}
......
......@@ -101,7 +101,7 @@ void LocalApplicationRunControl::start()
appendMessage(tr("No executable specified.") + QLatin1Char('\n'), Utils::ErrorMessageFormat);
emit finished();
} else if (!QFileInfo(m_executable).exists()){
appendMessage(tr("Executable %1 does not exist.").arg(m_executable) + QLatin1Char('\n'),
appendMessage(tr("Executable %1 does not exist.").arg(QDir::toNativeSeparators(m_executable)) + QLatin1Char('\n'),
Utils::ErrorMessageFormat);
emit finished();
} else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment