aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/player-item.c8
-rw-r--r--src/player-item.vala6
2 files changed, 5 insertions, 9 deletions
diff --git a/src/player-item.c b/src/player-item.c
index 707d161..cc83381 100644
--- a/src/player-item.c
+++ b/src/player-item.c
@@ -285,9 +285,7 @@ void player_item_update (PlayerItem* self, GHashTable* data, GeeHashSet* attribu
}
_g_object_unref0 (_property_it);
}
- if (dbusmenu_menuitem_property_get_bool ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_VISIBLE) == FALSE) {
- dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE);
- }
+ dbusmenu_menuitem_property_set_bool ((DbusmenuMenuitem*) self, DBUSMENU_MENUITEM_PROP_VISIBLE, player_item_populated (self, attributes));
}
@@ -305,10 +303,10 @@ gboolean player_item_populated (PlayerItem* self, GeeHashSet* attrs) {
break;
}
prop = (char*) gee_iterator_get (_prop_it);
- g_debug ("player-item.vala:98: populated ? - prop: %s", prop);
+ g_debug ("player-item.vala:96: populated ? - prop: %s", prop);
value_int = dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop);
- g_debug ("player-item.vala:100: populated ? - prop %s and value %i", prop, value_int);
if (dbusmenu_menuitem_property_get_int ((DbusmenuMenuitem*) self, prop) != PLAYER_ITEM_EMPTY) {
+ g_debug ("player-item.vala:99: populated ? - prop %s and value %i", prop, value_int);
result = TRUE;
_g_free0 (prop);
_g_object_unref0 (_prop_it);
diff --git a/src/player-item.vala b/src/player-item.vala
index 68ae6ef..2729cb7 100644
--- a/src/player-item.vala
+++ b/src/player-item.vala
@@ -87,9 +87,7 @@ public class PlayerItem : Dbusmenu.Menuitem
this.property_set_bool(property, v.get_boolean());
}
}
- if(this.property_get_bool(MENUITEM_PROP_VISIBLE) == false){
- this.property_set_bool(MENUITEM_PROP_VISIBLE, true);
- }
+ this.property_set_bool(MENUITEM_PROP_VISIBLE, populated(attributes));
}
public bool populated(HashSet<string> attrs)
@@ -97,8 +95,8 @@ public class PlayerItem : Dbusmenu.Menuitem
foreach(string prop in attrs){
debug("populated ? - prop: %s", prop);
int value_int = property_get_int(prop);
- debug("populated ? - prop %s and value %i", prop, value_int);
if(property_get_int(prop) != EMPTY){
+ debug("populated ? - prop %s and value %i", prop, value_int);
return true;
}
}