aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-09-05 13:22:34 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-09-05 13:22:34 +0200
commit242b20becbfa33c2f83e4fb06d20dc15e2807b00 (patch)
tree2115906a72a8b421d381418793f1ee0853e99e63
parentf89575ea064ecd19ea2412145f5faf6ea495a121 (diff)
parent6e5ab2c2a461de7aa2666290f694411a9649e3b7 (diff)
downloadlibayatana-indicator-242b20becbfa33c2f83e4fb06d20dc15e2807b00.tar.gz
libayatana-indicator-242b20becbfa33c2f83e4fb06d20dc15e2807b00.tar.bz2
libayatana-indicator-242b20becbfa33c2f83e4fb06d20dc15e2807b00.zip
Merge branch 'tari01-pr/duplicate-locations'
Attributes GH PR #26: https://github.com/AyatanaIndicators/libayatana-indicator/pull/26
-rw-r--r--libayatana-indicator/indicator-ng.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libayatana-indicator/indicator-ng.c b/libayatana-indicator/indicator-ng.c
index 5d34139..b31d298 100644
--- a/libayatana-indicator/indicator-ng.c
+++ b/libayatana-indicator/indicator-ng.c
@@ -354,12 +354,13 @@ static void indicator_ng_menu_section_changed(GMenuModel *pMenuSection, gint nPo
for (guint nSection = 0; nSection < nSections; nSection++)
{
GMenuModel *pSection = g_menu_model_get_item_link(pModel, nSection, G_MENU_LINK_SECTION);
+ guint nSubsections = 0;
if (pSection)
{
gchar *sNamespace;
gboolean bNamespace = g_menu_model_get_item_attribute(pModel, nSection, G_MENU_ATTRIBUTE_ACTION_NAMESPACE, "s", &sNamespace);
- guint nSubsections = g_menu_model_get_n_items(pSection);
+ nSubsections = g_menu_model_get_n_items(pSection);
for (guint nSubsection = 0; nSubsection < nSubsections; nSubsection++)
{
@@ -405,7 +406,7 @@ static void indicator_ng_menu_section_changed(GMenuModel *pMenuSection, gint nPo
g_object_unref(pSection);
}
- if (!g_str_equal(self->name, "ayatana-indicator-messages"))
+ if (pSection && nSubsections)
{
nMenuItem++;
}