aboutsummaryrefslogtreecommitdiff
path: root/src
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
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')
-rw-r--r--src/metadata-menu-item.vala24
-rw-r--r--src/mpris2-controller.vala6
-rw-r--r--src/sound-service.c4
3 files changed, 30 insertions, 4 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);
diff --git a/src/mpris2-controller.vala b/src/mpris2-controller.vala
index bab20ae..86665ea 100644
--- a/src/mpris2-controller.vala
+++ b/src/mpris2-controller.vala
@@ -119,8 +119,10 @@ public class Mpris2Controller : GLib.Object
GLib.HashTable<string, Value?> changed_updates = clean_metadata();
this.owner.custom_items[PlayerController.widget_order.METADATA].reset(MetadataMenuitem.attributes_format());
this.owner.custom_items[PlayerController.widget_order.METADATA].update(changed_updates,
- MetadataMenuitem.attributes_format());
- }
+ MetadataMenuitem.attributes_format());
+ MetadataMenuitem metadata_item = this.owner.custom_items[PlayerController.widget_order.METADATA] as MetadataMenuitem;
+ metadata_item.determine_visibility();
+ }
}
private GLib.HashTable<string, Value?> clean_metadata()
diff --git a/src/sound-service.c b/src/sound-service.c
index f19379d..51f5f37 100644
--- a/src/sound-service.c
+++ b/src/sound-service.c
@@ -41,8 +41,8 @@ service_shutdown (IndicatorService *service, gpointer user_data)
if (mainloop != NULL) {
g_debug("Service shutdown !");
//TODO: uncomment for release !!
- close_pulse_activites();
- g_main_loop_quit(mainloop);
+ //close_pulse_activites();
+ //g_main_loop_quit(mainloop);
}
return;
}