forked from qt-creator/qt-creator
Core: Do not use QStringRef
It is gone in Qt6. QXmlStreamReader changed return values from QStringRef to QStringView, so use auto there. Task-number: QTCREATORBUG-24098 Change-Id: I806f01c20574721bfaa4b100747ef0bba75874a0 Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -101,7 +101,7 @@ QMap<QString, QList<QKeySequence>> CommandsFile::importCommands() const
|
|||||||
while (!r.atEnd()) {
|
while (!r.atEnd()) {
|
||||||
switch (r.readNext()) {
|
switch (r.readNext()) {
|
||||||
case QXmlStreamReader::StartElement: {
|
case QXmlStreamReader::StartElement: {
|
||||||
const QStringRef name = r.name();
|
const auto name = r.name();
|
||||||
if (name == ctx.shortCutElement) {
|
if (name == ctx.shortCutElement) {
|
||||||
currentId = r.attributes().value(ctx.idAttribute).toString();
|
currentId = r.attributes().value(ctx.idAttribute).toString();
|
||||||
if (!result.contains(currentId))
|
if (!result.contains(currentId))
|
||||||
|
@@ -825,14 +825,14 @@ QString DocumentManager::getSaveFileName(const QString &title, const QString &pa
|
|||||||
const QRegularExpressionMatch match = matchIt.next();
|
const QRegularExpressionMatch match = matchIt.next();
|
||||||
QString caption = match.captured(1);
|
QString caption = match.captured(1);
|
||||||
caption.remove(QLatin1Char('*'));
|
caption.remove(QLatin1Char('*'));
|
||||||
const QVector<QStringRef> suffixes = caption.splitRef(QLatin1Char(' '));
|
const QStringList suffixes = caption.split(QLatin1Char(' '));
|
||||||
for (const QStringRef &suffix : suffixes)
|
for (const QString &suffix : suffixes)
|
||||||
if (fileName.endsWith(suffix)) {
|
if (fileName.endsWith(suffix)) {
|
||||||
suffixOk = true;
|
suffixOk = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (!suffixOk && !suffixes.isEmpty())
|
if (!suffixOk && !suffixes.isEmpty())
|
||||||
fileName.append(suffixes.at(0).toString());
|
fileName.append(suffixes.at(0));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (QFile::exists(fileName)) {
|
if (QFile::exists(fileName)) {
|
||||||
|
@@ -351,7 +351,7 @@ static void localizedText(const QStringList &locales, QXmlStreamReader *reader,
|
|||||||
|
|
||||||
static bool parseOutputAttribute(const QString &attribute, QXmlStreamReader *reader, ExternalTool::OutputHandling *value)
|
static bool parseOutputAttribute(const QString &attribute, QXmlStreamReader *reader, ExternalTool::OutputHandling *value)
|
||||||
{
|
{
|
||||||
const QStringRef output = reader->attributes().value(attribute);
|
const auto output = reader->attributes().value(attribute);
|
||||||
if (output == kOutputShowInPane) {
|
if (output == kOutputShowInPane) {
|
||||||
*value = ExternalTool::ShowInPane;
|
*value = ExternalTool::ShowInPane;
|
||||||
} else if (output == kOutputReplaceSelection) {
|
} else if (output == kOutputReplaceSelection) {
|
||||||
@@ -405,7 +405,7 @@ ExternalTool * ExternalTool::createFromXml(const QByteArray &xml, QString *error
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (reader.attributes().hasAttribute(kModifiesDocument)) {
|
if (reader.attributes().hasAttribute(kModifiesDocument)) {
|
||||||
const QStringRef value = reader.attributes().value(kModifiesDocument);
|
const auto value = reader.attributes().value(kModifiesDocument);
|
||||||
if (value == kYes || value == kTrue) {
|
if (value == kYes || value == kTrue) {
|
||||||
tool->m_modifiesCurrentDocument = true;
|
tool->m_modifiesCurrentDocument = true;
|
||||||
} else if (value == kNo || value == kFalse) {
|
} else if (value == kNo || value == kFalse) {
|
||||||
|
Reference in New Issue
Block a user