mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
Use returned notification ID instead of static version. Thanks to David Rosca <nowrep@gmail.com> for the fix
This commit is contained in:
@@ -49,10 +49,9 @@
|
|||||||
|
|
||||||
using namespace Tomahawk::InfoSystem;
|
using namespace Tomahawk::InfoSystem;
|
||||||
|
|
||||||
static const int s_nowPlayingNotificationId = 1;
|
|
||||||
|
|
||||||
FdoNotifyPlugin::FdoNotifyPlugin()
|
FdoNotifyPlugin::FdoNotifyPlugin()
|
||||||
: InfoPlugin()
|
: InfoPlugin()
|
||||||
|
, m_nowPlayingId( 0 )
|
||||||
{
|
{
|
||||||
qDebug() << Q_FUNC_INFO;
|
qDebug() << Q_FUNC_INFO;
|
||||||
m_supportedPushTypes << InfoNotifyUser << InfoNowPlaying << InfoTrackUnresolved << InfoNowStopped;
|
m_supportedPushTypes << InfoNotifyUser << InfoNowPlaying << InfoTrackUnresolved << InfoNowStopped;
|
||||||
@@ -143,7 +142,7 @@ FdoNotifyPlugin::nowPlaying( const QVariant &input )
|
|||||||
QDBusMessage message = QDBusMessage::createMethodCall( "org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", "Notify" );
|
QDBusMessage message = QDBusMessage::createMethodCall( "org.freedesktop.Notifications", "/org/freedesktop/Notifications", "org.freedesktop.Notifications", "Notify" );
|
||||||
QList<QVariant> arguments;
|
QList<QVariant> arguments;
|
||||||
arguments << QString( "Tomahawk" ); //app_name
|
arguments << QString( "Tomahawk" ); //app_name
|
||||||
arguments << quint32( s_nowPlayingNotificationId ); //notification_id
|
arguments << m_nowPlayingId; //notification_id
|
||||||
arguments << QString(); //app_icon
|
arguments << QString(); //app_icon
|
||||||
arguments << QString( "Tomahawk" ); //summary
|
arguments << QString( "Tomahawk" ); //summary
|
||||||
arguments << messageText; //body
|
arguments << messageText; //body
|
||||||
@@ -157,5 +156,9 @@ FdoNotifyPlugin::nowPlaying( const QVariant &input )
|
|||||||
arguments << dict; //hints
|
arguments << dict; //hints
|
||||||
arguments << qint32( -1 ); //expire_timeout
|
arguments << qint32( -1 ); //expire_timeout
|
||||||
message.setArguments( arguments );
|
message.setArguments( arguments );
|
||||||
QDBusConnection::sessionBus().send( message );
|
|
||||||
|
const QDBusMessage &reply = QDBusConnection::sessionBus().call( message );
|
||||||
|
const QVariantList &list = reply.arguments();
|
||||||
|
if ( list.count() > 0 )
|
||||||
|
m_nowPlayingId = list.at( 0 ).toInt();
|
||||||
}
|
}
|
||||||
|
@@ -54,6 +54,8 @@ private:
|
|||||||
void notifyUser( const QString &messageText );
|
void notifyUser( const QString &messageText );
|
||||||
|
|
||||||
void nowPlaying( const QVariant &input );
|
void nowPlaying( const QVariant &input );
|
||||||
|
|
||||||
|
quint32 m_nowPlayingId;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user