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,8 +25,6 @@
|
||||
|
||||
#include "qmljscodeformatter.h"
|
||||
|
||||
#include <utils/porting.h>
|
||||
|
||||
#include <QLoggingCategory>
|
||||
#include <QMetaEnum>
|
||||
#include <QTextBlock>
|
||||
@@ -229,7 +227,7 @@ void CodeFormatter::recalculateStateAfter(const QTextBlock &block)
|
||||
break;
|
||||
|
||||
case property_list_open: {
|
||||
const QStringView tok = Utils::midView(m_currentLine,
|
||||
const QStringView tok = QStringView(m_currentLine).mid(
|
||||
m_currentToken.begin(),
|
||||
m_currentToken.length);
|
||||
if (tok == QLatin1String(">"))
|
||||
@@ -876,7 +874,7 @@ int CodeFormatter::column(int index) 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)
|
||||
@@ -950,7 +948,7 @@ int CodeFormatter::tokenizeBlock(const QTextBlock &block)
|
||||
CodeFormatter::TokenKind CodeFormatter::extendedTokenKind(const QmlJS::Token &token) const
|
||||
{
|
||||
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 (text == QLatin1String("as"))
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include "qmljscompletioncontextfinder.h"
|
||||
#include "qmljsscanner.h"
|
||||
|
||||
#include <utils/porting.h>
|
||||
|
||||
#include <QTextDocument>
|
||||
#include <QStringList>
|
||||
|
||||
@@ -163,7 +161,7 @@ void CompletionContextFinder::checkBinding()
|
||||
break;
|
||||
|
||||
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;
|
||||
if (identifierExpected) {
|
||||
m_bindingPropertyName.prepend(tokenString.toString());
|
||||
@@ -233,7 +231,7 @@ void CompletionContextFinder::checkImport()
|
||||
|
||||
switch (token.kind) {
|
||||
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")) {
|
||||
isInLibVersionImport = 0;
|
||||
if (state == Unknown) {
|
||||
|
||||
@@ -27,8 +27,7 @@
|
||||
|
||||
#include "qmljs_global.h"
|
||||
|
||||
#include <utils/fileutils.h>
|
||||
#include <utils/porting.h>
|
||||
#include <utils/filepath.h>
|
||||
|
||||
#include <QDebug>
|
||||
#include <QString>
|
||||
|
||||
@@ -29,7 +29,6 @@
|
||||
#include "qmljsdialect.h"
|
||||
|
||||
#include <languageutils/componentversion.h>
|
||||
#include <utils/porting.h>
|
||||
|
||||
#include <QObject>
|
||||
#include <QString>
|
||||
|
||||
@@ -31,7 +31,6 @@
|
||||
#include <qmljs/parser/qmljsastfwd_p.h>
|
||||
|
||||
#include <languageutils/fakemetaobject.h>
|
||||
#include <utils/porting.h>
|
||||
|
||||
#include <QFileInfoList>
|
||||
#include <QHash>
|
||||
|
||||
@@ -64,8 +64,6 @@
|
||||
#include <qmljs/qmljslineinfo.h>
|
||||
#include <qmljs/qmljsscanner.h>
|
||||
|
||||
#include <utils/porting.h>
|
||||
|
||||
using namespace QmlJS;
|
||||
|
||||
/*
|
||||
@@ -281,7 +279,7 @@ Token LineInfo::lastToken() 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/filepath.h>
|
||||
#include <utils/porting.h>
|
||||
#include <utils/qrcparser.h>
|
||||
|
||||
#include <QDir>
|
||||
|
||||
Reference in New Issue
Block a user