Bug 379783

Summary: Recent documents/applications don't work
Product: [Plasma] plasmashell Reporter: Antonio Rojas <arojas>
Component: Application Menu (Kicker) widgetAssignee: Eike Hein <hein>
Status: RESOLVED FIXED    
Severity: normal CC: cfeck, ivan.cukic, jodr666, notmart, plasma-bugs-null
Priority: NOR    
Version First Reported In: 5.9.95   
Target Milestone: 1.0   
Platform: Compiled Sources   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:

Description Antonio Rojas 2017-05-13 15:33:29 UTC
The recent documents/recent applications menus are always disabled in kicker in 5.10 beta. Switching between most used/recently used doesn't make any difference, the menus say disabled.
Comment 1 Eike Hein 2017-05-13 15:37:31 UTC
Ivan?
Comment 2 Eike Hein 2017-05-13 15:40:34 UTC
I can reproduce. This needs to be fixed before the final.

Ivan, can you look into this? I don't have time today, and I'm travelling for ~20 hours tomorrow and then need to recover ...

Also cc'ing Marco so he is aware.
Comment 3 Tony 2017-05-13 20:21:02 UTC
*** Bug 379620 has been marked as a duplicate of this bug. ***
Comment 4 Ivan Čukić 2017-05-16 06:59:54 UTC
(for reference - IRC remembers no history :) )

Seems that the problem is that RecentUsageModel::componentComplete is not called in Kicker since RUM is not instantiated via QML in it.

It works (for me at least) when I do the following quick and dirty change:

--- a/applets/kicker/plugin/rootmodel.cpp
+++ b/applets/kicker/plugin/rootmodel.cpp
@@ -410,6 +410,7 @@ void RootModel::refresh()
 
     if (m_showRecentDocs) {
         m_recentDocsModel = new RecentUsageModel(this, RecentUsageModel::OnlyDocs, m_recentOrdering);
+        m_recentDocsModel->componentComplete();
         m_entryList.prepend(new GroupEntry(this,
                     m_recentOrdering == RecentUsageModel::Recent
                         ? i18n("Recent Documents")
@@ -421,6 +422,7 @@ void RootModel::refresh()
 
     if (m_showRecentApps) {
         m_recentAppsModel = new RecentUsageModel(this, RecentUsageModel::OnlyApps, m_recentOrdering);
+        m_recentAppsModel->componentComplete();
         m_entryList.prepend(new GroupEntry(this,
                     m_recentOrdering == RecentUsageModel::Recent
                         ? i18n("Recent Applications")
Comment 5 Eike Hein 2017-05-16 12:45:42 UTC
Git commit 6a76ce0b4fbdf3c17c37967add7a1f22c35d5059 by Eike Hein.
Committed on 16/05/2017 at 12:45.
Pushed by hein into branch 'master'.

Only defer initial refresh when actually instanciated from QML.

Fixes initial refresh in Kicker, where the RUM is instanciated
internally by RootModel.

Fixes regression from 5ad6e274b7790.

M  +3    -1    applets/kicker/plugin/recentusagemodel.cpp

https://commits.kde.org/plasma-desktop/6a76ce0b4fbdf3c17c37967add7a1f22c35d5059
Comment 6 Eike Hein 2017-05-25 23:14:51 UTC
Git commit 4fb1673b9d7de5bf32ed0d39d40c7d3256b767d9 by Eike Hein.
Committed on 25/05/2017 at 23:14.
Pushed by hein into branch 'Plasma/5.10'.

Only defer initial refresh when actually instanciated from QML.

Fixes initial refresh in Kicker, where the RUM is instanciated
internally by RootModel.

Fixes regression from 5ad6e274b7790.

M  +3    -1    applets/kicker/plugin/recentusagemodel.cpp

https://commits.kde.org/plasma-desktop/4fb1673b9d7de5bf32ed0d39d40c7d3256b767d9