mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Be a bit safer
This commit is contained in:
@@ -42,7 +42,7 @@
|
|||||||
|
|
||||||
#include <QtDBus/QDBusConnection>
|
#include <QtDBus/QDBusConnection>
|
||||||
#include <QtDBus/QDBusMessage>
|
#include <QtDBus/QDBusMessage>
|
||||||
#include <QImage>
|
#include <QtGui/QImage>
|
||||||
|
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
|
|
||||||
@@ -84,18 +84,14 @@ FdoNotifyPlugin::pushInfo( QString caller, Tomahawk::InfoSystem::InfoType type,
|
|||||||
arguments << quint32( 0 ); //notification_id
|
arguments << quint32( 0 ); //notification_id
|
||||||
arguments << QString(); //app_icon
|
arguments << QString(); //app_icon
|
||||||
arguments << QString( "Tomahawk" ); //summary
|
arguments << QString( "Tomahawk" ); //summary
|
||||||
arguments << hash["message"].toString(); //body
|
arguments << hash[ "message" ].toString(); //body
|
||||||
arguments << QStringList(); //actions
|
arguments << QStringList(); //actions
|
||||||
QVariantMap dict;
|
QVariantMap dict;
|
||||||
dict["desktop-entry"] = QString( "tomahawk" );
|
dict["desktop-entry"] = QString( "tomahawk" );
|
||||||
if ( hash.contains( "image" ) )
|
if ( hash.contains( "image" ) && hash[ "image" ].canConvert< QImage >() )
|
||||||
{
|
dict[ "image_data" ] = ImageConverter::variantForImage( hash[ "image" ].value< QImage >() );
|
||||||
QVariant tempVariant = hash["image"];
|
|
||||||
QImage tempImage = tempVariant.value< QImage >();
|
|
||||||
dict["image_data"] = ImageConverter::variantForImage( tempImage );
|
|
||||||
}
|
|
||||||
else
|
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 << dict; //hints
|
||||||
arguments << qint32( -1 ); //expire_timeout
|
arguments << qint32( -1 ); //expire_timeout
|
||||||
message.setArguments( arguments );
|
message.setArguments( arguments );
|
||||||
|
Reference in New Issue
Block a user