Bug 130263 - KMenu discarding most used applications
Summary: KMenu discarding most used applications
Status: RESOLVED FIXED
Alias: None
Product: kicker
Classification: Plasma
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR normal
Target Milestone: ---
Assignee: Aaron J. Seigo
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-07-04 21:37 UTC by Marco Martin
Modified: 2006-08-28 17:28 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
an one line patch that actually fixes the problem (329 bytes, patch)
2006-08-28 15:58 UTC, Marco Martin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marco Martin 2006-07-04 21:37:23 UTC
Version:            (using KDE KDE 3.5.2)
Installed from:    SuSE RPMs
Compiler:          gcc4 suse 
OS:                Linux

I noted that from kde 3.5.0 (tested only until 3.5.2), in several distributions (notably a slackware custom build, Suse and Kubuntu packages) the most used applications list of kmenu (the problem triggers also in most recent applications mode) at random moments it discards the entire list and displays only the last started app.
how to reproduce it:
start an high enough number of applications from kmenu and control the most used list after the start of every application, at certain point only the icon of the last started app will be visible.
The RecentAppsStat item of kickerrc is also deleted.
Comment 1 Marco Martin 2006-08-13 22:16:02 UTC
Proposed solution: 
I digged into the code, and even if i still don't understand very well how it works I found that the list of the most/recent used apps is not always initialized after kicker start, i.e RecentlyLaunchedApps::init() of kdebase/kicker/kicker/ui/recentapps.cpp is not always called. 
I found that adding a call to init() in kdebase/kicker/kicker/ui/recentapps.cpp at line 51 (of the 3.5.4 version) at the end of the function RecentlyLaunchedApps::RecentlyLaunchedApps() seems to solve the problem. 
I don't know if there is a cleaner way to fix it but it seems work. 
Since It's a very annoying bug I think that a fix should make its way into 3.5.x series.
Comment 2 Marco Martin 2006-08-28 15:58:21 UTC
Created attachment 17530 [details]
an one line patch that actually fixes the problem

I made this one line patch to show what i mean.
it's made against kde 3.5.0 but i've seen on websvn that the file
recentapps.cpp isn't changed since then.
Comment 3 Aaron J. Seigo 2006-08-28 17:28:22 UTC
SVN commit 578162 by aseigo:

ensure that init() is always called on recentapps now that it is used by
more than just the menu (e.g. applets), which may result in it getting
instatiated then save()d without having first loaded the old values
BUG:130263


 M  +0 -1      k_mnu.cpp  
 M  +1 -0      recentapps.cpp  


--- branches/KDE/3.5/kdebase/kicker/kicker/ui/k_mnu.cpp #578161:578162
@@ -594,7 +594,6 @@
 // create and fill "recent" section at first
 void PanelKMenu::createRecentMenuItems()
 {
-    RecentlyLaunchedApps::the().init();
     RecentlyLaunchedApps::the().m_nNumMenuItems = 0;
 
     QStringList RecentApps;
--- branches/KDE/3.5/kdebase/kicker/kicker/ui/recentapps.cpp #578161:578162
@@ -48,6 +48,7 @@
     m_nNumMenuItems = 0;
     m_bNeedToUpdate = false;
     m_bInitialised = false;
+    init();
 }
 
 void RecentlyLaunchedApps::init()