Merge lp://staging/~a-j-buxton/xfpanel-switch/orphan-plugins into lp://staging/~xfpanel-switch-dev/xfpanel-switch/trunk
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 146 | ||||
Proposed branch: | lp://staging/~a-j-buxton/xfpanel-switch/orphan-plugins | ||||
Merge into: | lp://staging/~xfpanel-switch-dev/xfpanel-switch/trunk | ||||
Diff against target: |
84 lines (+39/-7) 1 file modified
xfpanel-switch/panelconfig.py (+39/-7) |
||||
To merge this branch: | bzr merge lp://staging/~a-j-buxton/xfpanel-switch/orphan-plugins | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Xfce4 Panel Profiles Team | Pending | ||
Review via email: mp+343664@code.staging.launchpad.net |
Commit message
Fix (LP: #1765565): Don't crash on corrupted panel configs.
1. Fix the problem directly:
Catch the exception if the .desktop file is missing and return false.
This will remove launchers with missing .desktop (not just the binary).
2. Fix the problem more generally:
Ignore orphan plugin configurations. This is a plugin configuration
section which is not refered to by any panel and therefore is not used.
Some old versions of xfce4-panel seem to create these, but I can't
reproduce with the latest version.
These orphans are completely ignored by the panel. Xfpanel-switch also
ignores them, unless they are launchers with missing .desktop files.
The second part of this patch cleans them out anyway.
Description of the change
This is tricky to test as it requires you to have a previously unidentified corruption in your panel config. However, the reporter reported that it worked on IRC. I have not heavily tested it, but it appears to have saved my configuration okay too.
In order to test it you'll have to intentionally break the panel config: add a bunch of launchers, plugins etc, then delete them from panels/
Next add a launcher and delete the .desktop from ~/.config/
In neither case should it crash. :)