1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-04 05:07:27 +02:00

GCC suggests parens to make the logic obvious, so make it nice and obvious

This commit is contained in:
Jeff Mitchell
2011-06-17 12:47:21 -04:00
parent f72c60969b
commit f9dff94ab2

View File

@@ -93,7 +93,7 @@ CategoryAddItem::activate()
Qt::ItemFlags Qt::ItemFlags
CategoryAddItem::flags() const CategoryAddItem::flags() const
{ {
switch( m_categoryType ) switch ( m_categoryType )
{ {
case SourcesModel::PlaylistsCategory: case SourcesModel::PlaylistsCategory:
return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled; return Qt::ItemIsEnabled | Qt::ItemIsSelectable | Qt::ItemIsDropEnabled;
@@ -113,9 +113,13 @@ CategoryAddItem::icon() const
bool bool
CategoryAddItem::willAcceptDrag( const QMimeData* data ) const CategoryAddItem::willAcceptDrag( const QMimeData* data ) const
{ {
if( ( m_categoryType == SourcesModel::PlaylistsCategory || m_categoryType == SourcesModel::StationsCategory ) && if ( ( m_categoryType == SourcesModel::PlaylistsCategory || m_categoryType == SourcesModel::StationsCategory ) &&
(
data->hasFormat( "application/tomahawk.query.list" ) || data->hasFormat( "application/tomahawk.query.list" ) ||
data->hasFormat( "application/tomahawk.result.list" ) ) { data->hasFormat( "application/tomahawk.result.list" )
)
)
{
return true; return true;
} }
return false; return false;
@@ -125,11 +129,11 @@ bool
CategoryAddItem::dropMimeData( const QMimeData* data, Qt::DropAction ) CategoryAddItem::dropMimeData( const QMimeData* data, Qt::DropAction )
{ {
// Create a new playlist seeded with these items // Create a new playlist seeded with these items
if( data->hasFormat( "application/tomahawk.query.list" ) || data->hasFormat( "application/tomahawk.result.list" ) ) { if ( data->hasFormat( "application/tomahawk.query.list" ) || data->hasFormat( "application/tomahawk.result.list" ) ) {
QList< Tomahawk::query_ptr > queries; QList< Tomahawk::query_ptr > queries;
if( data->hasFormat( "application/tomahawk.query.list" ) ) { if ( data->hasFormat( "application/tomahawk.query.list" ) ) {
QByteArray itemData = data->data( "application/tomahawk.query.list" ); QByteArray itemData = data->data( "application/tomahawk.query.list" );
QDataStream stream( &itemData, QIODevice::ReadOnly ); QDataStream stream( &itemData, QIODevice::ReadOnly );