Commit 44773583 authored by Nate Graham's avatar Nate Graham
Browse files

Properly enable and disable the table view in response to the guest checkbox

parent cb09bb89
......@@ -121,7 +121,11 @@ SambaUserSharePlugin::SambaUserSharePlugin(QObject *parent, const QList<QVariant
connect(propertiesUi.sambaChk, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
connect(propertiesUi.sambaNameEdit, SIGNAL(textChanged(QString)), this, SIGNAL(changed()));
connect(propertiesUi.sambaNameEdit, SIGNAL(textChanged(QString)), this, SLOT(checkShareName(QString)));
connect(propertiesUi.sambaAllowGuestChk, SIGNAL(toggled(bool)), this, SIGNAL(changed()));
connect(propertiesUi.sambaAllowGuestChk, &QCheckBox::toggled,
this, [=] (bool checked) {
propertiesUi.tableView->setEnabled(checked && propertiesUi.sambaChk->isChecked());
connect(model, SIGNAL(dataChanged(QModelIndex,QModelIndex)), this, SIGNAL(changed()));
for (int i = 0; i < model->rowCount(); ++i) {
......@@ -206,6 +210,8 @@ void SambaUserSharePlugin::load()
guestAllowed = (bool) shareData.guestPermission();
propertiesUi.tableView->setEnabled(propertiesUi.sambaChk->isChecked() &&
......@@ -241,7 +247,7 @@ void SambaUserSharePlugin::toggleShareStatus(bool checked)
propertiesUi.tableView->setEnabled(checked && propertiesUi.sambaAllowGuestChk->isChecked());
if (checked && propertiesUi.sambaNameEdit->text().isEmpty()) {
} else {
  • @ngraham Why is this change made? The permission table should definitely not be disabled when guess access is disabled. If anything, there's more reason to enable it when guest access is disabled since there's otherwise no way to enable access to a single user. This change has made the configure dialog to be only usable by enable guest access, making the appropriate change, and then disabling guest access again.

    I also doubt if the table view should be disabled when guest access is enabled since I assume that's needed for a read-only guest access and a read-write user access.

  • It's quite possible it was a dumb change. I'll re-evaluate.

  • Fixed in 56d7727d. Should end up in Dolphin 20.04.2.

    Thanks for following up on this.

  • Thanks for the quick fix.

    As an aside, if it was not obvious this should be the case from the code, it might worth adding a comment....

Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment