D16138: Create the default profile if it doesn't exist

Pedro Arthur P. R. Duarte noreply at phabricator.kde.org
Tue Oct 23 13:19:18 BST 2018


pedroarthurp added a comment.


  In D16138#347398 <https://phabricator.kde.org/D16138#347398>, @hindenburg wrote:
  
  > Without this patch, when you change any profile settings, it creates a 'Profile 1.profile'.  This is my understanding of how it is suppose to work.
  
  
  I consistently lose any settings I make the first time I run konsole (ie, no `.config/konsolerc` and no files in `.local/share/konsole/`). I confirmed this with other users.
  
  > With this patch, when you change any profile settings, it creates a Default.profile and a 'Profile 1.profile'.
  
  Are you sure? I tested it by removing `.config/konsolerc` and all profiles in `.local/share/konsole/`. It only creates one entry named `Default.profile` (though I expected it to be `default.profile` as I hardcoded it in the patch).
  
  If you are getting two profiles, you may have a `Profile 1.profile` that is not set as your default profile in `.config/konsolerc`; this would cause `defaultProfileName.isEmpty()` to return `true` and hence create `Default.profile`.
  
  > I agree the issue of switch-> menu doesn't get updated needs fixed
  
  This bug haunted me. If you test, you will see that the context menu works just fine, but the application menu behaves randomly, even though they are the same `QActionGroup`, `_group` member of `ProfileList`.
  
  The logic to populate `_group` was a bit complicated (`ProfileList::updateEmptyAction`), hence I tried to create two `QActionGroup`: a `_fallback` for when the user has no favorite profile (with only the default profile in it), and a `_populated` for when the user has favorite profiles (with all his favorite entries, obviously). Then, I changed `ProfileList::actions()` to return the correct `QActionGroup` (`_populated->actions()` if user has favorites else `_fallback->actions()`). It worked just fine as a context menu, but still behaves randomly in the application menu. The code got much cleaner, though.
  
  Besides that, the menu is misleading as it says "Switch Profile", while in the code it lists "Favorite" profiles only.

REPOSITORY
  R319 Konsole

REVISION DETAIL
  https://phabricator.kde.org/D16138

To: pedroarthurp, tcanabrava, ngraham, #konsole, hindenburg
Cc: ngraham, konsole-devel, maximilianocuria, hindenburg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/konsole-devel/attachments/20181023/fa2bbe3f/attachment.html>


More information about the konsole-devel mailing list