1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-11 08:34:34 +02:00

some fixes

This commit is contained in:
Patrick von Reth
2014-01-09 11:03:40 +01:00
parent cdf13725d1
commit e9c478be75
2 changed files with 13 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2013 , Patrick von Reth <vonreth@kde.org> * Copyright 2013-2014, Patrick von Reth <vonreth@kde.org>
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* *
@@ -59,14 +59,16 @@ SnoreNotifyPlugin::SnoreNotifyPlugin()
} }
else else
{ {
m_snore->setPrimaryNotificationBackend( backend ); if(!m_snore->setPrimaryNotificationBackend( backend ))
{
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "Ivalid or unavailible Snore backend: " << backend << " availible backens: " << m_snore->notificationBackends();
m_snore->setPrimaryNotificationBackend();
}
} }
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << m_snore->primaryNotificationBackend(); tDebug( LOGVERBOSE ) << Q_FUNC_INFO << m_snore->primaryNotificationBackend();
m_application = new Snore::Application( qApp->applicationName(), m_defaultIcon ); m_application = new Snore::Application( qApp->applicationName(), m_defaultIcon );
m_snore->addApplication( m_application );
m_snore->applicationIsInitialized( m_application );
addAlert( InfoNotifyUser, tr( "Notify User" ) ); addAlert( InfoNotifyUser, tr( "Notify User" ) );
addAlert( InfoNowPlaying, tr( "Now Playing" ) ); addAlert( InfoNowPlaying, tr( "Now Playing" ) );
@@ -74,6 +76,9 @@ SnoreNotifyPlugin::SnoreNotifyPlugin()
addAlert( InfoNowStopped, tr( "Playback Stopped" ) ); addAlert( InfoNowStopped, tr( "Playback Stopped" ) );
addAlert( InfoInboxReceived, tr( "You received a Song recomondation" ) ); addAlert( InfoInboxReceived, tr( "You received a Song recomondation" ) );
m_snore->addApplication( m_application );
m_snore->applicationIsInitialized( m_application );
connect( m_snore, SIGNAL( actionInvoked( Snore::Notification ) ), this, SLOT( slotActionInvoked( Snore::Notification ) ) ); connect( m_snore, SIGNAL( actionInvoked( Snore::Notification ) ), this, SLOT( slotActionInvoked( Snore::Notification ) ) );
} }
@@ -81,13 +86,14 @@ SnoreNotifyPlugin::SnoreNotifyPlugin()
SnoreNotifyPlugin::~SnoreNotifyPlugin() SnoreNotifyPlugin::~SnoreNotifyPlugin()
{ {
tDebug( LOGVERBOSE ) << Q_FUNC_INFO; tDebug( LOGVERBOSE ) << Q_FUNC_INFO;
m_snore->deleteLater();
m_application->deleteLater();
m_snore->removeApplication(m_application->name());
foreach( Snore::Alert* alert, m_alerts ) foreach( Snore::Alert* alert, m_alerts )
{ {
alert->deleteLater(); alert->deleteLater();
} }
m_snore->deleteLater();
m_application->deleteLater();
} }
void void

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2013 , Patrick von Reth <vonreth@kde.org> * Copyright 2013-2014, Patrick von Reth <vonreth@kde.org>
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
* *
@@ -26,8 +26,6 @@
#include "infosystem/InfoSystem.h" #include "infosystem/InfoSystem.h"
#include <snore/core/snore.h> #include <snore/core/snore.h>
class QDBusPendingCallWatcher;
namespace Tomahawk namespace Tomahawk
{ {