Bug 368756

Summary: Plasmashell adds obsolete widgets
Product: [Plasma] plasmashell Reporter: RalphB <pub>
Component: PanelAssignee: Plasma Bugs List <plasma-bugs-null>
Status: RESOLVED INTENTIONAL    
Severity: normal CC: kde, pub
Priority: NOR    
Version First Reported In: 5.5.5   
Target Milestone: 1.0   
Platform: Kubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description RalphB 2016-09-13 19:09:26 UTC
I do widget development and install new versions of widgets locally with plasmapkg2. But when I want to add this newly installed widget version on the desktop or in the panel, a previous version is installed.

Reproducible: Always

Steps to Reproduce:
1. Create widget (plasmoid), e.g.

import QtQuick 2.0
Item {
    id: main
    Text {
        id: greeting
        anchors.centerIn: main
        text: "hello world"
    }
}

2. Install widget with plasmapkg2 -i hello.

3. Add hello widget to desktop -> you see "hello world".  Remove widget.

4. Change code above into 'text: "good-bye world"'

5. Update widget with plasmapkg2 -u hello.

6. Add widget to desktop -> ???


Actual Results:  
hello world

Expected Results:  
good-bye world
Comment 1 David Edmundson 2016-09-13 22:21:33 UTC
are you quitting plasma in between  3 to 6?
Comment 2 RalphB 2016-09-14 13:44:17 UTC
No, I don't.  So I am supposed to do that?  This makes testing of widgets (where plasmawindowed is not enough) quite difficult.

Is there a workaround/different tool (kpackagetool5?) that won't require logging off?
Comment 3 RalphB 2016-09-14 13:47:56 UTC
BTW, I'm note sure if this is related, but when I "download a new plasma widget", they are shown as "installed", but they won't actually show in the widget menu right away.  This is really confusing at it seems that the installation failed.
Comment 4 RalphB 2016-09-14 13:52:54 UTC
Ah sorry, I withdraw comment 3 -- that installation (from GitHub) DID fail. :-/  Installing as ZIP directly adds the widget to the widget menu.
Comment 5 David Edmundson 2016-09-14 23:00:07 UTC
>No, I don't. So I am supposed to do that? This makes testing of widgets (where plasmawindowed is not enough) quite difficult.

Yes. Sorry.

QML internally has a component cache. So when you instantiate it the seocnd time you're not loading the source again.  Theoretically calling engine->trimComponentCache() on applet removal might do it.. but it will still make it slower for our users.

plasmoidviewer from plasma-sdk should be better than plasmawindowed. (though it's still not great, feel free to improve it)
Comment 6 RalphB 2016-09-15 16:14:19 UTC
OK, that's fine, I understand.

Two suggestions (although this is probably not the best place for this):
1. add a note in the tutorials/documentation
2. create a widget/program that does just call engine->trimComponentCache(), if that is possible