aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorConor Curran <conor.curran@canonical.com>2011-01-04 15:16:04 +0000
committerConor Curran <conor.curran@canonical.com>2011-01-04 15:16:04 +0000
commitf9afcd6bddae52bad5c5d8e7179fe360fcbf6de2 (patch)
treef2de192d974a10bcf9e553aeb634eb4a62ba593f
parent1949869da278d3df26bb1a5866a9e70069189188 (diff)
downloadayatana-indicator-sound-f9afcd6bddae52bad5c5d8e7179fe360fcbf6de2.tar.gz
ayatana-indicator-sound-f9afcd6bddae52bad5c5d8e7179fe360fcbf6de2.tar.bz2
ayatana-indicator-sound-f9afcd6bddae52bad5c5d8e7179fe360fcbf6de2.zip
removed the need for a name instance variable on the player controller obj, now always use the name set in app info
-rw-r--r--src/player-controller.vala13
-rw-r--r--src/title-menu-item.vala3
-rw-r--r--src/transport-menu-item.vala2
3 files changed, 10 insertions, 8 deletions
diff --git a/src/player-controller.vala b/src/player-controller.vala
index 638c44d..58e3b47 100644
--- a/src/player-controller.vala
+++ b/src/player-controller.vala
@@ -44,7 +44,7 @@ public class PlayerController : GLib.Object
public int current_state = state.OFFLINE;
private Dbusmenu.Menuitem root_menu;
- public string name { get; set;}
+ //public string name { get; set;}
public string dbus_name { get; set;}
public ArrayList<PlayerItem> custom_items;
public Mpris2Controller mpris_bridge;
@@ -62,7 +62,7 @@ public class PlayerController : GLib.Object
this.root_menu = root;
this.app_info = app;
this.dbus_name = dbus_name;
- this.name = format_player_name(this.app_info.get_name());
+ //this.name = this.app_info.get_name();
this.icon_name = icon_name;
this.custom_items = new ArrayList<PlayerItem>();
this.current_state = initial_state;
@@ -74,7 +74,8 @@ public class PlayerController : GLib.Object
public void update_state(state new_state)
{
- debug("update_state - player controller %s : new state %i", this.name, new_state);
+ debug("update_state - player controller %s : new state %i", this.app_info.get_name(),
+ new_state);
this.current_state = new_state;
this.update_layout();
}
@@ -93,13 +94,14 @@ public class PlayerController : GLib.Object
*/
public void instantiate()
{
- debug("instantiate in player controller for %s", this.name);
+ debug("instantiate in player controller for %s", this.app_info.get_name() );
try{
this.app_info.launch(null, null);
this.update_state(state.INSTANTIATING);
}
catch(GLib.Error error){
- warning("Failed to launch app %s with error message: %s", this.name, error.message);
+ warning("Failed to launch app %s with error message: %s", this.app_info.get_name(),
+ error.message );
}
}
@@ -181,6 +183,7 @@ public class PlayerController : GLib.Object
}
}
}
+
private static string format_player_name(owned string app_info_name)
{
diff --git a/src/title-menu-item.vala b/src/title-menu-item.vala
index d782e84..0b99ae3 100644
--- a/src/title-menu-item.vala
+++ b/src/title-menu-item.vala
@@ -26,8 +26,7 @@ public class TitleMenuitem : PlayerItem
public TitleMenuitem(PlayerController parent)
{
Object(item_type: MENUITEM_TYPE, owner: parent);
- this.property_set(MENUITEM_NAME, parent.name);
- debug("title init - icon name = %s", parent.icon_name);
+ this.property_set(MENUITEM_NAME, parent.app_info.get_name());
this.property_set(MENUITEM_ICON, parent.icon_name);
this.property_set_bool(MENUITEM_RUNNING, false);
}
diff --git a/src/transport-menu-item.vala b/src/transport-menu-item.vala
index 57eb67b..0e4e6ee 100644
--- a/src/transport-menu-item.vala
+++ b/src/transport-menu-item.vala
@@ -51,7 +51,7 @@ public class TransportMenuitem : PlayerItem
{
int input = input_value.get_int();
debug("handle_event with value %s", input.to_string());
- debug("transport owner name = %s", this.owner.name);
+ debug("transport owner name = %s", this.owner.app_info.get_name());
this.owner.mpris_bridge.transport_update((action)input);
}