[banshee] [GioHardware] Correctly create a DeviceMediaCapabilities object
- From: Alan McGovern <alanmc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [banshee] [GioHardware] Correctly create a DeviceMediaCapabilities object
- Date: Sat, 25 Sep 2010 11:43:07 +0000 (UTC)
commit f7f4bfb624439f4f6de689a610f356f6c97f711c
Author: Alan McGovern <alan mcgovern gmail com>
Date: Sat Sep 25 12:40:25 2010 +0100
[GioHardware] Correctly create a DeviceMediaCapabilities object
We should only create one of these if the device has a non-null
IdMediaPlayer attribute. Otherwise banshee will end up thinking that
all mass storage based devices are media devices.
.../DeviceMediaCapabilities.cs | 4 ++--
.../LowLevel/RawBlockDevice.cs | 6 ------
.../Banshee.Hardware.Gio/LowLevel/RawDevice.cs | 6 ++++--
.../Banshee.Hardware.Gio/LowLevel/RawUsbDevice.cs | 6 ------
.../Banshee.Hardware.Gio/LowLevel/RawVolume.cs | 4 ----
5 files changed, 6 insertions(+), 20 deletions(-)
---
diff --git a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/DeviceMediaCapabilities.cs b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/DeviceMediaCapabilities.cs
index be3004b..e4c1611 100644
--- a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/DeviceMediaCapabilities.cs
+++ b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/DeviceMediaCapabilities.cs
@@ -46,9 +46,9 @@ namespace Banshee.Hardware.Gio
// the MPI file is found using the ID_MEDIA_PLAYER udev property + .mpi
// in /usr/[local/]share/.
- public DeviceMediaCapabilities (RawDevice device)
+ public DeviceMediaCapabilities (string idMediaPlayer)
{
- mpi = new GMpiFileInfo (device.IdMediaPlayer);
+ mpi = new GMpiFileInfo (idMediaPlayer);
}
public string[] OutputFormats {
diff --git a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawBlockDevice.cs b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawBlockDevice.cs
index 765b86e..59c0344 100644
--- a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawBlockDevice.cs
+++ b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawBlockDevice.cs
@@ -75,12 +75,6 @@ namespace Banshee.Hardware.Gio
}
}
- public override IDeviceMediaCapabilities MediaCapabilities {
- get {
- return new DeviceMediaCapabilities (this);
- }
- }
-
public override string Name {
get {
return Drive.Name;
diff --git a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawDevice.cs b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawDevice.cs
index b9a0ccd..464bbd6 100644
--- a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawDevice.cs
+++ b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawDevice.cs
@@ -70,8 +70,8 @@ namespace Banshee.Hardware.Gio
get;
}
- public abstract IDeviceMediaCapabilities MediaCapabilities {
- get;
+ public IDeviceMediaCapabilities MediaCapabilities {
+ get; private set;
}
public abstract string Name {
@@ -111,6 +111,8 @@ namespace Banshee.Hardware.Gio
Manager = manager;
GioMetadata = gioMetadata;
UdevMetadata = udevMetadata;
+ if (!string.IsNullOrEmpty (IdMediaPlayer))
+ MediaCapabilities = new DeviceMediaCapabilities (IdMediaPlayer);
}
public bool Equals (RawDevice other)
diff --git a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawUsbDevice.cs b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawUsbDevice.cs
index 7deb3e2..413a915 100644
--- a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawUsbDevice.cs
+++ b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawUsbDevice.cs
@@ -87,12 +87,6 @@ namespace Banshee.Hardware.Gio
get { return true; }
}
-
- public override IDeviceMediaCapabilities MediaCapabilities {
- get { return new DeviceMediaCapabilities (this); }
- }
-
-
public override string Name {
get { return UdevMetadata.Name; }
}
diff --git a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs
index 666511d..0ac09f9 100644
--- a/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs
+++ b/src/Backends/Banshee.Gio/Banshee.Hardware.Gio/LowLevel/RawVolume.cs
@@ -224,10 +224,6 @@ namespace Banshee.Hardware.Gio
}
}
- public override IDeviceMediaCapabilities MediaCapabilities {
- get { return new DeviceMediaCapabilities (this); }
- }
-
public override string Product {
get {
return UdevMetadata.Model;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]