Port QStringRef to QStringView.

This commit is contained in:
Andrius Štikonas 2022-01-15 22:49:42 +00:00
parent b0cd5def42
commit 7eb2ceed17
2 changed files with 3 additions and 3 deletions

View File

@ -8,6 +8,7 @@
#include <QString>
#include <QStringList>
#include <QStringView>
const static QString requiredPartition = QStringLiteral("RequiredPartition");
const static QString noBlockIoProtocol = QStringLiteral("NoBlockIOProtocol");
@ -25,7 +26,7 @@ quint64 SfdiskGptAttributes::toULongLong(const QStringList& attrs)
else if (attr.compare(legacyBiosBootable) == 0)
attributes |= 0x4ULL;
else if (attr.startsWith(guid))
attributes |= 1ULL << QStringRef(&attr, guid.length(), attr.length() - guid.length()).toULongLong();
attributes |= 1ULL << QStringView{ attr }.mid(guid.length(), attr.length() - guid.length()).toULongLong();
return attributes;
}

View File

@ -8,8 +8,7 @@
#define SFDISKGPTATTRIBUTES__H
#include <QtGlobal>
class QStringList;
#include <QStringList>
/** Sfdisk GPT Attributes helpers.
@author Gaël PORTAY <gael.portay@collabora.com>