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