Bug 382749 - corona->importLayout() new strange behavior, subject of broken configurations
Summary: corona->importLayout() new strange behavior, subject of broken configurations
Status: RESOLVED NOT A BUG
Alias: None
Product: libplasma
Classification: Frameworks and Libraries
Component: libplasma (other bugs)
Version First Reported In: 5.36.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: Marco Martin
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-07-26 12:39 UTC by Michail Vourlakos
Modified: 2017-07-27 13:39 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed/Implemented In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michail Vourlakos 2017-07-26 12:39:24 UTC
Hello,

I have two issues with corona->importLayout() which I think I didnt have in the past. we use this function in the upcoming Latte in order to copy a dock. (a dock is a containment containing applets).

We copy the dock  configuration we want in a new file and from that new file we use the importLayout in order to load the copied dock.

1. In the past the importLayout function was updating also the applet ids when it was used. Now even though it updates the containment id, the applet ids remain the same. That creates a crash of course when removing the copied dock. We workaround this by changing the ids by ourselves and providing unique ids for containments and applets that arent used yet. This of course includes also the settings updating and the systray case

2. Even though the above (1) doesnt create crashes anymore, we observed a very strange behavior that may be irrelevant of (1). the importLayout creates double references to applets. For example if a containment contains two applets with ids(40, 45). The importLayout returns a contaiment that contains 4 applets with ids (40, 40, 45, 45). It is like it double loads the applets
Comment 1 Michail Vourlakos 2017-07-27 13:02:29 UTC
issue (2) is not relevant to importLayout. importLayout works correctly!

the (2) issue is tracked down to containment's restoreContents() which is called through restore(KConfigGroup). The restoreContents function doesnt remove the loaded applets before importing the new ones. So it doubles loading the same applets.
Comment 2 Michail Vourlakos 2017-07-27 13:39:15 UTC
(2) was totally our fault how we were loading the new copied containments... for (1) I dont know if this is the current default plasma behavior (meaning that the applet ids dont have to be updated)...