forked from qt-creator/qt-creator
MSVC: Fix compilation with new mkspecs.
See Qt Merge-request: 727, change a9c8decc741d8c2b340f38d7a854ef206672ab3e, which makes wchar_t a native type. QString::toUtf16() no longer is a WCHAR.
This commit is contained in:
@@ -95,7 +95,7 @@ void Core::Internal::ProgressManagerPrivate::setApplicationLabel(const QString &
|
|||||||
font.setPointSize(font.pointSize()-2);
|
font.setPointSize(font.pointSize()-2);
|
||||||
p.setFont(font);
|
p.setFont(font);
|
||||||
p.drawText(QRect(QPoint(0,0), pix.size()), Qt::AlignHCenter|Qt::AlignCenter, text);
|
p.drawText(QRect(QPoint(0,0), pix.size()), Qt::AlignHCenter|Qt::AlignCenter, text);
|
||||||
pITask->SetOverlayIcon(winId, pix.toWinHICON(), text.utf16());
|
pITask->SetOverlayIcon(winId, pix.toWinHICON(), (wchar_t*)text.utf16());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -237,9 +237,9 @@ static bool mapDeviceToDriveLetter(QString *s)
|
|||||||
for (const TCHAR *driveLetter = driveLetters; *driveLetter; driveLetter++) {
|
for (const TCHAR *driveLetter = driveLetters; *driveLetter; driveLetter++) {
|
||||||
szDrive[0] = *driveLetter; // Look up each device name
|
szDrive[0] = *driveLetter; // Look up each device name
|
||||||
if (QueryDosDevice(szDrive, driveName, MAX_PATH)) {
|
if (QueryDosDevice(szDrive, driveName, MAX_PATH)) {
|
||||||
const QString deviceName = QString::fromUtf16(driveName);
|
const QString deviceName = QString::fromWCharArray(driveName);
|
||||||
if (s->startsWith(deviceName)) {
|
if (s->startsWith(deviceName)) {
|
||||||
s->replace(0, deviceName.size(), QString::fromUtf16(szDrive));
|
s->replace(0, deviceName.size(), QString::fromWCharArray(szDrive));
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -255,7 +255,7 @@ static bool mapDeviceToDriveLetter(QString *s)
|
|||||||
|
|
||||||
static inline QString normalizeFileNameCaseHelper(const QString &f)
|
static inline QString normalizeFileNameCaseHelper(const QString &f)
|
||||||
{
|
{
|
||||||
HANDLE hFile = CreateFile(f.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
|
HANDLE hFile = CreateFile((const wchar_t*)f.utf16(), GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL);
|
||||||
if(hFile == INVALID_HANDLE_VALUE)
|
if(hFile == INVALID_HANDLE_VALUE)
|
||||||
return f;
|
return f;
|
||||||
// Get the file size. We need a non-empty file to map it.
|
// Get the file size. We need a non-empty file to map it.
|
||||||
@@ -285,7 +285,7 @@ static inline QString normalizeFileNameCaseHelper(const QString &f)
|
|||||||
pszFilename[0] = 0;
|
pszFilename[0] = 0;
|
||||||
// Get a file name of the form "/Device/HarddiskVolume1/file.cpp"
|
// Get a file name of the form "/Device/HarddiskVolume1/file.cpp"
|
||||||
if (GetMappedFileName (GetCurrentProcess(), pMem, pszFilename, MAX_PATH)) {
|
if (GetMappedFileName (GetCurrentProcess(), pMem, pszFilename, MAX_PATH)) {
|
||||||
rc = QString::fromUtf16(pszFilename);
|
rc = QString::fromWCharArray(pszFilename);
|
||||||
if (!mapDeviceToDriveLetter(&rc))
|
if (!mapDeviceToDriveLetter(&rc))
|
||||||
rc.clear();
|
rc.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -296,7 +296,7 @@ bool CoreEngine::init(const QString &dllEnginePath, QString *errorMessage)
|
|||||||
*errorMessage = msgComFailed("GetImagePathWide", hr);
|
*errorMessage = msgComFailed("GetImagePathWide", hr);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
m_baseImagePath = QString::fromUtf16(buf);
|
m_baseImagePath = QString::fromWCharArray(buf);
|
||||||
|
|
||||||
hr = lib.debugCreate( __uuidof(IDebugRegisters2), reinterpret_cast<void**>(&m_cif.debugRegisters));
|
hr = lib.debugCreate( __uuidof(IDebugRegisters2), reinterpret_cast<void**>(&m_cif.debugRegisters));
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
@@ -447,7 +447,7 @@ bool CoreEngine::startDebuggerWithExecutable(const QString &workingDirectory,
|
|||||||
PCWSTR workingDirC = 0;
|
PCWSTR workingDirC = 0;
|
||||||
const QString workingDirN = workingDirectory.isEmpty() ? QString() : QDir::toNativeSeparators(workingDirectory);
|
const QString workingDirN = workingDirectory.isEmpty() ? QString() : QDir::toNativeSeparators(workingDirectory);
|
||||||
if (!workingDirN.isEmpty())
|
if (!workingDirN.isEmpty())
|
||||||
workingDirC = workingDirN.utf16();
|
workingDirC = (PCWSTR)workingDirN.utf16();
|
||||||
hr = m_cif.debugClient->CreateProcess2Wide(NULL,
|
hr = m_cif.debugClient->CreateProcess2Wide(NULL,
|
||||||
reinterpret_cast<PWSTR>(const_cast<ushort *>(cmd.utf16())),
|
reinterpret_cast<PWSTR>(const_cast<ushort *>(cmd.utf16())),
|
||||||
&dbgopts, sizeof(dbgopts),
|
&dbgopts, sizeof(dbgopts),
|
||||||
@@ -820,7 +820,7 @@ quint64 CoreEngine::getSourceLineAddress(const QString &file,
|
|||||||
{
|
{
|
||||||
ULONG64 rc = 0;
|
ULONG64 rc = 0;
|
||||||
const HRESULT hr = m_cif.debugSymbols->GetOffsetByLineWide(line,
|
const HRESULT hr = m_cif.debugSymbols->GetOffsetByLineWide(line,
|
||||||
const_cast<ushort*>(file.utf16()),
|
(wchar_t*)(file.utf16()),
|
||||||
&rc);
|
&rc);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
*errorMessage = QString::fromLatin1("Unable to determine address of %1:%2 : %3").
|
*errorMessage = QString::fromLatin1("Unable to determine address of %1:%2 : %3").
|
||||||
|
|||||||
Reference in New Issue
Block a user