[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/01: Share code for finding all applications.
noreply at xfce.org
noreply at xfce.org
Sat Feb 8 16:06:41 CET 2020
This is an automated email from the git hooks/post-receive script.
g o t t c o d e p u s h e d a c o m m i t t o b r a n c h m a s t e r
in repository panel-plugins/xfce4-whiskermenu-plugin.
commit 4f18c6ad868529103acd593a38dc4d55c4ef4a23
Author: Graeme Gott <graeme at gottcode.org>
Date: Sat Feb 8 08:24:42 2020 -0500
Share code for finding all applications.
---
panel-plugin/applications-page.cpp | 6 +-----
panel-plugin/category.h | 7 +++++++
2 files changed, 8 insertions(+), 5 deletions(-)
diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index 08b3dc2..bb110de 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -302,11 +302,7 @@ void ApplicationsPage::load_garcon_menu()
// Create all items category
Category* category = new Category(nullptr);
- for (const auto& i : m_items)
- {
- category->append_item(i.second);
- }
- category->sort();
+ category->append_items(find_all());
m_categories.insert(m_categories.begin(), category);
}
diff --git a/panel-plugin/category.h b/panel-plugin/category.h
index 958a774..4f159f0 100644
--- a/panel-plugin/category.h
+++ b/panel-plugin/category.h
@@ -53,6 +53,13 @@ public:
m_items.push_back(launcher);
}
+ void append_items(const std::vector<Launcher*>& launchers)
+ {
+ unset_model();
+ m_items.reserve(m_items.size() + launchers.size());
+ m_items.insert(m_items.end(), launchers.begin(), launchers.end());
+ }
+
Category* append_menu(GarconMenuDirectory* directory);
void append_separator();
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list