When you open konsole for the first time or without a .config/konsolerc, the profile is not persisted to disk and no entry is present in switch profile. This patch will make konsole create a new default profile if it doesn't exist.
Details
Diff Detail
- Repository
- R319 Konsole
- Lint
Lint Skipped - Unit
Unit Tests Skipped
This doesn't work for me. If I delete ~/.config/konsolerc* and ~/.local/share/konsole/*.profile, apply the patch, build konsole, and run it clean, I still see no profiles in Settings → Configure Konsole → Profiles.
Does that work for you, or am I doing it wrong?
I don't recall off-hand what happens w/o these 2 files - most distros include profiles
Any profile-related changes you make the first time you run konsole are lost.
About distros, neither Neon or Debian provide default profiles.
No, you got it right. I actually missed that cause was only checking {context menu > Switch Profile} and {context menu > Edit Current Profile}. I must have missed some emit step; I am checking that. The "lost settings" problem seems fixed, however; I have double checked that by i) deleting my settings and ii) creating a new account.
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.
With this patch, when you change any profile settings, it creates a Default.profile and a 'Profile 1.profile'.
I agree the issue of switch-> menu doesn't get updated needs fixed
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.
well I'm a bit confused why I don't see your results under the current master branch - I've tried 2 different VMs and verified there are no konsole files anywhere and get the results I mentioned above.
I'll also test those today to verify the results.
Kurt, do you mind telling us what vm's you used so I can replicate?
As of your latest change, I can no longer reproduce the issue I found the last time I reviewed this patch. I can also not reproduce @hindenburg's issue: changing profile settings doesn't create a new profile for me.
src/ProfileManager.cpp | ||
---|---|---|
113 | This comment seems wrong. |
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.
I thought I fixed this in 2015:
https://cgit.kde.org/konsole.git/commit/?id=4ec5d3092d6cbda5ccfb838e2ef71f6d650b5ac4
Can you try to find out why that isn't enough?
This fix looks wrong anyways, shouldn't clutter up the home directory of users just because we run (IMHO).
Hi, everyone! Sorry for the delay.
I was able to fix all the problems by removing the fallback profile. Now, konsole searches for a default profile in the usual places (konsole's configuration or konsolepart's configuration) and if it is unset, it will create an in-memory profile named "Default". If there is a change in the in-memory profile, it is persisted.
Besides that, the "Switch Profile" menu was renamed to "Favorite Profiles" because is the actual functionality: display all profiles in the favorite list.
As a user, I don't mind, but I fixed that in the last patch.
By the way, if creating a file just because we run is a problem, then we should fix konsolerc management as this file is created in the aforementioned condition.
Testing this and a few concerns right off the start
- manage profiles doesn't show any of my profiles (should be 5)
- The 'Favorite Profiles' doesn't really express the idea that the current session will be changed to the selected profile.
- have you tested 'konsole --fallback-profile '
A setHidden(false) was missing.
- The 'Favorite Profiles' doesn't really express the idea that the current session will be changed to the selected profile.
Agreed. However, switch profile doesn't state that it will show only a subset of my profile.
- have you tested 'konsole --fallback-profile '
Yes. It was working as expected.
OK, thanks - 19.04 will be split of shortly - I'll test more and look at getting this in after that. It currently doesn't apply cleanly due to other changes.
I'm still not sure about this.
The current implementation is that until the user changes some option, the internal settings are used. As soon as the user changes some setting, a new file 'Profile 1.profile' is created. If we wanted a default profile, it would be better to just ship one.
Issue I see with the current impl:
- Switch->Default profile entry makes no sense
- No profiles in Manage Dialogs - which might confuse people
Mind you guys that the internal implementation without a profile is kinda
broken, so this patch makes sense to me.
Em sáb, 20 de abr de 2019 às 03:09, Nathaniel Graham <
noreply@phabricator.kde.org> escreveu:
ngraham added a comment. View Revision
https://phabricator.kde.org/D16138In D16138#453146 https://phabricator.kde.org/D16138#453146, @hindenburg
https://phabricator.kde.org/p/hindenburg/ wrote:If we wanted a default profile, it would be better to just ship one.
Yeah.
*REPOSITORY*
R319 Konsole*REVISION DETAIL*
https://phabricator.kde.org/D16138*To: *pedroarthurp, tcanabrava, ngraham, Konsole, hindenburg
*Cc: *sandsmark, cfeck, ngraham, konsole-devel, gennad, thsurrel,
maximilianocuria, hindenburg
What's the ping? Should Konsole ship a default profile? and if so which one? or fix this code?
To me it makes sense to ship an internal profile that's equal to the default settings. That's kinda what profiles are, so it's a little odd to have the feature but not ship with one.
IMHO, it should. Not shipping a default profile only adds corner cases.
Even if we ship a default profile, the code still needs some fixes.
There also is a problem with this though, it is not possible to modify system-wide installed profiles due to missing permissions.
I filed a bug report about this: https://bugs.kde.org/show_bug.cgi?id=416752
I've saved a copy of this patch. I think we want to include a default profile instead of this. I'll close this now as we've moved to invent MRs.