File 0028-pre-load-the-first-layer-of-sub-menus.patch of Package plasma5-workspace

From ebe634ba2927e6a259bac02eb22edea9d0f906a2 Mon Sep 17 00:00:00 2001
From: David Edmundson <kde@davidedmundson.co.uk>
Date: Mon, 16 Jan 2017 15:54:12 +0000
Subject: [PATCH 28/44] pre-load the first layer of sub menus

Summary:
We still call aboutToShow on them inside libdbusmenu-qt and update the
menu whilst it's showing, but having it pre-populated makes it look a
bit faster.

Reviewers: #plasma

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D4163
---
 applets/appmenu/plugin/appmenumodel.cpp | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/applets/appmenu/plugin/appmenumodel.cpp b/applets/appmenu/plugin/appmenumodel.cpp
index 02259a30..14ef5458 100644
--- a/applets/appmenu/plugin/appmenumodel.cpp
+++ b/applets/appmenu/plugin/appmenumodel.cpp
@@ -233,6 +233,14 @@ void AppMenuModel::updateApplicationMenu(const QString &serviceName, const QStri
         if (m_menu.isNull() || menu != m_menu) {
             return;
         }
+
+        //cache first layer of sub menus, which we'll be popping up
+        for(QAction *a: m_menu->actions()) {
+            if (a->menu()) {
+                m_importer->updateMenu(a->menu());
+            }
+        }
+
         setMenuAvailable(true);
         emit modelNeedsUpdate();
     });
-- 
2.12.0

openSUSE Build Service is sponsored by