Utils: Compile with QT_NO_CAST_FROM_ASCII

Change-Id: Id600156bb3cef3aeea5d8b4d6bf879e77d755710
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
This commit is contained in:
Orgad Shaneh
2012-11-27 21:59:23 +02:00
committed by Orgad Shaneh
parent 2f862681d7
commit 55948453cd
6 changed files with 12 additions and 10 deletions

View File

@@ -120,14 +120,14 @@ bool ConsoleProcess::start(const QString &program, const QString &args)
ZeroMemory(d->m_pid, sizeof(PROCESS_INFORMATION)); ZeroMemory(d->m_pid, sizeof(PROCESS_INFORMATION));
QString workDir = QDir::toNativeSeparators(workingDirectory()); QString workDir = QDir::toNativeSeparators(workingDirectory());
if (!workDir.isEmpty() && !workDir.endsWith('\\')) if (!workDir.isEmpty() && !workDir.endsWith(QLatin1Char('\\')))
workDir.append('\\'); workDir.append(QLatin1Char('\\'));
QStringList stubArgs; QStringList stubArgs;
stubArgs << modeOption(d->m_mode) stubArgs << modeOption(d->m_mode)
<< d->m_stubServer.fullServerName() << d->m_stubServer.fullServerName()
<< workDir << workDir
<< (d->m_tempFile ? d->m_tempFile->fileName() : 0) << (d->m_tempFile ? d->m_tempFile->fileName() : QString())
<< createWinCommandline(pcmd, pargs) << createWinCommandline(pcmd, pargs)
<< msgPromptToClose(); << msgPromptToClose();

View File

@@ -48,7 +48,7 @@ public:
lib.cd(QLatin1String("../lib")); lib.cd(QLatin1String("../lib"));
QString toReplace = lib.path(); QString toReplace = lib.path();
lib.cd(QLatin1String("qtcreator")); lib.cd(QLatin1String("qtcreator"));
toReplace.append(QLatin1String(":")); toReplace.append(QLatin1Char(':'));
toReplace.append(lib.path()); toReplace.append(lib.path());
if (ldLibraryPath.startsWith(toReplace)) if (ldLibraryPath.startsWith(toReplace))

View File

@@ -153,8 +153,8 @@ QVariant EnvironmentModel::data(const QModelIndex &index, int role) const
if (role == Qt::ToolTipRole && value.length() > 80) { if (role == Qt::ToolTipRole && value.length() > 80) {
// Use html to enable text wrapping // Use html to enable text wrapping
value = Qt::escape(value); value = Qt::escape(value);
value.prepend("<html><body>"); value.prepend(QLatin1String("<html><body>"));
value.append("</body></html>"); value.append(QLatin1String("</body></html>"));
} }
return value; return value;
} }

View File

@@ -169,7 +169,7 @@ void TcpPortsGathererPrivate::updateLinux(TcpPortsGatherer::ProtocolFlags protoc
)); ));
while (!file.atEnd()) { while (!file.atEnd()) {
QByteArray line = file.readLine(); QByteArray line = file.readLine();
if (pattern.indexIn(line) != -1) { if (pattern.indexIn(QLatin1String(line)) != -1) {
bool isNumber; bool isNumber;
quint16 port = pattern.cap(1).toUShort(&isNumber, 16); quint16 port = pattern.cap(1).toUShort(&isNumber, 16);
QTC_ASSERT(isNumber, continue); QTC_ASSERT(isNumber, continue);
@@ -213,12 +213,12 @@ void TcpPortsGathererPrivate::updateNetstat(TcpPortsGatherer::ProtocolFlags prot
"\\s+\\d+" // whitespace, number (Recv-Q) "\\s+\\d+" // whitespace, number (Recv-Q)
"\\s+\\d+" // whitespace, number (Send-Q) "\\s+\\d+" // whitespace, number (Send-Q)
"\\s+(\\S+)")); // whitespace, Local Address "\\s+(\\S+)")); // whitespace, Local Address
if (pattern.indexIn(line) != -1) { if (pattern.indexIn(QLatin1String(line)) != -1) {
QString localAddress = pattern.cap(1); QString localAddress = pattern.cap(1);
// Examples of local addresses: // Examples of local addresses:
// '*.56501' , '*.*' 'fe80::1%lo0.123' // '*.56501' , '*.*' 'fe80::1%lo0.123'
int portDelimiterPos = localAddress.lastIndexOf("."); int portDelimiterPos = localAddress.lastIndexOf(QLatin1Char('.'));
if (portDelimiterPos == -1) if (portDelimiterPos == -1)
continue; continue;

View File

@@ -9,6 +9,8 @@ QT += script network
CONFIG += exceptions # used by portlist.cpp, textfileformat.cpp, and ssh/* CONFIG += exceptions # used by portlist.cpp, textfileformat.cpp, and ssh/*
DEFINES += QT_NO_CAST_FROM_ASCII
win32-msvc* { win32-msvc* {
# disable warnings caused by botan headers # disable warnings caused by botan headers
QMAKE_CXXFLAGS += -wd4250 -wd4290 QMAKE_CXXFLAGS += -wd4250 -wd4290

View File

@@ -4,7 +4,7 @@ import "../QtcLibrary.qbs" as QtcLibrary
QtcLibrary { QtcLibrary {
name: "Utils" name: "Utils"
cpp.defines: base.concat(["QTCREATOR_UTILS_LIB"]) cpp.defines: base.concat(["QTCREATOR_UTILS_LIB", "QT_NO_CAST_FROM_ASCII"])
Properties { Properties {
condition: qbs.targetOS == "windows" condition: qbs.targetOS == "windows"