aboutsummaryrefslogtreecommitdiff
path: root/src/metadata-menu-item.vala
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2010-09-14 10:09:03 +0100
committerConor Curran <conor.curran@canonical.com>2010-09-14 10:09:03 +0100
commitf8a8b763f595001715064655ce5ffa4f89e50e30 (patch)
tree99b2af445e89b7b6e4b0986413f760455be6d140 /src/metadata-menu-item.vala
parent0568dd3b8c0510269699d4f9f256b878137008d3 (diff)
downloadayatana-indicator-sound-f8a8b763f595001715064655ce5ffa4f89e50e30.tar.gz
ayatana-indicator-sound-f8a8b763f595001715064655ce5ffa4f89e50e30.tar.bz2
ayatana-indicator-sound-f8a8b763f595001715064655ce5ffa4f89e50e30.zip
one potential fix
Diffstat (limited to 'src/metadata-menu-item.vala')
-rw-r--r--src/metadata-menu-item.vala24
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);