Commit 6dd3e1e1 authored by Anmol Ahuja's avatar Anmol Ahuja Committed by Matěj Laitl
Browse files

UmsCollection: recognize Data CDs as collections

CHANGES:
 * Data CDs are now recognized in Amarok; patch by Anmol Ahuja.

BUG: 316128
FIXED-IN: 2.8
REVIEW: 109752
DIGEST: Amarok now recognizes Data CDs as collections
parent d7541822
......@@ -16,6 +16,7 @@ VERSION 2.8-Beta 1
* Added Ctrl+H shortcut to randomize playlist, patch by Harsh Gupta. (BR 208061)
CHANGES:
* Data CDs are now recognized in Amarok; patch by Anmol Ahuja. (BR 316128)
* On-Screen-Display now uses the system font instead of hardcoded sans-serif
(BR 248707)
* On-Screen-Display fades in/out smoothly.
......
......@@ -74,7 +74,7 @@ UmsCollectionFactory::init()
// detect UMS devices that were already connected on startup
QString query( "IS StorageAccess" );
QList<Solid::Device> devices = Solid::Device::listFromQuery( query );
foreach( Solid::Device device, devices )
foreach( const Solid::Device &device, devices )
{
if( identifySolidDevice( device.udi() ) )
createCollectionForSolidDevice( device.udi() );
......@@ -140,7 +140,16 @@ UmsCollectionFactory::identifySolidDevice( const QString &udi ) const
if( device.vendor().contains( "Apple", Qt::CaseInsensitive ) )
return false;
// everything okay, lets see whether there is parent USB StorageDrive device
// everything okay, check whether the device is a data CD
if( device.is<Solid::OpticalDisc>() )
{
const Solid::OpticalDisc *disc = device.as<Solid::OpticalDisc>();
if( disc && ( disc->availableContent() & Solid::OpticalDisc::Data ) )
return true;
return false;
}
// check whether there is parent USB StorageDrive device
while( device.isValid() )
{
if( device.is<Solid::StorageDrive>() )
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment