Convert QRegExp->QRegularExpression in Partition class.

This commit is contained in:
Andrius Štikonas 2016-05-12 16:46:25 +01:00
parent 1ea4f4976d
commit 7e8cfaf25c
1 changed files with 4 additions and 3 deletions

View File

@ -353,9 +353,10 @@ void Partition::deleteFileSystem()
void Partition::setPartitionPath(const QString& s)
{
m_PartitionPath = s;
QRegExp rxPartitionNumber(QStringLiteral("([0-9]+$)"));
if (rxPartitionNumber.indexIn(partitionPath()) > -1) {
setNumber(rxPartitionNumber.cap().toInt());
QRegularExpression re(QStringLiteral("(\\d+$)"));
QRegularExpressionMatch rePartitionNumber = re.match(partitionPath());
if (rePartitionNumber.hasMatch()) {
setNumber(rePartitionNumber.captured().toInt());
return;
}
setNumber(-1);