mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-04-01 14:42:25 +02:00
Remove reset; handle dbid changes locally in twitter sip
This commit is contained in:
parent
f2d5a9dadc
commit
660176477a
@ -94,9 +94,6 @@ public slots:
|
||||
// so plugins can clean up after themselves
|
||||
virtual void deletePlugin();
|
||||
|
||||
//called when there is a new database
|
||||
virtual void reset() = 0;
|
||||
|
||||
signals:
|
||||
void error( int, const QString& );
|
||||
void stateChanged( SipPlugin::ConnectionState state );
|
||||
|
@ -97,8 +97,6 @@ public slots:
|
||||
void refreshProxy();
|
||||
void showAddFriendDialog();
|
||||
|
||||
virtual void reset() {}
|
||||
|
||||
protected:
|
||||
virtual QString defaultSuffix() const;
|
||||
|
||||
|
@ -67,6 +67,19 @@ TwitterPlugin::TwitterPlugin( const QString& pluginId )
|
||||
, m_state( Disconnected )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
|
||||
if ( !Database::instance() || Database::instance()->dbid() != twitterSavedDbid() )
|
||||
{
|
||||
if ( !twitterSavedDbid().isEmpty() ) //remove eventually (post 0.2), here for migration purposes
|
||||
{
|
||||
setTwitterCachedDirectMessagesSinceId( 0 );
|
||||
setTwitterCachedFriendsSinceId( 0 );
|
||||
setTwitterCachedMentionsSinceId( 0 );
|
||||
setTwitterCachedPeers( QHash< QString, QVariant >() );
|
||||
}
|
||||
setTwitterSavedDbid( Database::instance()->dbid() );
|
||||
}
|
||||
|
||||
m_checkTimer.setInterval( 150000 );
|
||||
m_checkTimer.setSingleShot( false );
|
||||
connect( &m_checkTimer, SIGNAL( timeout() ), SLOT( checkTimerFired() ) );
|
||||
@ -787,13 +800,16 @@ TwitterPlugin::checkSettings()
|
||||
|
||||
|
||||
void
|
||||
TwitterPlugin::reset()
|
||||
TwitterPlugin::setTwitterSavedDbid( const QString& dbid )
|
||||
{
|
||||
qDebug() << Q_FUNC_INFO;
|
||||
setTwitterCachedDirectMessagesSinceId( 0 );
|
||||
setTwitterCachedFriendsSinceId( 0 );
|
||||
setTwitterCachedMentionsSinceId( 0 );
|
||||
setTwitterCachedPeers( QHash< QString, QVariant >() );
|
||||
TomahawkSettings::instance()->setValue( pluginId() + "/saveddbid", dbid );
|
||||
}
|
||||
|
||||
|
||||
QString
|
||||
TwitterPlugin::twitterSavedDbid() const
|
||||
{
|
||||
return TomahawkSettings::instance()->value( pluginId() + "/saveddbid", QString() ).toString();
|
||||
}
|
||||
|
||||
|
||||
|
@ -78,7 +78,6 @@ signals:
|
||||
public slots:
|
||||
virtual bool connectPlugin( bool startup );
|
||||
void disconnectPlugin();
|
||||
virtual void reset();
|
||||
void checkSettings();
|
||||
void refreshProxy();
|
||||
void deletePlugin();
|
||||
@ -123,6 +122,8 @@ private:
|
||||
bool refreshTwitterAuth();
|
||||
void parseGotTomahawk( const QRegExp ®ex, const QString &screenName, const QString &text );
|
||||
// handle per-plugin config
|
||||
QString twitterSavedDbid() const;
|
||||
void setTwitterSavedDbid( const QString& dbid );
|
||||
QString twitterScreenName() const;
|
||||
void setTwitterScreenName( const QString& screenName );
|
||||
QString twitterOAuthToken() const;
|
||||
|
@ -67,8 +67,6 @@ public slots:
|
||||
virtual bool connectPlugin( bool startup );
|
||||
void disconnectPlugin();
|
||||
|
||||
virtual void reset() {}
|
||||
|
||||
void sendMsg( const QString& , const QString& ) {}
|
||||
void broadcastMsg( const QString & ) {}
|
||||
void addContact( const QString &, const QString& ) {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user