1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-19 15:29:42 +01:00

Be a bit safer

This commit is contained in:
Jeff Mitchell 2012-01-23 15:14:57 -05:00
parent 63e59e7e27
commit 03384c4e19

View File

@ -42,7 +42,7 @@
#include <QtDBus/QDBusConnection>
#include <QtDBus/QDBusMessage>
#include <QImage>
#include <QtGui/QImage>
#include "utils/logger.h"
@ -84,18 +84,14 @@ FdoNotifyPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type,
arguments << quint32( 0 ); //notification_id
arguments << QString(); //app_icon
arguments << QString( "Tomahawk" ); //summary
arguments << hash["message"].toString(); //body
arguments << hash[ "message" ].toString(); //body
arguments << QStringList(); //actions
QVariantMap dict;
dict["desktop-entry"] = QString( "tomahawk" );
if ( hash.contains( "image" ) )
{
QVariant tempVariant = hash["image"];
QImage tempImage = tempVariant.value< QImage >();
dict["image_data"] = ImageConverter::variantForImage( tempImage );
}
if ( hash.contains( "image" ) && hash[ "image" ].canConvert< QImage >() )
dict[ "image_data" ] = ImageConverter::variantForImage( hash[ "image" ].value< QImage >() );
else
dict["image_data"] = ImageConverter::variantForImage( QImage( RESPATH "icons/tomahawk-icon-128x128.png" ) );
dict[ "image_data" ] = ImageConverter::variantForImage( QImage( RESPATH "icons/tomahawk-icon-128x128.png" ) );
arguments << dict; //hints
arguments << qint32( -1 ); //expire_timeout
message.setArguments( arguments );