Bug 203058

Summary: plasma keeps copy jobs in plasma-desktop-appletsrc and thus grows the config file endlessly causing slow plasma launch
Product: [Plasma] plasma4 Reporter: S. Burmeister <sven.burmeister>
Component: notificationsAssignee: Plasma Bugs List <plasma-bugs>
Status: RESOLVED FIXED    
Severity: major CC: asraniel, cincaipatron, lydia, notmart
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: OpenSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description S. Burmeister 2009-08-08 11:14:52 UTC
Version:            (using KDE 4.3.0)
OS:                Linux
Installed from:    SuSE RPMs

My plasma takes ~40 seconds to start. I tried with a new config and the same applets, it worked well. By chance I had a look at the old plasma-desktop-appletsrc and noticed that it was ~200kb big. I guess that's where the slow startup comes from.

I'm not sure whether the slowness is a kconfig bug, please let me know if so, so that I can file a bug against it.

However, the reason while the file got that big in the first place is that it contains lots of finished copy jobs, i.e. if you download a file via konqueror and get a notification, that notification is added to the plasma-desktop-appletsrc file.

[Containments][3][Applets][11][Configuration][ExtenderItems][5]
extenderIconName=konqueror
extenderTitle=Kopiervorgang
group=jobGroup
label0=http://us.download.nvidia.com/XFree86/Linux-x86_64/185.18.14/NVIDIA-Linux-x86_64-185.18.14-pkg2.run
label1=file:///home/rabauke/temp/NVIDIA-Linux-x86_64-185.18.14-pkg2.run
labelName0=Quelle
labelName1=Ziel
sourceAppletId=11
sourceAppletPluginName=systemtray
type=job


After the job finished one gets a notification as well which is added to the config file as well.

[Containments][3][Applets][11][Configuration][ExtenderItems][6]
extenderIconName=konqueror
extenderTitle=Kopiervorgang [Abgeschlossen]
group=completedJobsGroup
sourceAppletId=11
sourceAppletPluginName=systemtray
text=<a href="/home/rabauke/temp/NVIDIA-Linux-x86_64-185.18.14-pkg2.run">/home/rabauke/temp/NVIDIA-Linux-x86_64-185.18.14-pkg2.run</a>
type=completedJob

If one closes that notification via the X the following remains in the config file, even if one restarts plasma. (In case the clean-up should happen on start-up)

[Containments][3][Applets][11][Configuration][ExtenderItems][5]
extenderTitle=Kopiervorgang [Abgeschlossen]
label0=http://us.download.nvidia.com/XFree86/Linux-x86_64/185.18.14/NVIDIA-Linux-x86_64-185.18.14-pkg2.run
label1=file:///home/rabauke/temp/NVIDIA-Linux-x86_64-185.18.14-pkg2.run
labelName0=Quelle
labelName1=Ziel

You can reproduce this as follows:
1. Open your plasma-desktop-appletsrc in kwrite
2. Open konqueror and paste http://us.download.nvidia.com/XFree86/Linux-x86_64/185.18.14/NVIDIA-Linux-x86_64-185.18.14-pkg2.run into the address-bar, hit RETURN to download it.
3. return to kwrite and reload, search for "nvidia" and you will see the item added to the file.
4. Wait until the job finshed, reload the config file to see changes.
5. Close the notification via the X in its extender (I use the one that closes all extenders)
6. Reload file again and see the remaining item.
7. Quit plasma and restart it, reload the config file and the item is still there.
8. Do so with different files and you will see your config file grow.
Comment 1 S. Burmeister 2009-08-08 11:24:57 UTC
Another note: With my ~200kb config file plasma used more thatn 100MB RAM according to the process list. With a clean config and the same applets it uses only 50MB.
Comment 2 Verdi March 2009-08-14 18:09:03 UTC
I can confirm this bug (and I happen to use openSUSE rpms too).

The [ExtenderItems] for completed jobs are saved into plasma-desktop-appletsrc. Sometimes, this is accompiened by the [PopupApplet] too.

This bug happens even with simple browsing activities using Konqueror or Dolphin+kio_sftp.

=================================================
[Containments][3][Applets][11][Configuration][ExtenderItems][63]
extenderTitle=Job canceled by user.
label0=ftp://ftp.ncbi.nih.gov/blast/db
label1=
labelName0=File
labelName1=

[Containments][3][Applets][11][PopupApplet]
DialogHeight=59
DialogWidth=416
=================================================
Comment 3 Marco Martin 2009-08-20 20:14:58 UTC
yeah, can confirm here on trunk build, will take a look
Comment 4 Marco Martin 2009-08-22 22:06:37 UTC
SVN commit 1014430 by mart:

don't write the extenderitem config after it was destroyed, mmkay?
will backport
BUG:203058


 M  +13 -2     jobwidget.cpp  
 M  +3 -0      jobwidget.h  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1014430
Comment 5 S. Burmeister 2009-08-23 11:54:33 UTC
Does this take care of those config files which do already have lots of those items in them, i.e. clean them up?
Comment 6 Marco Martin 2009-08-23 20:13:17 UTC
nope, would be quite messy code for a single use
Comment 7 S. Burmeister 2009-08-23 22:01:52 UTC
Well, now you leave all the 4.3.0 users with a messy plasma config file which might even cause a slow KDE start-up. I'll try to get this on the mailingslists etc. in order for people to fix it on their own. Leaving all those items in there is not really a solution but just the end of adding errors.
Comment 8 Stefan Majewsky 2009-09-01 17:41:24 UTC
Marco, couldn't a kconf_update script be used in this event? It should quite easy to recognize and delete completed jobs.