mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-20 04:41:36 +02:00
If paused for a minute, clear Adium status.
This commit is contained in:
@@ -18,6 +18,8 @@
|
||||
|
||||
#include <string.h>
|
||||
|
||||
#include <QTimer>
|
||||
|
||||
#include "infosystem/infosystemworker.h"
|
||||
#include "artist.h"
|
||||
#include "result.h"
|
||||
@@ -65,6 +67,10 @@ AdiumPlugin::AdiumPlugin()
|
||||
|
||||
connect( TomahawkSettings::instance(), SIGNAL( changed() ),
|
||||
SLOT( settingsChanged() ), Qt::QueuedConnection );
|
||||
|
||||
m_pauseTimer = new QTimer( this );
|
||||
connect( m_pauseTimer, SIGNAL( timeout() ),
|
||||
this, SLOT( clearStatus() ) );
|
||||
}
|
||||
|
||||
AdiumPlugin::~AdiumPlugin()
|
||||
@@ -73,6 +79,13 @@ AdiumPlugin::~AdiumPlugin()
|
||||
setStatus( "" );
|
||||
}
|
||||
|
||||
void
|
||||
AdiumPlugin::clearStatus()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
setStatus( "" );
|
||||
}
|
||||
|
||||
void
|
||||
AdiumPlugin::settingsChanged()
|
||||
{
|
||||
@@ -107,9 +120,9 @@ AdiumPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoTyp
|
||||
case InfoNowPlaying:
|
||||
audioStarted( input );
|
||||
break;
|
||||
// case InfoNowPaused:
|
||||
// audioPaused();
|
||||
// break;
|
||||
case InfoNowPaused:
|
||||
audioPaused();
|
||||
return;
|
||||
case InfoNowResumed:
|
||||
audioResumed( input );
|
||||
break;
|
||||
@@ -120,6 +133,9 @@ AdiumPlugin::pushInfo( const QString caller, const Tomahawk::InfoSystem::InfoTyp
|
||||
default:
|
||||
return;
|
||||
}
|
||||
|
||||
// Stop the pause timer always, unless pausing of course
|
||||
m_pauseTimer->stop();
|
||||
}
|
||||
|
||||
/** Audio state slots */
|
||||
@@ -177,14 +193,12 @@ void
|
||||
AdiumPlugin::audioPaused()
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
//setStatus( "Paused" );
|
||||
m_pauseTimer->start( 60 * 1000 );
|
||||
}
|
||||
|
||||
void
|
||||
AdiumPlugin::audioResumed( const QVariant &input )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
// TODO: audio resumed, so push update status to Adium with playing track
|
||||
audioStarted( input );
|
||||
}
|
||||
|
@@ -24,6 +24,8 @@
|
||||
#include <QObject>
|
||||
#include <QVariant>
|
||||
|
||||
class QTimer;
|
||||
|
||||
namespace Tomahawk {
|
||||
|
||||
namespace InfoSystem {
|
||||
@@ -44,6 +46,9 @@ public slots:
|
||||
void namChangedSlot( QNetworkAccessManager *nam ) {} // unused
|
||||
void notInCacheSlot( const Tomahawk::InfoSystem::InfoCriteriaHash criteria, const QString caller, const Tomahawk::InfoSystem::InfoType type, const QVariant input, const Tomahawk::InfoSystem::InfoCustomData customData ) {} // unused
|
||||
|
||||
private slots:
|
||||
void clearStatus();
|
||||
|
||||
private:
|
||||
void settingsChanged();
|
||||
|
||||
@@ -59,6 +64,8 @@ private:
|
||||
QString m_beforeStatus;
|
||||
QString m_afterStatus;
|
||||
|
||||
QTimer* m_pauseTimer;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user