[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 435/473: Move contains check into favorites page.

noreply at xfce.org noreply at xfce.org
Tue Feb 17 00:00:05 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 eaeac4552c89e8124d3cca97a958ff2b21e34e39
Author: Graeme Gott <graeme at gottcode.org>
Date:   Tue Dec 31 09:40:23 2013 -0500

    Move contains check into favorites page.
---
 panel-plugin/favorites-page.cpp |   13 +++++++++++++
 panel-plugin/favorites-page.h   |    2 ++
 panel-plugin/list-page.cpp      |   15 ---------------
 panel-plugin/list-page.h        |    2 --
 4 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/panel-plugin/favorites-page.cpp b/panel-plugin/favorites-page.cpp
index d5cdbd8..a114ce5 100644
--- a/panel-plugin/favorites-page.cpp
+++ b/panel-plugin/favorites-page.cpp
@@ -40,6 +40,19 @@ FavoritesPage::FavoritesPage(Window* window) :
 
 //-----------------------------------------------------------------------------
 
+bool FavoritesPage::contains(Launcher* launcher) const
+{
+	if (!launcher)
+	{
+		return false;
+	}
+
+	std::string desktop_id(launcher->get_desktop_id());
+	return std::find(wm_settings->favorites.begin(), wm_settings->favorites.end(), desktop_id) != wm_settings->favorites.end();
+}
+
+//-----------------------------------------------------------------------------
+
 void FavoritesPage::add(Launcher* launcher)
 {
 	if (!launcher || contains(launcher))
diff --git a/panel-plugin/favorites-page.h b/panel-plugin/favorites-page.h
index 91a3e41..63c43ff 100644
--- a/panel-plugin/favorites-page.h
+++ b/panel-plugin/favorites-page.h
@@ -28,6 +28,8 @@ class FavoritesPage : public ListPage
 public:
 	FavoritesPage(Window* window);
 
+	bool contains(Launcher* launcher) const;
+
 	void add(Launcher* launcher);
 
 private:
diff --git a/panel-plugin/list-page.cpp b/panel-plugin/list-page.cpp
index b1d628e..9c2f281 100644
--- a/panel-plugin/list-page.cpp
+++ b/panel-plugin/list-page.cpp
@@ -24,8 +24,6 @@
 #include "slot.h"
 #include "window.h"
 
-#include <algorithm>
-
 using namespace WhiskerMenu;
 
 //-----------------------------------------------------------------------------
@@ -45,19 +43,6 @@ ListPage::~ListPage()
 
 //-----------------------------------------------------------------------------
 
-bool ListPage::contains(Launcher* launcher) const
-{
-	if (!launcher)
-	{
-		return false;
-	}
-
-	std::string desktop_id(launcher->get_desktop_id());
-	return std::find(m_desktop_ids.begin(), m_desktop_ids.end(), desktop_id) != m_desktop_ids.end();
-}
-
-//-----------------------------------------------------------------------------
-
 void ListPage::remove(Launcher* launcher)
 {
 	GtkTreeModel* model = GTK_TREE_MODEL(get_view()->get_model());
diff --git a/panel-plugin/list-page.h b/panel-plugin/list-page.h
index 6346fd7..fe62097 100644
--- a/panel-plugin/list-page.h
+++ b/panel-plugin/list-page.h
@@ -32,8 +32,6 @@ public:
 	ListPage(std::vector<std::string>& desktop_ids, Window* window);
 	~ListPage();
 
-	bool contains(Launcher* launcher) const;
-
 	virtual void add(Launcher* launcher)=0;
 	void remove(Launcher* launcher);
 	void set_menu_items();

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


More information about the Xfce4-commits mailing list