Convert QRegExp->QRegularExpression in Partition class.
This commit is contained in:
parent
1ea4f4976d
commit
7e8cfaf25c
|
@ -353,9 +353,10 @@ void Partition::deleteFileSystem()
|
||||||
void Partition::setPartitionPath(const QString& s)
|
void Partition::setPartitionPath(const QString& s)
|
||||||
{
|
{
|
||||||
m_PartitionPath = s;
|
m_PartitionPath = s;
|
||||||
QRegExp rxPartitionNumber(QStringLiteral("([0-9]+$)"));
|
QRegularExpression re(QStringLiteral("(\\d+$)"));
|
||||||
if (rxPartitionNumber.indexIn(partitionPath()) > -1) {
|
QRegularExpressionMatch rePartitionNumber = re.match(partitionPath());
|
||||||
setNumber(rxPartitionNumber.cap().toInt());
|
if (rePartitionNumber.hasMatch()) {
|
||||||
|
setNumber(rePartitionNumber.captured().toInt());
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
setNumber(-1);
|
setNumber(-1);
|
||||||
|
|
Loading…
Reference in New Issue