1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-08-06 22:26:32 +02:00

style fixes

This commit is contained in:
Patrick von Reth
2013-07-23 22:00:42 +02:00
parent 3f1a5e1c3b
commit 501a72d79b
2 changed files with 18 additions and 18 deletions

View File

@@ -72,20 +72,20 @@ SnoreNotifyPlugin::SnoreNotifyPlugin()
m_snore = new Snore::SnoreCore(); m_snore = new Snore::SnoreCore();
m_snore->loadPlugins( Snore::PluginContainer::BACKEND ); m_snore->loadPlugins( Snore::PluginContainer::BACKEND );
QString backend = qgetenv( "SNORE_BACKEND" ).constData(); QString backend = qgetenv( "SNORE_BACKEND" ).constData();
backend.isEmpty()?m_snore->setPrimaryNotificationBackend():m_snore->setPrimaryNotificationBackend(backend); backend.isEmpty()?m_snore->setPrimaryNotificationBackend():m_snore->setPrimaryNotificationBackend( backend );
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->addApplication( m_application );
m_snore->applicationIsInitialized(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" ) );
addAlert( InfoTrackUnresolved, tr("Unresolved track") ); addAlert( InfoTrackUnresolved, tr( "Unresolved track" ) );
addAlert( InfoNowStopped, tr("Playback Stopped") ); addAlert( InfoNowStopped, tr( "Playback Stopped" ) );
addAlert( InfoInboxReceived, tr("You recived a Song recomondation") ); addAlert( InfoInboxReceived, tr( "You recived a Song recomondation" ) );
connect(m_snore,SIGNAL(actionInvoked(Snore::Notification)),this,SLOT(slotActionInvoked(Snore::Notification))); connect( m_snore, SIGNAL( actionInvoked( Snore::Notification ) ), this, SLOT( slotActionInvoked( Snore::Notification ) ) );
} }
@@ -97,7 +97,7 @@ SnoreNotifyPlugin::~SnoreNotifyPlugin()
m_snore->deleteLater(); m_snore->deleteLater();
m_application->deleteLater(); m_application->deleteLater();
foreach(Snore::Alert *alert,m_alerts) foreach( Snore::Alert* alert, m_alerts )
{ {
alert->deleteLater(); alert->deleteLater();
} }
@@ -154,9 +154,9 @@ SnoreNotifyPlugin::notifyUser( Tomahawk::InfoSystem::InfoType type, const QStrin
{ {
icon = m_defaultIcon; icon = m_defaultIcon;
} }
Snore::Alert *alert = m_alerts[type]; Snore::Alert* alert = m_alerts[ type ];
Snore::Notification n( qApp->applicationName(), alert->name(), alert->title(), messageText, icon ); Snore::Notification n( qApp->applicationName(), alert->name(), alert->title(), messageText, icon );
m_snore->broadcastNotification(n); m_snore->broadcastNotification( n );
tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "showing notification:" << messageText; tDebug( LOGVERBOSE ) << Q_FUNC_INFO << "showing notification:" << messageText;
} }
@@ -164,7 +164,7 @@ SnoreNotifyPlugin::notifyUser( Tomahawk::InfoSystem::InfoType type, const QStrin
void void
SnoreNotifyPlugin::addAlert( Tomahawk::InfoSystem::InfoType type, const QString &title ) SnoreNotifyPlugin::addAlert( Tomahawk::InfoSystem::InfoType type, const QString &title )
{ {
Snore::Alert *alert = new Snore::Alert( title, title, m_defaultIcon ); Snore::Alert* alert = new Snore::Alert( title, title, m_defaultIcon );
m_application->addAlert( alert ); m_application->addAlert( alert );
m_alerts[ type ] = alert; m_alerts[ type ] = alert;
} }

View File

@@ -65,15 +65,15 @@ protected slots:
void slotActionInvoked(Snore::Notification n); void slotActionInvoked(Snore::Notification n);
private: private:
void notifyUser(InfoType type, const QString &messageText, Snore::Icon icon = Snore::Icon()); void notifyUser( InfoType type, const QString &messageText, Snore::Icon icon = Snore::Icon() );
void addAlert(Tomahawk::InfoSystem::InfoType type,const QString &title); void addAlert( Tomahawk::InfoSystem::InfoType type, const QString &title );
Snore::SnoreCore *m_snore; Snore::SnoreCore *m_snore;
Snore::Application *m_application; Snore::Application *m_application;
Snore::Icon m_defaultIcon; Snore::Icon m_defaultIcon;
QHash<Tomahawk::InfoSystem::InfoType,Snore::Alert*> m_alerts; QHash< Tomahawk::InfoSystem::InfoType, Snore::Alert* > m_alerts;
void nowPlaying(const QVariant &input); void nowPlaying( const QVariant &input );
void inboxReceived(const QVariant &input); void inboxReceived( const QVariant &input );
}; };
} }