Commit 2ea3b234 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Friedemann Kleint

GLSLEditor: Compile with QT_NO_CAST_FROM_ASCII

Change-Id: I88114509d972c498c3891c45d5e1f9b7fc9d3f3f
Reviewed-by: default avatarFriedemann Kleint <Friedemann.Kleint@digia.com>
parent 9be874ba
......@@ -201,15 +201,15 @@ int GLSLFunctionHintProposalModel::activeArgument(const QString &prefix) const
// -----------------------------
GLSLCompletionAssistProcessor::GLSLCompletionAssistProcessor()
: m_startPosition(0)
, m_keywordIcon(":/glsleditor/images/keyword.png")
, m_varIcon(":/glsleditor/images/var.png")
, m_functionIcon(":/glsleditor/images/func.png")
, m_typeIcon(":/glsleditor/images/type.png")
, m_constIcon(":/glsleditor/images/const.png")
, m_attributeIcon(":/glsleditor/images/attribute.png")
, m_uniformIcon(":/glsleditor/images/uniform.png")
, m_varyingIcon(":/glsleditor/images/varying.png")
, m_otherIcon(":/glsleditor/images/other.png")
, m_keywordIcon(QLatin1String(":/glsleditor/images/keyword.png"))
, m_varIcon(QLatin1String(":/glsleditor/images/var.png"))
, m_functionIcon(QLatin1String(":/glsleditor/images/func.png"))
, m_typeIcon(QLatin1String(":/glsleditor/images/type.png"))
, m_constIcon(QLatin1String(":/glsleditor/images/const.png"))
, m_attributeIcon(QLatin1String(":/glsleditor/images/attribute.png"))
, m_uniformIcon(QLatin1String(":/glsleditor/images/uniform.png"))
, m_varyingIcon(QLatin1String(":/glsleditor/images/varying.png"))
, m_otherIcon(QLatin1String(":/glsleditor/images/other.png"))
{}
GLSLCompletionAssistProcessor::~GLSLCompletionAssistProcessor()
......
......@@ -5,7 +5,8 @@ include(glsleditor_dependencies.pri)
DEFINES += \
GLSLEDITOR_LIBRARY \
QT_CREATOR
QT_CREATOR \
QT_NO_CAST_FROM_ASCII
HEADERS += \
glsleditor.h \
......
......@@ -5,6 +5,7 @@ import "../QtcPlugin.qbs" as QtcPlugin
QtcPlugin {
name: "GLSLEditor"
Depends { name: "cpp" }
Depends { name: "Qt.widgets" }
Depends { name: "Core" }
Depends { name: "TextEditor" }
......@@ -12,6 +13,7 @@ QtcPlugin {
Depends { name: "CppTools" }
Depends { name: "GLSL" }
Depends { name: "CPlusPlus" }
cpp.defines: base.concat(["QT_NO_CAST_FROM_ASCII"])
files: [
"GLSLEditor.mimetypes.xml",
......
......@@ -138,7 +138,7 @@ bool GLSLEditorPlugin::initialize(const QStringList & /*arguments*/, QString *er
// Insert marker for "Refactoring" menu:
Core::Context globalContext(Core::Constants::C_GLOBAL);
Core::Command *sep = contextMenu->addSeparator(globalContext);
sep->action()->setObjectName(Constants::M_REFACTORING_MENU_INSERTION_POINT);
sep->action()->setObjectName(QLatin1String(Constants::M_REFACTORING_MENU_INSERTION_POINT));
contextMenu->addSeparator(globalContext);
cmd = Core::ActionManager::command(TextEditor::Constants::UN_COMMENT_SELECTION);
......
......@@ -270,48 +270,48 @@ bool Highlighter::isPPKeyword(const QStringRef &text) const
switch (text.length())
{
case 2:
if (text.at(0) == 'i' && text.at(1) == 'f')
if (text.at(0) == QLatin1Char('i') && text.at(1) == QLatin1Char('f'))
return true;
break;
case 4:
if (text.at(0) == 'e' && text == QLatin1String("elif"))
if (text.at(0) == QLatin1Char('e') && text == QLatin1String("elif"))
return true;
else if (text.at(0) == 'e' && text == QLatin1String("else"))
else if (text.at(0) == QLatin1Char('e') && text == QLatin1String("else"))
return true;
break;
case 5:
if (text.at(0) == 'i' && text == QLatin1String("ifdef"))
if (text.at(0) == QLatin1Char('i') && text == QLatin1String("ifdef"))
return true;
else if (text.at(0) == 'u' && text == QLatin1String("undef"))
else if (text.at(0) == QLatin1Char('u') && text == QLatin1String("undef"))
return true;
else if (text.at(0) == 'e' && text == QLatin1String("endif"))
else if (text.at(0) == QLatin1Char('e') && text == QLatin1String("endif"))
return true;
else if (text.at(0) == 'e' && text == QLatin1String("error"))
else if (text.at(0) == QLatin1Char('e') && text == QLatin1String("error"))
return true;
break;
case 6:
if (text.at(0) == 'i' && text == QLatin1String("ifndef"))
if (text.at(0) == QLatin1Char('i') && text == QLatin1String("ifndef"))
return true;
if (text.at(0) == 'i' && text == QLatin1String("import"))
if (text.at(0) == QLatin1Char('i') && text == QLatin1String("import"))
return true;
else if (text.at(0) == 'd' && text == QLatin1String("define"))
else if (text.at(0) == QLatin1Char('d') && text == QLatin1String("define"))
return true;
else if (text.at(0) == 'p' && text == QLatin1String("pragma"))
else if (text.at(0) == QLatin1Char('p') && text == QLatin1String("pragma"))
return true;
break;
case 7:
if (text.at(0) == 'i' && text == QLatin1String("include"))
if (text.at(0) == QLatin1Char('i') && text == QLatin1String("include"))
return true;
else if (text.at(0) == 'w' && text == QLatin1String("warning"))
else if (text.at(0) == QLatin1Char('w') && text == QLatin1String("warning"))
return true;
break;
case 12:
if (text.at(0) == 'i' && text == QLatin1String("include_next"))
if (text.at(0) == QLatin1Char('i') && text == QLatin1String("include_next"))
return true;
break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment