Port QStringRef to QStringView.
This commit is contained in:
parent
b0cd5def42
commit
7eb2ceed17
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue