From kde-commits Sun Jul 12 17:38:21 2009 From: =?utf-8?q?Martin=20Aum=C3=BCller?= Date: Sun, 12 Jul 2009 17:38:21 +0000 To: kde-commits Subject: extragear/multimedia/amarok/src Message-Id: <1247420301.754671.21679.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=124742030904198 SVN commit 995421 by aumuell: enable media device plugins to handle devices without mounted volume (or, according to solid, mountable volume) M +15 -2 MediaDeviceCache.cpp M +1 -1 MediaDeviceCache.h --- trunk/extragear/multimedia/amarok/src/MediaDeviceCache.cpp #995420:995421 @@ -107,6 +107,18 @@ } } } + deviceList = Solid::Device::listFromType( Solid::DeviceInterface::StorageDrive ); + foreach( const Solid::Device &device, deviceList ) + { + debug() << "Found Solid::DeviceInterface::StorageDrive with udi = " << device.udi(); + debug() << "Device name is = " << device.product() << " and was made by " << device.vendor(); + + if( device.as() ) + { + m_type[device.udi()] = MediaDeviceCache::SolidGenericType; + m_name[device.udi()] = device.vendor() + " - " + device.product(); + } + } KConfigGroup config = Amarok::config( "PortableDevices" ); QMap manualDevices = config.entryMap(); foreach( const QString &udi, manualDevices.keys() ) @@ -146,8 +158,9 @@ } else if( device.as() ) { - debug() << "Storage drive found, will wait for the volume"; - return; + debug() << "device is a Storage drive, still need a volume"; + m_type[udi] = MediaDeviceCache::SolidGenericType; + m_name[udi] = device.vendor() + " - " + device.product(); } else if( ssa ) { --- trunk/extragear/multimedia/amarok/src/MediaDeviceCache.h #995420:995421 @@ -34,7 +34,7 @@ public: - enum DeviceType { SolidPMPType, SolidVolumeType, ManualType, SolidAudioCdType, InvalidType }; + enum DeviceType { SolidPMPType, SolidVolumeType, ManualType, SolidAudioCdType, SolidGenericType, InvalidType }; static MediaDeviceCache* instance() { return s_instance ? s_instance : new MediaDeviceCache(); }