diff options
Diffstat (limited to 'src/metadata-menu-item.vala')
-rw-r--r-- | src/metadata-menu-item.vala | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/metadata-menu-item.vala b/src/metadata-menu-item.vala index 3f71653..b616a7b 100644 --- a/src/metadata-menu-item.vala +++ b/src/metadata-menu-item.vala @@ -19,6 +19,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. using Gee; using DbusmenuMetadata; +using Dbusmenu; using Gdk; public class MetadataMenuitem : PlayerItem @@ -95,6 +96,29 @@ public class MetadataMenuitem : PlayerItem return result; } + public void determine_visibility() + { + try{ + if(property_get_int(MENUITEM_TITLE) == -1){ + this.property_set_bool(MENUITEM_PROP_VISIBLE, false); + return; + } + } + catch(Error e){ + warning("determine_visibility - %s", e.message); + } + try{ + string title = property_get(MENUITEM_TITLE); + if(title.length == 0){ + this.property_set_bool(MENUITEM_PROP_VISIBLE, false); + return; + } + } + catch(Error e){ + warning("determine_visibility - %s", e.message); + } + } + public void fetch_art(string uri, string prop) { File art_file = File.new_for_uri(uri); |