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));
QString workDir = QDir::toNativeSeparators(workingDirectory());
if (!workDir.isEmpty() && !workDir.endsWith('\\'))
workDir.append('\\');
if (!workDir.isEmpty() && !workDir.endsWith(QLatin1Char('\\')))
workDir.append(QLatin1Char('\\'));
QStringList stubArgs;
stubArgs << modeOption(d->m_mode)
<< d->m_stubServer.fullServerName()
<< workDir
<< (d->m_tempFile ? d->m_tempFile->fileName() : 0)
<< (d->m_tempFile ? d->m_tempFile->fileName() : QString())
<< createWinCommandline(pcmd, pargs)
<< msgPromptToClose();

View File

@@ -48,7 +48,7 @@ public:
lib.cd(QLatin1String("../lib"));
QString toReplace = lib.path();
lib.cd(QLatin1String("qtcreator"));
toReplace.append(QLatin1String(":"));
toReplace.append(QLatin1Char(':'));
toReplace.append(lib.path());
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) {
// Use html to enable text wrapping
value = Qt::escape(value);
value.prepend("<html><body>");
value.append("</body></html>");
value.prepend(QLatin1String("<html><body>"));
value.append(QLatin1String("</body></html>"));
}
return value;
}

View File

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

View File

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

View File

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