[Xfce4-commits] [panel-plugins/xfce4-whiskermenu-plugin] 01/06: Handle reload during load.
noreply at xfce.org
noreply at xfce.org
Tue Apr 17 15:02:34 CEST 2018
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 7f4a4d5be69433f70e621e7223ecc3d069ca0455
Author: Graeme Gott <graeme at gottcode.org>
Date: Tue Apr 17 08:22:16 2018 -0400
Handle reload during load.
---
panel-plugin/applications-page.cpp | 22 +++++++++++++++++++---
1 file changed, 19 insertions(+), 3 deletions(-)
diff --git a/panel-plugin/applications-page.cpp b/panel-plugin/applications-page.cpp
index 631e2d7..f1ecaa0 100644
--- a/panel-plugin/applications-page.cpp
+++ b/panel-plugin/applications-page.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2013, 2015, 2016, 2017 Graeme Gott <graeme at gottcode.org>
+ * Copyright (C) 2013, 2015, 2016, 2017, 2018 Graeme Gott <graeme at gottcode.org>
*
* This library is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,6 +40,7 @@ enum
{
STATUS_INVALID,
STATUS_LOADING,
+ STATUS_LOADING_RELOAD,
STATUS_LOADED
};
@@ -157,7 +158,14 @@ void ApplicationsPage::apply_filter(GtkToggleButton* togglebutton)
void ApplicationsPage::invalidate_applications()
{
- m_load_status = STATUS_INVALID;
+ if (m_load_status == STATUS_LOADED)
+ {
+ m_load_status = STATUS_INVALID;
+ }
+ else if (m_load_status == STATUS_LOADING)
+ {
+ m_load_status = STATUS_LOADING_RELOAD;
+ }
}
//-----------------------------------------------------------------------------
@@ -170,7 +178,7 @@ bool ApplicationsPage::load_applications()
return true;
}
// Check if currently loading
- else if (m_load_status == STATUS_LOADING)
+ else if ((m_load_status == STATUS_LOADING) || (m_load_status == STATUS_LOADING_RELOAD))
{
return false;
}
@@ -322,6 +330,14 @@ void ApplicationsPage::load_contents()
return;
}
+ // Reload if necessary
+ if (m_load_status == STATUS_LOADING_RELOAD)
+ {
+ m_load_status = STATUS_INVALID;
+ load_applications();
+ return;
+ }
+
// Set all applications category
get_view()->set_fixed_height_mode(true);
get_view()->set_model(m_categories.front()->get_model());
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the Xfce4-commits
mailing list