forked from qt-creator/qt-creator
Utils: More porting.h related changes
Change-Id: I528a6950dfa6e09eb7f7ada265c8c41dba816bfd Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include "LookupContext.h"
|
#include "LookupContext.h"
|
||||||
|
|
||||||
#include "ResolveExpression.h"
|
|
||||||
#include "Overview.h"
|
#include "Overview.h"
|
||||||
#include "DeprecatedGenTemplateInstance.h"
|
#include "DeprecatedGenTemplateInstance.h"
|
||||||
#include "CppRewriter.h"
|
#include "CppRewriter.h"
|
||||||
@@ -38,7 +37,6 @@
|
|||||||
#include <cplusplus/Control.h>
|
#include <cplusplus/Control.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QStack>
|
#include <QStack>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <cplusplus/FullySpecifiedType.h>
|
#include <cplusplus/FullySpecifiedType.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
|
||||||
|
@@ -38,7 +38,6 @@
|
|||||||
#include "qmt/infrastructure/qmtassert.h"
|
#include "qmt/infrastructure/qmtassert.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
|
||||||
|
@@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
#include "qmt/diagram/dobject.h"
|
#include "qmt/diagram/dobject.h"
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
|
|
||||||
namespace qmt {
|
namespace qmt {
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
#include "qmldebugclient.h"
|
#include "qmldebugclient.h"
|
||||||
#include "qpacketprotocol.h"
|
#include "qpacketprotocol.h"
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/temporaryfile.h>
|
#include <utils/temporaryfile.h>
|
||||||
|
|
||||||
#include <QLocalServer>
|
#include <QLocalServer>
|
||||||
|
@@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
#include "qmleditorwidgets_global.h"
|
#include "qmleditorwidgets_global.h"
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
QT_BEGIN_NAMESPACE
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#include "qmljscodeformatter.h"
|
#include "qmljscodeformatter.h"
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QLoggingCategory>
|
#include <QLoggingCategory>
|
||||||
#include <QMetaEnum>
|
#include <QMetaEnum>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
@@ -229,7 +227,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case property_list_open: {
|
case property_list_open: {
|
||||||
const QStringView tok = Utils::midView(m_currentLine,
|
const QStringView tok = QStringView(m_currentLine).mid(
|
||||||
m_currentToken.begin(),
|
m_currentToken.begin(),
|
||||||
m_currentToken.length);
|
m_currentToken.length);
|
||||||
if (tok == QLatin1String(">"))
|
if (tok == QLatin1String(">"))
|
||||||
@@ -876,7 +874,7 @@ int CodeFormatter::column(int index) const
|
|||||||
|
|
||||||
QStringView CodeFormatter::currentTokenText() const
|
QStringView CodeFormatter::currentTokenText() const
|
||||||
{
|
{
|
||||||
return Utils::midView(m_currentLine, m_currentToken.begin(), m_currentToken.length);
|
return QStringView(m_currentLine).mid(m_currentToken.begin(), m_currentToken.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CodeFormatter::turnInto(int newState)
|
void CodeFormatter::turnInto(int newState)
|
||||||
@@ -950,7 +948,7 @@ int CodeFormatter::tokenizeBlock(const QTextBlock &block)
|
|||||||
CodeFormatter::TokenKind CodeFormatter::extendedTokenKind(const QmlJS::Token &token) const
|
CodeFormatter::TokenKind CodeFormatter::extendedTokenKind(const QmlJS::Token &token) const
|
||||||
{
|
{
|
||||||
const int kind = token.kind;
|
const int kind = token.kind;
|
||||||
const QStringView text = Utils::midView(m_currentLine, token.begin(), token.length);
|
const QStringView text = QStringView(m_currentLine).mid(token.begin(), token.length);
|
||||||
|
|
||||||
if (kind == Identifier) {
|
if (kind == Identifier) {
|
||||||
if (text == QLatin1String("as"))
|
if (text == QLatin1String("as"))
|
||||||
|
@@ -26,8 +26,6 @@
|
|||||||
#include "qmljscompletioncontextfinder.h"
|
#include "qmljscompletioncontextfinder.h"
|
||||||
#include "qmljsscanner.h"
|
#include "qmljsscanner.h"
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
|
||||||
@@ -163,7 +161,7 @@ void CompletionContextFinder::checkBinding()
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case Token::Identifier: {
|
case Token::Identifier: {
|
||||||
const QStringView tokenString = Utils::midView(*yyLine, token.begin(), token.length);
|
const QStringView tokenString = QStringView(*yyLine).mid(token.begin(), token.length);
|
||||||
dotExpected = false;
|
dotExpected = false;
|
||||||
if (identifierExpected) {
|
if (identifierExpected) {
|
||||||
m_bindingPropertyName.prepend(tokenString.toString());
|
m_bindingPropertyName.prepend(tokenString.toString());
|
||||||
@@ -233,7 +231,7 @@ void CompletionContextFinder::checkImport()
|
|||||||
|
|
||||||
switch (token.kind) {
|
switch (token.kind) {
|
||||||
case Token::Identifier: {
|
case Token::Identifier: {
|
||||||
const QStringView tokenString = Utils::midView(*yyLine, token.begin(), token.length);
|
const QStringView tokenString = QStringView(*yyLine).mid(token.begin(), token.length);
|
||||||
if (tokenString == QLatin1String("as")) {
|
if (tokenString == QLatin1String("as")) {
|
||||||
isInLibVersionImport = 0;
|
isInLibVersionImport = 0;
|
||||||
if (state == Unknown) {
|
if (state == Unknown) {
|
||||||
|
@@ -27,8 +27,7 @@
|
|||||||
|
|
||||||
#include "qmljs_global.h"
|
#include "qmljs_global.h"
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/filepath.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
#include "qmljsdialect.h"
|
#include "qmljsdialect.h"
|
||||||
|
|
||||||
#include <languageutils/componentversion.h>
|
#include <languageutils/componentversion.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
#include <qmljs/parser/qmljsastfwd_p.h>
|
#include <qmljs/parser/qmljsastfwd_p.h>
|
||||||
|
|
||||||
#include <languageutils/fakemetaobject.h>
|
#include <languageutils/fakemetaobject.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QFileInfoList>
|
#include <QFileInfoList>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
|
@@ -64,8 +64,6 @@
|
|||||||
#include <qmljs/qmljslineinfo.h>
|
#include <qmljs/qmljslineinfo.h>
|
||||||
#include <qmljs/qmljsscanner.h>
|
#include <qmljs/qmljsscanner.h>
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -281,7 +279,7 @@ Token LineInfo::lastToken() const
|
|||||||
|
|
||||||
QStringView LineInfo::tokenText(const Token &token) const
|
QStringView LineInfo::tokenText(const Token &token) const
|
||||||
{
|
{
|
||||||
return Utils::midView(yyLinizerState.line, token.offset, token.length);
|
return QStringView(yyLinizerState.line).mid(token.offset, token.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -34,7 +34,6 @@
|
|||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/qrcparser.h>
|
#include <utils/qrcparser.h>
|
||||||
|
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
|
@@ -31,6 +31,7 @@
|
|||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
#include <QVariant>
|
||||||
|
|
||||||
#include <functional>
|
#include <functional>
|
||||||
|
|
||||||
|
@@ -264,10 +264,9 @@ MimeMagicRule::MimeMagicRule(const QString &type,
|
|||||||
// Parse for offset as "1" or "1:10"
|
// Parse for offset as "1" or "1:10"
|
||||||
const int colonIndex = offsets.indexOf(QLatin1Char(':'));
|
const int colonIndex = offsets.indexOf(QLatin1Char(':'));
|
||||||
const QStringView startPosStr
|
const QStringView startPosStr
|
||||||
= Utils::midView(offsets, 0, colonIndex); // \ These decay to returning 'offsets'
|
= QStringView(offsets).mid(0, colonIndex); // \ These decay to returning 'offsets'
|
||||||
const QStringView endPosStr = Utils::midView(offsets,
|
const QStringView endPosStr = QStringView(offsets)
|
||||||
colonIndex
|
.mid(colonIndex + 1); // / unchanged when colonIndex == -1
|
||||||
+ 1); // / unchanged when colonIndex == -1
|
|
||||||
if (Q_UNLIKELY(!MimeTypeParserBase::parseNumber(startPosStr, &m_startPos, errorString)) ||
|
if (Q_UNLIKELY(!MimeTypeParserBase::parseNumber(startPosStr, &m_startPos, errorString)) ||
|
||||||
Q_UNLIKELY(!MimeTypeParserBase::parseNumber(endPosStr, &m_endPos, errorString))) {
|
Q_UNLIKELY(!MimeTypeParserBase::parseNumber(endPosStr, &m_endPos, errorString))) {
|
||||||
m_type = Invalid;
|
m_type = Invalid;
|
||||||
|
@@ -42,10 +42,11 @@
|
|||||||
#include "mimedatabase.h"
|
#include "mimedatabase.h"
|
||||||
#include "mimedatabase_p.h"
|
#include "mimedatabase_p.h"
|
||||||
#include "mimemagicrule_p.h"
|
#include "mimemagicrule_p.h"
|
||||||
#include "mimeprovider_p.h"
|
|
||||||
|
|
||||||
#include "filepath.h"
|
#include "filepath.h"
|
||||||
|
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
|
||||||
MimeType mimeTypeForName(const QString &nameOrAlias)
|
MimeType mimeTypeForName(const QString &nameOrAlias)
|
||||||
|
@@ -27,9 +27,6 @@
|
|||||||
|
|
||||||
#include "utils_global.h"
|
#include "utils_global.h"
|
||||||
|
|
||||||
#ifdef QT_GUI_LIB
|
|
||||||
#include <QEnterEvent>
|
|
||||||
#endif
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
namespace Utils {
|
namespace Utils {
|
||||||
|
@@ -27,8 +27,6 @@
|
|||||||
|
|
||||||
#include <debugger/analyzer/diagnosticlocation.h>
|
#include <debugger/analyzer/diagnosticlocation.h>
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QVector>
|
#include <QVector>
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
@@ -28,7 +28,6 @@
|
|||||||
#include "cmake_global.h"
|
#include "cmake_global.h"
|
||||||
|
|
||||||
#include <utils/optional.h>
|
#include <utils/optional.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QByteArray>
|
#include <QByteArray>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/infobar.h>
|
#include <utils/infobar.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
@@ -32,7 +32,6 @@
|
|||||||
#include "locator/locatormanager.h"
|
#include "locator/locatormanager.h"
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include "pastebindotcomprotocol.h"
|
#include "pastebindotcomprotocol.h"
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@@ -26,7 +26,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
namespace Cppcheck {
|
namespace Cppcheck {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
@@ -34,8 +34,6 @@
|
|||||||
#include <cplusplus/SimpleLexer.h>
|
#include <cplusplus/SimpleLexer.h>
|
||||||
#include <cplusplus/Lexer.h>
|
#include <cplusplus/Lexer.h>
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
|
|
||||||
using namespace CppEditor;
|
using namespace CppEditor;
|
||||||
@@ -160,9 +158,9 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
formatForCategory(C_PREPROCESSOR));
|
formatForCategory(C_PREPROCESSOR));
|
||||||
expectPreprocessorKeyword = true;
|
expectPreprocessorKeyword = true;
|
||||||
} else if (highlightCurrentWordAsPreprocessor && (tk.isKeyword() || tk.is(T_IDENTIFIER))
|
} else if (highlightCurrentWordAsPreprocessor && (tk.isKeyword() || tk.is(T_IDENTIFIER))
|
||||||
&& isPPKeyword(Utils::midView(text, tk.utf16charsBegin(), tk.utf16chars()))) {
|
&& isPPKeyword(QStringView(text).mid(tk.utf16charsBegin(), tk.utf16chars()))) {
|
||||||
setFormat(tk.utf16charsBegin(), tk.utf16chars(), formatForCategory(C_PREPROCESSOR));
|
setFormat(tk.utf16charsBegin(), tk.utf16chars(), formatForCategory(C_PREPROCESSOR));
|
||||||
const QStringView ppKeyword = Utils::midView(text, tk.utf16charsBegin(), tk.utf16chars());
|
const QStringView ppKeyword = QStringView(text).mid(tk.utf16charsBegin(), tk.utf16chars());
|
||||||
if (ppKeyword == QLatin1String("error")
|
if (ppKeyword == QLatin1String("error")
|
||||||
|| ppKeyword == QLatin1String("warning")
|
|| ppKeyword == QLatin1String("warning")
|
||||||
|| ppKeyword == QLatin1String("pragma")) {
|
|| ppKeyword == QLatin1String("pragma")) {
|
||||||
@@ -221,7 +219,7 @@ void CppHighlighter::highlightBlock(const QString &text)
|
|||||||
} else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON)) {
|
} else if (i == 0 && tokens.size() > 1 && tk.is(T_IDENTIFIER) && tokens.at(1).is(T_COLON)) {
|
||||||
setFormat(tk.utf16charsBegin(), tk.utf16chars(), formatForCategory(C_LABEL));
|
setFormat(tk.utf16charsBegin(), tk.utf16chars(), formatForCategory(C_LABEL));
|
||||||
} else if (tk.is(T_IDENTIFIER)) {
|
} else if (tk.is(T_IDENTIFIER)) {
|
||||||
highlightWord(Utils::midView(text, tk.utf16charsBegin(), tk.utf16chars()),
|
highlightWord(QStringView(text).mid(tk.utf16charsBegin(), tk.utf16chars()),
|
||||||
tk.utf16charsBegin(),
|
tk.utf16charsBegin(),
|
||||||
tk.utf16chars());
|
tk.utf16chars());
|
||||||
}
|
}
|
||||||
|
@@ -50,7 +50,6 @@
|
|||||||
#include <cplusplus/Overview.h>
|
#include <cplusplus/Overview.h>
|
||||||
#include <cplusplus/SimpleLexer.h>
|
#include <cplusplus/SimpleLexer.h>
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/textutils.h>
|
#include <utils/textutils.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
@@ -321,7 +320,7 @@ bool isInCommentOrString(const TextEditor::AssistInterface *interface,
|
|||||||
&& tokens.at(1).kind() == T_IDENTIFIER) {
|
&& tokens.at(1).kind() == T_IDENTIFIER) {
|
||||||
const QString &line = tc.block().text();
|
const QString &line = tc.block().text();
|
||||||
const Token &idToken = tokens.at(1);
|
const Token &idToken = tokens.at(1);
|
||||||
QStringView identifier = Utils::midView(line, idToken.utf16charsBegin(),
|
QStringView identifier = QStringView(line).mid(idToken.utf16charsBegin(),
|
||||||
idToken.utf16chars());
|
idToken.utf16chars());
|
||||||
if (identifier == QLatin1String("include")
|
if (identifier == QLatin1String("include")
|
||||||
|| identifier == QLatin1String("include_next")
|
|| identifier == QLatin1String("include_next")
|
||||||
|
@@ -1010,7 +1010,7 @@ void CdbEngine::runCommand(const DebuggerCommand &dbgCmd)
|
|||||||
QList<QStringView> splittedArguments;
|
QList<QStringView> splittedArguments;
|
||||||
int maxArgumentSize = maxCommandLength - prefix.length() - maxTokenLength;
|
int maxArgumentSize = maxCommandLength - prefix.length() - maxTokenLength;
|
||||||
while (argumentSplitPos < arguments.size()) {
|
while (argumentSplitPos < arguments.size()) {
|
||||||
splittedArguments << midView(arguments, argumentSplitPos, maxArgumentSize);
|
splittedArguments << QStringView(arguments).mid(argumentSplitPos, maxArgumentSize);
|
||||||
argumentSplitPos += splittedArguments.last().length();
|
argumentSplitPos += splittedArguments.last().length();
|
||||||
}
|
}
|
||||||
QTC_CHECK(argumentSplitPos == arguments.size());
|
QTC_CHECK(argumentSplitPos == arguments.size());
|
||||||
|
@@ -49,7 +49,6 @@
|
|||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/tooltip/tooltip.h>
|
#include <utils/tooltip/tooltip.h>
|
||||||
#include <utils/stringutils.h>
|
#include <utils/stringutils.h>
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/differ.h>
|
#include <utils/differ.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QFutureInterfaceBase>
|
#include <QFutureInterfaceBase>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
@@ -45,7 +45,6 @@
|
|||||||
#include <coreplugin/find/highlightscrollbarcontroller.h>
|
#include <coreplugin/find/highlightscrollbarcontroller.h>
|
||||||
#include <coreplugin/minisplitter.h>
|
#include <coreplugin/minisplitter.h>
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/tooltip/tooltip.h>
|
#include <utils/tooltip/tooltip.h>
|
||||||
|
|
||||||
using namespace Core;
|
using namespace Core;
|
||||||
|
@@ -31,8 +31,6 @@
|
|||||||
#include <texteditor/textdocumentlayout.h>
|
#include <texteditor/textdocumentlayout.h>
|
||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
using namespace TextEditor;
|
using namespace TextEditor;
|
||||||
@@ -155,7 +153,7 @@ void GlslHighlighter::highlightBlock(const QString &text)
|
|||||||
highlightAsPreprocessor = true;
|
highlightAsPreprocessor = true;
|
||||||
|
|
||||||
} else if (highlightCurrentWordAsPreprocessor
|
} else if (highlightCurrentWordAsPreprocessor
|
||||||
&& isPPKeyword(Utils::midView(text, tk.begin(), tk.length))) {
|
&& isPPKeyword(QStringView(text).mid(tk.begin(), tk.length))) {
|
||||||
setFormat(tk.begin(), tk.length, formatForCategory(C_PREPROCESSOR));
|
setFormat(tk.begin(), tk.length, formatForCategory(C_PREPROCESSOR));
|
||||||
|
|
||||||
} else if (tk.is(GLSL::Parser::T_NUMBER)) {
|
} else if (tk.is(GLSL::Parser::T_NUMBER)) {
|
||||||
|
@@ -25,13 +25,12 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/porting.h>
|
#include <utils/filepath.h>
|
||||||
|
|
||||||
#include <QSettings>
|
#include <QSettings>
|
||||||
#include <QSharedPointer>
|
#include <QSharedPointer>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <utils/fileutils.h>
|
|
||||||
|
|
||||||
namespace Ios {
|
namespace Ios {
|
||||||
|
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
|
|
||||||
|
@@ -44,7 +44,6 @@
|
|||||||
#include <projectexplorer/projectnodes.h>
|
#include <projectexplorer/projectnodes.h>
|
||||||
|
|
||||||
#include <utils/mimeutils.h>
|
#include <utils/mimeutils.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
#include <QQueue>
|
#include <QQueue>
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
|
|
||||||
namespace qmt { class Uid; }
|
namespace qmt { class Uid; }
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/filepath.h>
|
#include <utils/filepath.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QList>
|
#include <QList>
|
||||||
|
|
||||||
|
@@ -27,8 +27,7 @@
|
|||||||
|
|
||||||
#include "projectexplorer_export.h"
|
#include "projectexplorer_export.h"
|
||||||
|
|
||||||
#include <utils/fileutils.h>
|
#include <utils/filepath.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QHash>
|
#include <QHash>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
@@ -29,7 +29,6 @@
|
|||||||
|
|
||||||
#include <utils/id.h>
|
#include <utils/id.h>
|
||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QIcon>
|
#include <QIcon>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
|
@@ -30,6 +30,7 @@
|
|||||||
|
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
|
#include <QUrl>
|
||||||
|
|
||||||
namespace Python {
|
namespace Python {
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
@@ -31,7 +31,6 @@
|
|||||||
|
|
||||||
#include <coreplugin/idocument.h>
|
#include <coreplugin/idocument.h>
|
||||||
#include <cppeditor/generatedcodemodelsupport.h>
|
#include <cppeditor/generatedcodemodelsupport.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/textfileformat.h>
|
#include <utils/textfileformat.h>
|
||||||
|
|
||||||
#include <QFutureWatcher>
|
#include <QFutureWatcher>
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QStringList>
|
#include <QStringList>
|
||||||
#include <QMetaType>
|
#include <QMetaType>
|
||||||
|
@@ -29,6 +29,7 @@
|
|||||||
|
|
||||||
#include <documentmessage.h>
|
#include <documentmessage.h>
|
||||||
|
|
||||||
|
#include <QMimeData>
|
||||||
#include <QObject>
|
#include <QObject>
|
||||||
#include <QPair>
|
#include <QPair>
|
||||||
|
|
||||||
|
@@ -38,8 +38,6 @@
|
|||||||
#include "internalnodeproperty.h"
|
#include "internalnodeproperty.h"
|
||||||
#include "internalnodeabstractproperty.h"
|
#include "internalnodeabstractproperty.h"
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
namespace QmlDesigner {
|
namespace QmlDesigner {
|
||||||
|
|
||||||
namespace Internal {
|
namespace Internal {
|
||||||
|
@@ -27,10 +27,6 @@
|
|||||||
|
|
||||||
#include <qmljs/qmljsscanner.h>
|
#include <qmljs/qmljsscanner.h>
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QChar>
|
|
||||||
#include <QLatin1Char>
|
|
||||||
#include <QTextDocument>
|
#include <QTextDocument>
|
||||||
#include <QTextCursor>
|
#include <QTextCursor>
|
||||||
#include <QTextBlock>
|
#include <QTextBlock>
|
||||||
@@ -175,7 +171,7 @@ bool AutoCompleter::contextAllowsAutoBrackets(const QTextCursor &cursor,
|
|||||||
|
|
||||||
case Token::String: {
|
case Token::String: {
|
||||||
const QString blockText = cursor.block().text();
|
const QString blockText = cursor.block().text();
|
||||||
const QStringView tokenText = Utils::midView(blockText, token.offset, token.length);
|
const QStringView tokenText = QStringView(blockText).mid(token.offset, token.length);
|
||||||
QChar quote = tokenText.at(0);
|
QChar quote = tokenText.at(0);
|
||||||
// if a string literal doesn't start with a quote, it must be multiline
|
// if a string literal doesn't start with a quote, it must be multiline
|
||||||
if (quote != QLatin1Char('"') && quote != QLatin1Char('\'')) {
|
if (quote != QLatin1Char('"') && quote != QLatin1Char('\'')) {
|
||||||
@@ -219,7 +215,7 @@ bool AutoCompleter::contextAllowsAutoQuotes(const QTextCursor &cursor,
|
|||||||
|
|
||||||
case Token::String: {
|
case Token::String: {
|
||||||
const QString blockText = cursor.block().text();
|
const QString blockText = cursor.block().text();
|
||||||
const QStringView tokenText = Utils::midView(blockText, token.offset, token.length);
|
const QStringView tokenText = QStringView(blockText).mid(token.offset, token.length);
|
||||||
QChar quote = tokenText.at(0);
|
QChar quote = tokenText.at(0);
|
||||||
// if a string literal doesn't start with a quote, it must be multiline
|
// if a string literal doesn't start with a quote, it must be multiline
|
||||||
if (quote != QLatin1Char('"') && quote != QLatin1Char('\'')) {
|
if (quote != QLatin1Char('"') && quote != QLatin1Char('\'')) {
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include <QSet>
|
#include <QSet>
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
|
||||||
using namespace QmlJS;
|
using namespace QmlJS;
|
||||||
@@ -77,7 +76,7 @@ void QmlJSHighlighter::highlightBlock(const QString &text)
|
|||||||
|
|
||||||
case Token::Comment:
|
case Token::Comment:
|
||||||
if (m_inMultilineComment
|
if (m_inMultilineComment
|
||||||
&& Utils::midView(text, token.end() - 2, 2) == QLatin1String("*/")) {
|
&& QStringView(text).mid(token.end() - 2, 2) == QLatin1String("*/")) {
|
||||||
onClosingParenthesis(QLatin1Char('-'), token.end() - 1, index == tokens.size()-1);
|
onClosingParenthesis(QLatin1Char('-'), token.end() - 1, index == tokens.size()-1);
|
||||||
m_inMultilineComment = false;
|
m_inMultilineComment = false;
|
||||||
} else if (!m_inMultilineComment
|
} else if (!m_inMultilineComment
|
||||||
@@ -121,7 +120,7 @@ void QmlJSHighlighter::highlightBlock(const QString &text)
|
|||||||
if (!m_qmlEnabled)
|
if (!m_qmlEnabled)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
const QStringView spell = Utils::midView(text, token.offset, token.length);
|
const QStringView spell = QStringView(text).mid(token.offset, token.length);
|
||||||
|
|
||||||
if (maybeQmlKeyword(spell)) {
|
if (maybeQmlKeyword(spell)) {
|
||||||
// check the previous token
|
// check the previous token
|
||||||
@@ -131,7 +130,7 @@ void QmlJSHighlighter::highlightBlock(const QString &text)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Utils::midView(text, token.offset, token.length) == QLatin1String("enum")) {
|
if (QStringView(text).mid(token.offset, token.length) == QLatin1String("enum")) {
|
||||||
setFormat(token.offset, token.length, formatForCategory(C_KEYWORD));
|
setFormat(token.offset, token.length, formatForCategory(C_KEYWORD));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -139,7 +138,7 @@ void QmlJSHighlighter::highlightBlock(const QString &text)
|
|||||||
const Token &previousToken = tokens.at(index - 1);
|
const Token &previousToken = tokens.at(index - 1);
|
||||||
if (previousToken.is(Token::Identifier)
|
if (previousToken.is(Token::Identifier)
|
||||||
&& text.at(previousToken.offset) == QLatin1Char('p')
|
&& text.at(previousToken.offset) == QLatin1Char('p')
|
||||||
&& Utils::midView(text, previousToken.offset, previousToken.length)
|
&& QStringView(text).mid(previousToken.offset, previousToken.length)
|
||||||
== QLatin1String("property")) {
|
== QLatin1String("property")) {
|
||||||
setFormat(token.offset, token.length, formatForCategory(C_KEYWORD));
|
setFormat(token.offset, token.length, formatForCategory(C_KEYWORD));
|
||||||
break;
|
break;
|
||||||
@@ -148,7 +147,7 @@ void QmlJSHighlighter::highlightBlock(const QString &text)
|
|||||||
const Token &previousToken = tokens.at(0);
|
const Token &previousToken = tokens.at(0);
|
||||||
if (previousToken.is(Token::Identifier)
|
if (previousToken.is(Token::Identifier)
|
||||||
&& text.at(previousToken.offset) == QLatin1Char('e')
|
&& text.at(previousToken.offset) == QLatin1Char('e')
|
||||||
&& Utils::midView(text, previousToken.offset, previousToken.length)
|
&& QStringView(text).mid(previousToken.offset, previousToken.length)
|
||||||
== QLatin1String("enum")) {
|
== QLatin1String("enum")) {
|
||||||
setFormat(token.offset, token.length, formatForCategory(C_ENUMERATION));
|
setFormat(token.offset, token.length, formatForCategory(C_ENUMERATION));
|
||||||
break;
|
break;
|
||||||
|
@@ -25,8 +25,6 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QFrame>
|
#include <QFrame>
|
||||||
#include <QPen>
|
#include <QPen>
|
||||||
|
|
||||||
|
@@ -41,7 +41,6 @@
|
|||||||
#include <utils/elidinglabel.h>
|
#include <utils/elidinglabel.h>
|
||||||
#include <utils/link.h>
|
#include <utils/link.h>
|
||||||
#include <utils/multitextcursor.h>
|
#include <utils/multitextcursor.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/uncommentselection.h>
|
#include <utils/uncommentselection.h>
|
||||||
|
|
||||||
#include <QPlainTextEdit>
|
#include <QPlainTextEdit>
|
||||||
|
@@ -45,7 +45,6 @@
|
|||||||
#include <texteditor/textdocument.h>
|
#include <texteditor/textdocument.h>
|
||||||
#include <texteditor/textdocumentlayout.h>
|
#include <texteditor/textdocumentlayout.h>
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/progressindicator.h>
|
#include <utils/progressindicator.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/shellcommand.h>
|
#include <utils/shellcommand.h>
|
||||||
|
@@ -46,7 +46,6 @@
|
|||||||
#include <utils/fileutils.h>
|
#include <utils/fileutils.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/icon.h>
|
#include <utils/icon.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
#include <utils/styledbar.h>
|
#include <utils/styledbar.h>
|
||||||
#include <utils/theme/theme.h>
|
#include <utils/theme/theme.h>
|
||||||
|
@@ -27,7 +27,6 @@
|
|||||||
|
|
||||||
#include "qmake_global.h"
|
#include "qmake_global.h"
|
||||||
#include "proitems.h"
|
#include "proitems.h"
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#ifdef QT_BUILD_QMAKE
|
#ifdef QT_BUILD_QMAKE
|
||||||
# include <property.h>
|
# include <property.h>
|
||||||
|
@@ -47,8 +47,6 @@
|
|||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <sys/prctl.h>
|
#include <sys/prctl.h>
|
||||||
|
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
// Enable compilation with older header that doesn't contain this constant
|
// Enable compilation with older header that doesn't contain this constant
|
||||||
// for running on newer libraries that do support it
|
// for running on newer libraries that do support it
|
||||||
#ifndef PR_SET_PTRACER
|
#ifndef PR_SET_PTRACER
|
||||||
|
@@ -25,7 +25,6 @@
|
|||||||
|
|
||||||
#include <utils/algorithm.h>
|
#include <utils/algorithm.h>
|
||||||
#include <utils/mapreduce.h>
|
#include <utils/mapreduce.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
|
|
||||||
#include <QThreadPool>
|
#include <QThreadPool>
|
||||||
#include <QtTest>
|
#include <QtTest>
|
||||||
|
@@ -30,7 +30,6 @@
|
|||||||
#include <utils/environment.h>
|
#include <utils/environment.h>
|
||||||
#include <utils/hostosinfo.h>
|
#include <utils/hostosinfo.h>
|
||||||
#include <utils/launcherinterface.h>
|
#include <utils/launcherinterface.h>
|
||||||
#include <utils/porting.h>
|
|
||||||
#include <utils/processinfo.h>
|
#include <utils/processinfo.h>
|
||||||
#include <utils/processinterface.h>
|
#include <utils/processinterface.h>
|
||||||
#include <utils/qtcassert.h>
|
#include <utils/qtcassert.h>
|
||||||
|
Reference in New Issue
Block a user