diff --git a/src/gui/newdialog.cpp b/src/gui/newdialog.cpp index 07e913c..e0abddd 100644 --- a/src/gui/newdialog.cpp +++ b/src/gui/newdialog.cpp @@ -23,6 +23,7 @@ #include #include +#include #include #include @@ -254,9 +255,11 @@ void NewDialog::slotPasswordStatusChanged() void NewDialog::onLVNameChanged(const QString& newName) { - //TODO: validate lvName partition().setPartitionPath(device().deviceNode() + QStringLiteral("/") + newName.trimmed()); - if (dialogWidget().lvName().isVisible() && dialogWidget().lvName().text().isEmpty()) { + if ((dialogWidget().lvName().isVisible() && + dialogWidget().lvName().text().isEmpty()) || + (device().type() == Device::LVM_Device && + dynamic_cast(device()).lvPathList().contains(partition().partitionPath())) ) { m_IsValidLVName = false; } else { m_IsValidLVName = true;