Bug 370285 - Fails to load configuration when adding default panels
Summary: Fails to load configuration when adding default panels
Status: RESOLVED FIXED
Alias: None
Product: kdeplasma-addons
Classification: Plasma
Component: Quicklaunch (show other bugs)
Version: 5.7.2
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: David Rosca
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-10-08 08:58 UTC by chocolatesocket
Modified: 2016-10-10 18:48 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description chocolatesocket 2016-10-08 08:58:04 UTC
After adding Quicklaunch to defaultPanel's layout.js then Quicklaunch fails to read the configuration upon adding another panel.

The first Quicklaunch in the default panel works when you log in, but if you add more default panels they will not read the configuration provided. They will however read properly if you log out after adding them, without touching them. They should read the configuration the first time.

Reproducible: Always

Steps to Reproduce:
1. Add the following to defaultPanel's layout.js:
/usr/share/plasma/layout-templates/org.kde.plasma.desktop.defaultPanel/contents/layout.js

var quicklaunch = panel.addWidget("org.kde.plasma.quicklaunch")
quicklaunch.currentConfigGroup = ["General"]
quicklaunch.writeConfig("launcherUrls","file:///usr/share/applications/org.kde.konsole.desktop,file:///usr/share/applications/org.kde.dolphin.desktop");
quicklaunch.writeConfig("maxSectionCount","2");

2. Log out.
3. Remove or move ~/.config/
It is probably only needed to remove ~/.config/plasma-org.kde.plasma.desktop-appletsrc
4. Log in
5. Right-click the desktop and add default panels.

Actual Results:  
Quicklaunch appears in the panels but it will not load the configuration from layout.js.

Expected Results:  
Quicklaunch appears in the panels with the configuration from layout.js.

Tested on Kubuntu 16.04 and 16.10 beta 2.
Comment 1 David Rosca 2016-10-08 10:54:49 UTC
This should fix it https://phabricator.kde.org/D2985
Comment 2 chocolatesocket 2016-10-09 04:18:59 UTC
(In reply to David Rosca from comment #1)
> This should fix it https://phabricator.kde.org/D2985

When I add that then plasmashell either hangs or Quicklaunch does not load the configuration.
At least for the software in 16.04/16.10 beta 2.
Comment 3 David Rosca 2016-10-09 10:47:57 UTC
Can you please test it again? I've updated the patch.
Comment 4 chocolatesocket 2016-10-09 20:30:29 UTC
(In reply to David Rosca from comment #3)
> Can you please test it again? I've updated the patch.

Yes, that seems to fix it for launcherUrls.

However, I was playing around with the rest of the configuration and discovered that the popup, which I did not try before, does not seem to not load its Urls either.

So with the earlier changes to layout.js, add this:

quicklaunch.writeConfig("enablePopup","true");
quicklaunch.writeConfig("popupUrls","file:///usr/share/applications/org.kde.kcalc.desktop,file:///usr/share/applications/org.kde.kate.desktop");
Comment 5 David Rosca 2016-10-10 08:23:33 UTC
Updated the patch again, it should be fine now.
Comment 6 chocolatesocket 2016-10-10 09:53:03 UTC
(In reply to David Rosca from comment #5)
> Updated the patch again, it should be fine now.

Yep, works. They all load now. Thanks.
Comment 7 David Rosca 2016-10-10 18:48:04 UTC
Git commit 0f4ec3e6da9c5bb582fa2cb92601daa8859b02f4 by David Rosca.
Committed on 10/10/2016 at 18:47.
Pushed by drosca into branch 'Plasma/5.8'.

Quicklaunch: Listen to external configuration changes

Fixes changing applet config from scripting.

Differential Revision: https://phabricator.kde.org/D2985

M  +9    -0    applets/quicklaunch/package/contents/ui/Popup.qml
M  +9    -0    applets/quicklaunch/package/contents/ui/main.qml

http://commits.kde.org/kdeplasma-addons/0f4ec3e6da9c5bb582fa2cb92601daa8859b02f4