[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 107/473: Fixed hang at launch when there are too many recent items.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:54:37 CET 2015


This is an automated email from the git hooks/post-receive script.

gottcode pushed a commit to branch master
in repository panel-plugins/xfce4-whiskermenu-plugin.

commit fa5e92e1c882a06caf108dbf826edce6a9b34764
Author: Graeme Gott <graeme at gottcode.org>
Date:   Sun Jul 14 18:51:49 2013 -0400

    Fixed hang at launch when there are too many recent items.
---
 src/list_page.cpp   |    5 ++++-
 src/recent_page.cpp |    7 ++++---
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/list_page.cpp b/src/list_page.cpp
index 6c4f3b6..8ca1633 100644
--- a/src/list_page.cpp
+++ b/src/list_page.cpp
@@ -142,7 +142,10 @@ void ListPage::unset_menu_items()
 void ListPage::set_desktop_ids(const std::vector<std::string>& desktop_ids)
 {
 	m_desktop_ids = desktop_ids;
-	set_menu_items();
+	if (get_view()->get_model())
+	{
+		set_menu_items();
+	}
 }
 
 //-----------------------------------------------------------------------------
diff --git a/src/recent_page.cpp b/src/recent_page.cpp
index 71a2fd2..2004791 100644
--- a/src/recent_page.cpp
+++ b/src/recent_page.cpp
@@ -30,10 +30,11 @@ RecentPage::RecentPage(XfceRc* settings, Menu* menu) :
 	m_max_items(10)
 {
 	// Prevent going over max
-	LauncherModel model(GTK_LIST_STORE(get_view()->get_model()));
-	while (size() > m_max_items)
+	if (size() > m_max_items)
 	{
-		model.remove_last_item();
+		std::vector<std::string> desktop_ids = get_desktop_ids();
+		desktop_ids.erase(desktop_ids.begin() + m_max_items, desktop_ids.end());
+		set_desktop_ids(desktop_ids);
 	}
 }
 

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list