[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 388/473: Prevent going over recent item max.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:59:18 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 c9871081ba30eb93de8ba2718afbee68262e455d
Author: Graeme Gott <graeme at gottcode.org>
Date:   Wed Jun 25 05:13:57 2014 -0400

    Prevent going over recent item max.
---
 panel-plugin/recent-page.cpp |    8 ++++++++
 panel-plugin/recent-page.h   |    1 +
 panel-plugin/window.cpp      |    3 +++
 3 files changed, 12 insertions(+)

diff --git a/panel-plugin/recent-page.cpp b/panel-plugin/recent-page.cpp
index 44e4ec0..fc346c4 100644
--- a/panel-plugin/recent-page.cpp
+++ b/panel-plugin/recent-page.cpp
@@ -67,6 +67,14 @@ void RecentPage::add(Launcher* launcher)
 			-1);
 
 	// Prevent going over max
+	enforce_item_count();
+}
+
+//-----------------------------------------------------------------------------
+
+void RecentPage::enforce_item_count()
+{
+	GtkListStore* store = GTK_LIST_STORE(get_view()->get_model());
 	while (wm_settings->recent.size() > wm_settings->recent_items_max)
 	{
 		GtkTreeIter iter;
diff --git a/panel-plugin/recent-page.h b/panel-plugin/recent-page.h
index fd48904..4412dfa 100644
--- a/panel-plugin/recent-page.h
+++ b/panel-plugin/recent-page.h
@@ -29,6 +29,7 @@ public:
 	RecentPage(Window* window);
 
 	void add(Launcher* launcher);
+	void enforce_item_count();
 
 private:
 	void extend_context_menu(GtkWidget* menu);
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 16071e4..bc1c793 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -280,6 +280,9 @@ void Window::show(GtkWidget* parent, bool horizontal)
 		wm_settings->command[i]->check();
 	}
 
+	// Make sure recent item count is within max
+	m_recent->enforce_item_count();
+
 	// Make sure applications list is current; does nothing unless list has changed
 	if (m_applications->load_applications() && gtk_widget_get_visible(m_window_contents))
 	{

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


More information about the Xfce4-commits mailing list