Skip to content

ProfileManager dialog: improve handling profiles

Ahmad Samir requested to merge work/ahmad/single-selection into master
  • Differentiate between a profile being deleteable and writable:

    • Disable the Edit key for read-only profiles, i.e. a '.profile' that doesn't have write permissions for the user
    • Disable the Delete key for a '.profile' that is in a directory that isn't writable for the user (i.e. a .profile can be read-only, but still deleteable by the user)
  • Change the model selection mode to single selection, that simplifies the code, besides it looks like editing more than one profile at the same time hasn't worked for a while, and there are no complaints AFAICS; remove the now redundant selectedProfiles() method.

To test:

  • Have a regular A in ~/.local/share/konsole, and set it as the default
  • Create a profile B, in the above dir, then make it read-only chmod a-w
  • Create a profile C, then move it to /usr/share/konsole, and make it owned by root (some distros ship a "Root shell" profile, that could work too)
  • Create a profile D, move it to /usr/share/konsole/, then make it writeable for your user account

Open the profile manager dialog, notice the buttons statuses:

  • A should have all buttons enabled
  • B should have the Edit button disabled
  • C should have the Edit and Delete buttons disabled
  • D should have the Delete button disabled
Edited by Ahmad Samir

Merge request reports

Loading