summaryrefslogtreecommitdiff
path: root/src/plugins/clangcodemodel
diff options
context:
space:
mode:
authorChristian Kandeler <christian.kandeler@digia.com>2014-08-28 17:33:47 +0200
committerChristian Kandeler <christian.kandeler@digia.com>2014-08-29 14:10:41 +0200
commit1d5091e48f6df341dbd4436843c25afe25cbf4ce (patch)
tree9151d71b36bcffbba219ef1a0fc4e4f234adbc89 /src/plugins/clangcodemodel
parent7ba0f8a4c42c5db144b599861f38d2e771e0dafe (diff)
downloadqt-creator-1d5091e48f6df341dbd4436843c25afe25cbf4ce.tar.gz
Do not use deprecated Qt functionality.
Replace all* remaining deprecated Qt 4 functions with their Qt 5 counterparts. This means we no longer need to define the QT_DISABLE_DEPRECATED_BEFORE macro. This patch is relatively small because most source-compatible changes of this kind have been done before. * The one exception is the QmlDesigner, which uses QWeakPointer in a deprecated way all over the place. Change-Id: Id4b839c6685f3b5bdf2b89137f95231758ec53c7 Reviewed-by: Eike Ziller <eike.ziller@digia.com> Reviewed-by: hjk <hjk121@nokiamail.com>
Diffstat (limited to 'src/plugins/clangcodemodel')
-rw-r--r--src/plugins/clangcodemodel/clangcompletion.cpp6
-rw-r--r--src/plugins/clangcodemodel/completionproposalsbuilder.cpp24
-rw-r--r--src/plugins/clangcodemodel/test/clangcompletion_test.cpp10
3 files changed, 20 insertions, 20 deletions
diff --git a/src/plugins/clangcodemodel/clangcompletion.cpp b/src/plugins/clangcodemodel/clangcompletion.cpp
index 412b7f2ee8..96d2da62c2 100644
--- a/src/plugins/clangcodemodel/clangcompletion.cpp
+++ b/src/plugins/clangcodemodel/clangcompletion.cpp
@@ -311,11 +311,11 @@ QString ClangFunctionHintModel::text(int index) const
const int end = overview.markedArgumentEnd();
QString hintText;
- hintText += Qt::escape(prettyMethod.left(begin));
+ hintText += prettyMethod.left(begin).toHtmlEscaped());
hintText += "<b>";
- hintText += Qt::escape(prettyMethod.mid(begin, end - begin));
+ hintText += prettyMethod.mid(begin, end - begin).toHtmlEscaped());
hintText += "</b>";
- hintText += Qt::escape(prettyMethod.mid(end));
+ hintText += prettyMethod.mid(end).toHtmlEscaped());
return hintText;
#endif
return m_functionSymbols.at(index).hint();
diff --git a/src/plugins/clangcodemodel/completionproposalsbuilder.cpp b/src/plugins/clangcodemodel/completionproposalsbuilder.cpp
index ac388f0327..021e1b1c1a 100644
--- a/src/plugins/clangcodemodel/completionproposalsbuilder.cpp
+++ b/src/plugins/clangcodemodel/completionproposalsbuilder.cpp
@@ -91,7 +91,7 @@ void CompletionProposalsBuilder::operator ()(const CXCompletionResult &cxResult)
#if defined(CINDEX_VERSION) && (CINDEX_VERSION > 5)
const QString brief = Internal::getQString(clang_getCompletionBriefComment(cxResult.CompletionString));
if (!brief.isEmpty())
- m_comment += QLatin1String("<b>Brief:</b> ") + Qt::escape(brief);
+ m_comment += (QLatin1String("<b>Brief:</b> ") + brief).toHtmlEscaped();
#endif
if (m_resultAvailability == CodeCompletionResult::Deprecated) {
@@ -384,12 +384,12 @@ void CompletionProposalsBuilder::concatChunksForObjectiveCMessage(const CXComple
const QString text = Internal::getQString(clang_getCompletionChunkText(cxString, index), false);
if (chunkKind == CXCompletionChunk_ResultType) {
hintPrefix += QLatin1String("(");
- hintPrefix += Qt::escape(text);
+ hintPrefix += text.toHtmlEscaped();
hintPrefix += QLatin1String(") ");
indentBonus += 3 + text.length();
addSpaceAtPrefixEnd = false;
} else {
- hintPrefix += Qt::escape(text);
+ hintPrefix += text.toHtmlEscaped();
indentBonus += text.length();
m_snippet += text;
}
@@ -426,12 +426,12 @@ void CompletionProposalsBuilder::concatChunksForObjectiveCMessage(const CXComple
case CXCompletionChunk_Comma:
case CXCompletionChunk_HorizontalSpace:
m_snippet += text;
- parts.back().text += Qt::escape(text);
+ parts.back().text += text.toHtmlEscaped();
break;
case CXCompletionChunk_Placeholder:
appendSnippet(text);
parts.back().text += QLatin1String("<b>");
- parts.back().text += Qt::escape(text);
+ parts.back().text += text.toHtmlEscaped();
parts.back().text += QLatin1String("</b>");
break;
case CXCompletionChunk_LeftAngle:
@@ -487,7 +487,7 @@ void CompletionProposalsBuilder::concatChunksForNestedName(const CXCompletionStr
case CXCompletionChunk_Comma:
case CXCompletionChunk_HorizontalSpace:
m_snippet += text;
- m_hint += Qt::escape(text);
+ m_hint += text.toHtmlEscaped();
break;
case CXCompletionChunk_Placeholder:
@@ -575,7 +575,7 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr
case CXCompletionChunk_Text:
case CXCompletionChunk_LeftAngle:
case CXCompletionChunk_RightAngle:
- m_hint += Qt::escape(text);
+ m_hint += text.toHtmlEscaped();
break;
case CXCompletionChunk_HorizontalSpace:
@@ -583,14 +583,14 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr
if (isInsideTemplateSpec) {
m_snippet += text;
}
- m_hint += Qt::escape(text);
+ m_hint += text.toHtmlEscaped();
break;
case CXCompletionChunk_Placeholder:
if (isInsideTemplateSpec) {
appendSnippet(text);
}
- m_hint += Qt::escape(text);
+ m_hint += text.toHtmlEscaped();
break;
case CXCompletionChunk_TypedText:
@@ -599,7 +599,7 @@ void CompletionProposalsBuilder::concatChunksOnlyTypedText(const CXCompletionStr
break;
case CXCompletionChunk_ResultType: {
- m_hint += Qt::escape(text);
+ m_hint += text.toHtmlEscaped();
QChar last = text[text.size() - 1];
if (last != QLatin1Char('*') && last != QLatin1Char('&'))
m_hint += QLatin1Char(' ');
@@ -698,7 +698,7 @@ void CompletionProposalsBuilder::appendOptionalChunks(const CXCompletionString &
switch (chunkKind) {
case CXCompletionChunk_Placeholder:
- chunk.hint += Qt::escape(text);
+ chunk.hint += text.toHtmlEscaped();
break;
case CXCompletionChunk_Comma:
@@ -742,7 +742,7 @@ void CompletionProposalsBuilder::appendSnippet(const QString &text)
void CompletionProposalsBuilder::appendHintBold(const QString &text)
{
m_hint += QLatin1String("<b>");
- m_hint += Qt::escape(text);
+ m_hint += text.toHtmlEscaped();
m_hint += QLatin1String("</b>");
}
diff --git a/src/plugins/clangcodemodel/test/clangcompletion_test.cpp b/src/plugins/clangcodemodel/test/clangcompletion_test.cpp
index e5c1c3aec1..86fb51ef23 100644
--- a/src/plugins/clangcodemodel/test/clangcompletion_test.cpp
+++ b/src/plugins/clangcodemodel/test/clangcompletion_test.cpp
@@ -187,10 +187,10 @@ void ClangCodeModelPlugin::test_CXX_snippets()
if (ccr.text() != text)
continue;
hasText = true;
- QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toAscii());
+ QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toLatin1());
}
const QString textError(QLatin1String("Text not found:") + text);
- QVERIFY2(hasText, textError.toAscii());
+ QVERIFY2(hasText, textError.toLatin1());
}
}
@@ -298,12 +298,12 @@ void ClangCodeModelPlugin::test_ObjC_hints()
if (ccr.text() != text)
continue;
hasText = true;
- QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toAscii());
- QVERIFY2(hint == ccr.hint(), hintError.arg(ccr.hint()).toAscii());
+ QVERIFY2(snippet == ccr.snippet(), snippetError.arg(ccr.snippet()).toLatin1());
+ QVERIFY2(hint == ccr.hint(), hintError.arg(ccr.hint()).toLatin1());
}
const QString textError(QString::fromLatin1("Text \"%1\" not found in set %2")
.arg(text).arg(texts.join(QLatin1Char(','))));
- QVERIFY2(hasText, textError.toAscii());
+ QVERIFY2(hasText, textError.toLatin1());
}
}