Check if we need to show permissions groupBox when New Partition dialog is first shown.

This commit is contained in:
Andrius Štikonas 2021-12-28 16:27:20 +00:00
parent 850ab0df40
commit b9e5a055d4
1 changed files with 4 additions and 2 deletions

View File

@ -114,7 +114,7 @@ void NewDialog::setupDialog()
onRoleChanged(false); onRoleChanged(false);
onFilesystemChanged(dialogWidget().comboFileSystem().currentIndex()); onFilesystemChanged(dialogWidget().comboFileSystem().currentIndex());
connect(&dialogWidget().comboFileSystem(), QOverload<int>::of(&QComboBox::currentIndexChanged), this, [this]{ auto showPermissionsGroup = [this] {
const QString currText = dialogWidget().comboFileSystem().currentText(); const QString currText = dialogWidget().comboFileSystem().currentText();
const bool enablePosixPermission = QList<QString>({ const bool enablePosixPermission = QList<QString>({
QStringLiteral("btrfs"), QStringLiteral("btrfs"),
@ -137,7 +137,9 @@ void NewDialog::setupDialog()
} else { } else {
dialogWidget().hidePosixPermissions(); dialogWidget().hidePosixPermissions();
} }
}); };
connect(&dialogWidget().comboFileSystem(), QOverload<int>::of(&QComboBox::currentIndexChanged), this, showPermissionsGroup);
showPermissionsGroup();
} }
void NewDialog::setupConnections() void NewDialog::setupConnections()