CMake: Compile with QT_NO_CAST_FROM_ASCII

Change-Id: I23134b7eef222dcdb3425e2f2f6d62ab863009fe
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
This commit is contained in:
Orgad Shaneh
2012-11-21 23:54:06 +02:00
committed by Daniel Teske
parent b5bfb81508
commit 862629c57a
13 changed files with 109 additions and 103 deletions

View File

@@ -37,7 +37,7 @@
using namespace CMakeProjectManager::Internal;
static bool isVariable(const QString &word)
static bool isVariable(const QByteArray &word)
{
if (word.length() < 4) // must be at least "${.}"
return false;
@@ -53,14 +53,14 @@ CMakeHighlighter::CMakeHighlighter(QTextDocument *document) :
void CMakeHighlighter::highlightBlock(const QString &text)
{
QString buf;
QByteArray buf;
bool inCommentMode = false;
bool inStringMode = (previousBlockState() == 1);
QTextCharFormat emptyFormat;
int i=0;
for (i=0; i < text.length(); i++) {
const QChar c = text.at(i);
char c = text.at(i).toLatin1();
if (inCommentMode) {
setFormat(i, 1, m_formats[CMakeCommentFormat]);
} else {
@@ -80,7 +80,7 @@ void CMakeHighlighter::highlightBlock(const QString &text)
} else {
buf += c;
}
} else if (c.isSpace()) {
} else if (text.at(i).isSpace()) {
if (!inStringMode)
buf.clear();
else