Fix a broken QRegularExpression in LVM VG name validator.
This commit is contained in:
parent
38d9c72466
commit
eb6478aa49
|
@ -725,10 +725,10 @@ void MainWindow::scanDevices()
|
|||
deviceScanner().start();
|
||||
}
|
||||
|
||||
void MainWindow::on_m_DeviceScanner_progress(const QString& device_node, int percent)
|
||||
void MainWindow::on_m_DeviceScanner_progress(const QString& deviceNode, int percent)
|
||||
{
|
||||
scanProgressDialog().setProgress(percent);
|
||||
scanProgressDialog().setDeviceName(device_node);
|
||||
scanProgressDialog().setDeviceName(deviceNode);
|
||||
}
|
||||
|
||||
void MainWindow::on_m_DeviceScanner_finished()
|
||||
|
|
|
@ -75,7 +75,10 @@ VolumeGroupDialog::~VolumeGroupDialog()
|
|||
|
||||
void VolumeGroupDialog::setupDialog()
|
||||
{
|
||||
QRegularExpression re(QStringLiteral("[\\w-.+]+"));
|
||||
/* LVM Volume group name can consists of: letters numbers _ . - +
|
||||
* It cannot start with underscore _ and must not be equal to . or .. or any entry in /dev/
|
||||
* QLineEdit accepts QValidator::Intermediate, so we just disable . at the beginning */
|
||||
QRegularExpression re(QStringLiteral(R"(^(?!_|.)[\w\-.+]+)"));
|
||||
QRegularExpressionValidator *validator = new QRegularExpressionValidator(re, this);
|
||||
dialogWidget().vgName().setValidator(validator);
|
||||
dialogWidget().vgName().setText(targetName());
|
||||
|
|
Loading…
Reference in New Issue