aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Tari <robert@tari.in>2020-09-02 17:20:30 +0200
committerMike Gabriel <mike.gabriel@das-netzwerkteam.de>2020-09-05 13:20:12 +0200
commit6e5ab2c2a461de7aa2666290f694411a9649e3b7 (patch)
tree2115906a72a8b421d381418793f1ee0853e99e63
parentf89575ea064ecd19ea2412145f5faf6ea495a121 (diff)
downloadlibayatana-indicator-6e5ab2c2a461de7aa2666290f694411a9649e3b7.tar.gz
libayatana-indicator-6e5ab2c2a461de7aa2666290f694411a9649e3b7.tar.bz2
libayatana-indicator-6e5ab2c2a461de7aa2666290f694411a9649e3b7.zip
Fix duplicate location in the datetime indicator.
Fixes AyatanaIndicators/ayatana-indicator-datetime#14.
-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++;
}