Skip to content

Fix QDialogButtonBox connections in the edit profile dialog

Ahmad Samir requested to merge work/ahmad/fix-dialog-2 into master

KPageDialog already creates the accepted()/rejected() connections, since the code here created another connection, the accept() slot was being called twice for each OK button click, with e.g. the profile name empty, clicking Ok:

  • the first time isProfileNameValid() would return false, and the saving would abort, as it should
  • the second time around, isProfileNameValid() would return true since the name has been reverted to the original value in the Name line edit

The same goes for the reject() slot.

Also use a lambda instead of apply(), it's a very small method and this was the code is more readable, since we don't need to jump back and forth.

Merge request reports