[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 91/473: Hide implementation of loading launcher details.

noreply at xfce.org noreply at xfce.org
Mon Feb 16 23:54:21 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 d4c0f187f01992ad39709fdce2f6eaf0418580ca
Author: Graeme Gott <graeme at gottcode.org>
Date:   Fri Jul 12 15:18:59 2013 -0400

    Hide implementation of loading launcher details.
---
 src/launcher.hpp  |    9 +++++++--
 src/list_page.cpp |    6 +++---
 src/page.cpp      |    4 ++--
 3 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/launcher.hpp b/src/launcher.hpp
index e1a2e3c..d471ded 100644
--- a/src/launcher.hpp
+++ b/src/launcher.hpp
@@ -47,9 +47,14 @@ public:
 		return m_text;
 	}
 
-	GarconMenuItem* get_item() const
+	const gchar* get_desktop_id() const
 	{
-		return m_item;
+		return garcon_menu_item_get_desktop_id(m_item);
+	}
+
+	GFile* get_file() const
+	{
+		return garcon_menu_item_get_file(m_item);
 	}
 
 	unsigned int get_search_results(const Query& query) const
diff --git a/src/list_page.cpp b/src/list_page.cpp
index 0a31ba4..c5a2353 100644
--- a/src/list_page.cpp
+++ b/src/list_page.cpp
@@ -70,7 +70,7 @@ bool ListPage::contains(Launcher* launcher) const
 		return false;
 	}
 
-	std::string desktop_id = garcon_menu_item_get_desktop_id(launcher->get_item());
+	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();
 }
 
@@ -155,7 +155,7 @@ void ListPage::on_row_changed(GtkTreeModel* model, GtkTreePath* path, GtkTreeIte
 	gtk_tree_model_get(model, iter, LauncherModel::COLUMN_LAUNCHER, &launcher, -1);
 	if (launcher)
 	{
-		m_desktop_ids[pos] = garcon_menu_item_get_desktop_id(launcher->get_item());
+		m_desktop_ids[pos] = launcher->get_desktop_id();
 		get_menu()->set_modified(); // Handle favorites being rearranged
 	}
 }
@@ -171,7 +171,7 @@ void ListPage::on_row_inserted(GtkTreeModel* model, GtkTreePath* path, GtkTreeIt
 	gtk_tree_model_get(model, iter, LauncherModel::COLUMN_LAUNCHER, &launcher, -1);
 	if (launcher)
 	{
-		desktop_id = garcon_menu_item_get_desktop_id(launcher->get_item());
+		desktop_id = launcher->get_desktop_id();
 	}
 
 	if (pos >= m_desktop_ids.size())
diff --git a/src/page.cpp b/src/page.cpp
index 7bfd921..4c608bb 100644
--- a/src/page.cpp
+++ b/src/page.cpp
@@ -268,7 +268,7 @@ void Page::add_selected_to_desktop()
 	// Fetch launcher source
 	Launcher* launcher = get_selected_launcher();
 	g_assert(launcher != NULL);
-	GFile* source_file = garcon_menu_item_get_file(launcher->get_item());
+	GFile* source_file = launcher->get_file();
 
 	// Fetch launcher destination
 	char* basename = g_file_get_basename(source_file);
@@ -307,7 +307,7 @@ void Page::add_selected_to_panel()
 		// Fetch launcher desktop ID
 		Launcher* launcher = get_selected_launcher();
 		g_assert(launcher != NULL);
-		const gchar* parameters[] = { garcon_menu_item_get_desktop_id(launcher->get_item()), NULL };
+		const gchar* parameters[] = { launcher->get_desktop_id(), NULL };
 
 		// Tell panel to add item
 		if (!g_dbus_proxy_call_sync(proxy,

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


More information about the Xfce4-commits mailing list