[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/06: Rename functions in applications page.
noreply at xfce.org
noreply at xfce.org
Fri Feb 7 01:56:22 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 f911e29fbe2bf8e3486ab483f49889211e677d3a
Author: Graeme Gott <graeme at gottcode.org>
Date: Thu Feb 6 10:30:37 2020 -0500
Rename functions in applications page.
---
panel-plugin/applications-page.cpp | 22 +++++++++++-----------
panel-plugin/applications-page.h | 8 ++++----
panel-plugin/favorites-page.cpp | 4 ++--
panel-plugin/plugin.cpp | 2 +-
panel-plugin/recent-page.cpp | 4 ++--
panel-plugin/window.cpp | 4 ++--
6 files changed, 22 insertions(+), 22 deletions(-)
diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index cc5ff29..093e5de 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -59,7 +59,7 @@ ApplicationsPage::ApplicationsPage(Window* window) :
ApplicationsPage::~ApplicationsPage()
{
- clear_applications();
+ clear();
}
//-----------------------------------------------------------------------------
@@ -82,7 +82,7 @@ GtkTreeModel* ApplicationsPage::create_launcher_model(std::vector<std::string>&
continue;
}
- Launcher* launcher = get_application(*i);
+ Launcher* launcher = find(*i);
if (launcher)
{
gtk_list_store_insert_with_values(
@@ -106,7 +106,7 @@ GtkTreeModel* ApplicationsPage::create_launcher_model(std::vector<std::string>&
//-----------------------------------------------------------------------------
-Launcher* ApplicationsPage::get_application(const std::string& desktop_id) const
+Launcher* ApplicationsPage::find(const std::string& desktop_id) const
{
auto i = m_items.find(desktop_id);
return (i != m_items.end()) ? i->second : nullptr;
@@ -145,7 +145,7 @@ void ApplicationsPage::apply_filter(GtkToggleButton* togglebutton)
//-----------------------------------------------------------------------------
-void ApplicationsPage::invalidate_applications()
+void ApplicationsPage::invalidate()
{
if (m_status == LoadStatus::Done)
{
@@ -159,7 +159,7 @@ void ApplicationsPage::invalidate_applications()
//-----------------------------------------------------------------------------
-bool ApplicationsPage::load_applications()
+bool ApplicationsPage::load()
{
// Check if already loaded
if (m_status == LoadStatus::Done)
@@ -174,7 +174,7 @@ bool ApplicationsPage::load_applications()
m_status = LoadStatus::Loading;
// Load menu
- clear_applications();
+ clear();
// Load contents in thread if possible
GTask* task = g_task_new(nullptr, nullptr, &ApplicationsPage::load_contents_slot, this);
@@ -197,7 +197,7 @@ void ApplicationsPage::reload_category_icon_size()
//-----------------------------------------------------------------------------
-void ApplicationsPage::clear_applications()
+void ApplicationsPage::clear()
{
// Free categories
for (auto category : m_categories)
@@ -257,7 +257,7 @@ void ApplicationsPage::load_garcon_menu()
return;
}
- g_signal_connect_slot<GarconMenu*>(m_garcon_menu, "reload-required", &ApplicationsPage::invalidate_applications, this);
+ g_signal_connect_slot<GarconMenu*>(m_garcon_menu, "reload-required", &ApplicationsPage::invalidate, this);
load_menu(m_garcon_menu, nullptr);
// Create settings menu
@@ -267,7 +267,7 @@ void ApplicationsPage::load_garcon_menu()
if (m_garcon_settings_menu)
{
- g_signal_connect_slot<GarconMenu*>(m_garcon_settings_menu, "reload-required", &ApplicationsPage::invalidate_applications, this);
+ g_signal_connect_slot<GarconMenu*>(m_garcon_settings_menu, "reload-required", &ApplicationsPage::invalidate, this);
}
// Load settings menu
@@ -392,7 +392,7 @@ void ApplicationsPage::load_menu(GarconMenu* menu, Category* parent_category)
}
// Listen for menu changes
- g_signal_connect_slot<GarconMenu*,GarconMenuDirectory*,GarconMenuDirectory*>(menu, "directory-changed", &ApplicationsPage::invalidate_applications, this);
+ g_signal_connect_slot<GarconMenu*,GarconMenuDirectory*,GarconMenuDirectory*>(menu, "directory-changed", &ApplicationsPage::invalidate, this);
}
//-----------------------------------------------------------------------------
@@ -420,7 +420,7 @@ void ApplicationsPage::load_menu_item(GarconMenuItem* menu_item, Category* categ
}
// Listen for menu changes
- g_signal_connect_slot<GarconMenuItem*>(menu_item, "changed", &ApplicationsPage::invalidate_applications, this);
+ g_signal_connect_slot<GarconMenuItem*>(menu_item, "changed", &ApplicationsPage::invalidate, this);
}
//-----------------------------------------------------------------------------
diff --git a/panel-plugin/applications-page.h b/panel-plugin/applications-page.h
index 9bb2035..a405f3b 100644
--- a/panel-plugin/applications-page.h
+++ b/panel-plugin/applications-page.h
@@ -40,15 +40,15 @@ public:
~ApplicationsPage();
GtkTreeModel* create_launcher_model(std::vector<std::string>& desktop_ids) const;
- Launcher* get_application(const std::string& desktop_id) const;
+ Launcher* find(const std::string& desktop_id) const;
- void invalidate_applications();
- bool load_applications();
+ void invalidate();
+ bool load();
void reload_category_icon_size();
private:
void apply_filter(GtkToggleButton* togglebutton);
- void clear_applications();
+ void clear();
void load_garcon_menu();
void load_contents();
void load_menu(GarconMenu* menu, Category* parent_category);
diff --git a/panel-plugin/favorites-page.cpp b/panel-plugin/favorites-page.cpp
index 71cc883..676954a 100644
--- a/panel-plugin/favorites-page.cpp
+++ b/panel-plugin/favorites-page.cpp
@@ -121,7 +121,7 @@ void FavoritesPage::set_menu_items()
for (const auto& favorite : wm_settings->favorites)
{
- Launcher* launcher = get_window()->get_applications()->get_application(favorite);
+ Launcher* launcher = get_window()->get_applications()->find(favorite);
if (launcher)
{
launcher->set_flag(Launcher::FavoriteFlag, true);
@@ -225,7 +225,7 @@ std::vector<Launcher*> FavoritesPage::sort() const
items.reserve(wm_settings->favorites.size());
for (const auto& favorite : wm_settings->favorites)
{
- Launcher* launcher = get_window()->get_applications()->get_application(favorite);
+ Launcher* launcher = get_window()->get_applications()->find(favorite);
if (!launcher)
{
continue;
diff --git a/panel-plugin/plugin.cpp b/panel-plugin/plugin.cpp
index 8f02383..34918dc 100644
--- a/panel-plugin/plugin.cpp
+++ b/panel-plugin/plugin.cpp
@@ -225,7 +225,7 @@ std::string Plugin::get_button_icon_name() const
void Plugin::reload()
{
m_window->hide();
- m_window->get_applications()->invalidate_applications();
+ m_window->get_applications()->invalidate();
}
//-----------------------------------------------------------------------------
diff --git a/panel-plugin/recent-page.cpp b/panel-plugin/recent-page.cpp
index bd94199..510d6e8 100644
--- a/panel-plugin/recent-page.cpp
+++ b/panel-plugin/recent-page.cpp
@@ -113,7 +113,7 @@ void RecentPage::enforce_item_count()
GtkListStore* store = GTK_LIST_STORE(get_view()->get_model());
for (ssize_t i = wm_settings->recent.size() - 1, end = wm_settings->recent_items_max; i >= end; --i)
{
- Launcher* launcher = get_window()->get_applications()->get_application(wm_settings->recent[i]);
+ Launcher* launcher = get_window()->get_applications()->find(wm_settings->recent[i]);
if (launcher)
{
launcher->set_flag(Launcher::RecentFlag, false);
@@ -136,7 +136,7 @@ void RecentPage::flag_items(bool enabled)
{
for (const auto& recent : wm_settings->recent)
{
- Launcher* launcher = get_window()->get_applications()->get_application(recent);
+ Launcher* launcher = get_window()->get_applications()->find(recent);
if (launcher)
{
launcher->set_flag(Launcher::RecentFlag, enabled);
diff --git a/panel-plugin/window.cpp b/panel-plugin/window.cpp
index 1fb3aba..b5e019c 100644
--- a/panel-plugin/window.cpp
+++ b/panel-plugin/window.cpp
@@ -249,7 +249,7 @@ WhiskerMenu::Window::Window(Plugin* plugin) :
on_screen_changed_event(GTK_WIDGET(m_window), nullptr);
// Load applications
- m_applications->load_applications();
+ m_applications->load();
g_object_ref_sink(m_window);
}
@@ -345,7 +345,7 @@ void WhiskerMenu::Window::show(const Position position)
gtk_widget_set_visible(m_recent_button->get_widget(), wm_settings->recent_items_max);
// Make sure applications list is current; does nothing unless list has changed
- if (m_applications->load_applications())
+ if (m_applications->load())
{
set_loaded();
}
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list