1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-25 02:09:48 +01:00

Somehow, who knows how, passing a QImage to the FDO notification spec

crashes some X servers, but saving the QImage to a file as a PNG,
loading it back from the file as a PNG, and passing that QImage is
totally cool. Wut.
This commit is contained in:
Jeff Mitchell 2012-04-11 15:22:34 -04:00
parent 64fbd23008
commit 511d353cc6

View File

@ -149,8 +149,8 @@ FdoNotifyPlugin::nowPlaying( const QVariant &input )
arguments << QStringList(); //actions
QVariantMap dict;
dict["desktop-entry"] = QString( "tomahawk" );
if ( map.contains( "cover" ) && map[ "cover" ].canConvert< QImage >() && !map[ "cover" ].value< QImage >().isNull() )
dict[ "image_data" ] = ImageConverter::variantForImage( map[ "cover" ].value< QImage >() );
if ( map.contains( "coveruri" ) && map[ "coveruri" ].canConvert< QString >() )
dict[ "image_data" ] = ImageConverter::variantForImage( QImage( map[ "coveruri" ].toString(), "PNG" ) );
else
dict[ "image_data" ] = ImageConverter::variantForImage( QImage( RESPATH "icons/tomahawk-icon-128x128.png" ) );
arguments << dict; //hints