[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 05/06: Remove unused code.
noreply at xfce.org
noreply at xfce.org
Wed Jan 22 21:48:25 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 664c4d32f8b74ccb5c04584fe0b5522df4c12515
Author: Graeme Gott <graeme at gottcode.org>
Date: Tue Jan 21 19:42:40 2020 -0500
Remove unused code.
---
panel-plugin/category.cpp | 74 -----------------------------------------------
panel-plugin/category.h | 1 -
2 files changed, 75 deletions(-)
diff --git a/panel-plugin/category.cpp b/panel-plugin/category.cpp
index 6cc94b7..951015a 100644
--- a/panel-plugin/category.cpp
+++ b/panel-plugin/category.cpp
@@ -29,13 +29,6 @@ using namespace WhiskerMenu;
//-----------------------------------------------------------------------------
-static bool is_null(const Element* element)
-{
- return !element;
-}
-
-//-----------------------------------------------------------------------------
-
Category::Category(GarconMenuDirectory* directory) :
m_button(NULL),
m_model(NULL),
@@ -166,11 +159,6 @@ void Category::append_separator()
void Category::sort()
{
unset_model();
- merge();
- if (m_has_separators)
- {
- m_items.erase(std::remove_if(m_items.begin(), m_items.end(), is_null), m_items.end());
- }
std::sort(m_items.begin(), m_items.end(), &Element::less_than);
}
@@ -257,68 +245,6 @@ void Category::insert_items(GtkListStore* model)
//-----------------------------------------------------------------------------
-void Category::merge()
-{
- if (!m_has_subcategories)
- {
- return;
- }
-
- // Find direct subcategories
- std::vector<Category*> categories;
- for (std::vector<Element*>::const_iterator i = m_items.begin(), end = m_items.end(); i != end; ++i)
- {
- if (Category* category = dynamic_cast<Category*>(*i))
- {
- categories.push_back(category);
- }
- }
- std::vector<Category*>::size_type last_direct = categories.size();
-
- // Recursively find subcategories
- std::vector<Element*>::size_type count = m_items.size();
- for (std::vector<Category*>::size_type i = 0; i < categories.size(); ++i)
- {
- Category* category = categories[i];
- count += category->m_items.size();
-
- for (std::vector<Element*>::const_iterator j = category->m_items.begin(), end = category->m_items.end(); j != end; ++j)
- {
- if (Category* subcategory = dynamic_cast<Category*>(*j))
- {
- categories.push_back(subcategory);
- }
- }
- }
-
- // Append items
- m_items.reserve(count);
- for (std::vector<Category*>::const_iterator i = categories.begin(), end = categories.end(); i != end; ++i)
- {
- m_items.insert(m_items.end(), (*i)->m_items.begin(), (*i)->m_items.end());
- }
-
- // Remove subcategories
- for (std::vector<Element*>::iterator i = m_items.begin(), end = m_items.end(); i != end; ++i)
- {
- if (dynamic_cast<Category*>(*i))
- {
- *i = NULL;
- }
- }
-
- // Delete direct subcategories; they will recursively delete their subcategories
- for (std::vector<Category*>::size_type i = 0; i < last_direct; ++i)
- {
- delete categories[i];
- }
-
- m_has_subcategories = false;
- m_has_separators = true;
-}
-
-//-----------------------------------------------------------------------------
-
void Category::unset_model()
{
if (m_model)
diff --git a/panel-plugin/category.h b/panel-plugin/category.h
index ebab893..3f1e5e3 100644
--- a/panel-plugin/category.h
+++ b/panel-plugin/category.h
@@ -62,7 +62,6 @@ public:
private:
void insert_items(GtkTreeStore* model, GtkTreeIter* parent);
void insert_items(GtkListStore* model);
- void merge();
void unset_model();
private:
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list