mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Let SipHandler set the avatar for MyCollection
This commit is contained in:
@@ -179,6 +179,7 @@ SipHandler::loadPlugin( const QString& path )
|
|||||||
QObject::connect( sip, SIGNAL( error( int, QString ) ), SLOT( onError( int, QString ) ) );
|
QObject::connect( sip, SIGNAL( error( int, QString ) ), SLOT( onError( int, QString ) ) );
|
||||||
|
|
||||||
QObject::connect( sip, SIGNAL( avatarReceived( QString, QPixmap ) ), SLOT( onAvatarReceived( QString, QPixmap ) ) );
|
QObject::connect( sip, SIGNAL( avatarReceived( QString, QPixmap ) ), SLOT( onAvatarReceived( QString, QPixmap ) ) );
|
||||||
|
QObject::connect( sip, SIGNAL( avatarReceived( QPixmap ) ), SLOT( onAvatarReceived( QPixmap ) ) );
|
||||||
m_plugins << sip;
|
m_plugins << sip;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -411,3 +412,9 @@ void SipHandler::onAvatarReceived( const QString& from, const QPixmap& avatar )
|
|||||||
qDebug() << Q_FUNC_INFO << from << "no control connection setup yet";
|
qDebug() << Q_FUNC_INFO << from << "no control connection setup yet";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SipHandler::onAvatarReceived( const QPixmap& avatar )
|
||||||
|
{
|
||||||
|
qDebug() << Q_FUNC_INFO << "Set own avatar on MyCollection";
|
||||||
|
SourceList::instance()->getLocal()->setAvatar( avatar );
|
||||||
|
}
|
||||||
|
@@ -63,7 +63,12 @@ private slots:
|
|||||||
|
|
||||||
void onSettingsChanged();
|
void onSettingsChanged();
|
||||||
|
|
||||||
void onAvatarReceived( const QString& from, const QPixmap& avatar = QPixmap());
|
// set data for local source
|
||||||
|
void onAvatarReceived( const QPixmap& avatar );
|
||||||
|
|
||||||
|
// set data for other sources
|
||||||
|
void onAvatarReceived( const QString& from, const QPixmap& avatar );
|
||||||
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
static SipHandler *s_instance;
|
static SipHandler *s_instance;
|
||||||
|
@@ -58,8 +58,13 @@ signals:
|
|||||||
void peerOffline( const QString& );
|
void peerOffline( const QString& );
|
||||||
void msgReceived( const QString& from, const QString& msg );
|
void msgReceived( const QString& from, const QString& msg );
|
||||||
|
|
||||||
|
// new data for own source
|
||||||
|
void avatarReceived ( const QPixmap& avatar );
|
||||||
|
|
||||||
|
// new data for other sources;
|
||||||
void avatarReceived ( const QString& from, const QPixmap& avatar);
|
void avatarReceived ( const QString& from, const QPixmap& avatar);
|
||||||
|
|
||||||
|
|
||||||
void addMenu( QMenu* menu );
|
void addMenu( QMenu* menu );
|
||||||
void removeMenu( QMenu* menu );
|
void removeMenu( QMenu* menu );
|
||||||
};
|
};
|
||||||
|
@@ -111,6 +111,7 @@ JabberPlugin::connectPlugin( bool startup )
|
|||||||
|
|
||||||
QObject::connect( p, SIGNAL( authError( int, QString ) ), SLOT( onAuthError( int, QString ) ) );
|
QObject::connect( p, SIGNAL( authError( int, QString ) ), SLOT( onAuthError( int, QString ) ) );
|
||||||
QObject::connect( p, SIGNAL( avatarReceived( QString, QPixmap ) ), SIGNAL( avatarReceived( QString, QPixmap ) ) );
|
QObject::connect( p, SIGNAL( avatarReceived( QString, QPixmap ) ), SIGNAL( avatarReceived( QString, QPixmap ) ) );
|
||||||
|
QObject::connect( p, SIGNAL( avatarReceived( QPixmap ) ), SIGNAL( avatarReceived( QPixmap) ) );
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@@ -553,5 +553,10 @@ void Jabber_p::onNewAvatar(const QString& jid)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
emit avatarReceived ( jid, m_avatarManager->avatar( jid ) );
|
if( jid == m_client->jid().bare() )
|
||||||
|
// own avatar
|
||||||
|
emit avatarReceived ( m_avatarManager->avatar( jid ) );
|
||||||
|
else
|
||||||
|
// someone else's avatar
|
||||||
|
emit avatarReceived ( jid, m_avatarManager->avatar( jid ) );
|
||||||
}
|
}
|
||||||
|
@@ -65,6 +65,7 @@ signals:
|
|||||||
void connected();
|
void connected();
|
||||||
void disconnected();
|
void disconnected();
|
||||||
void jidChanged( const QString& );
|
void jidChanged( const QString& );
|
||||||
|
void avatarReceived( const QPixmap& avatar );
|
||||||
void avatarReceived( const QString&, const QPixmap& avatar );
|
void avatarReceived( const QString&, const QPixmap& avatar );
|
||||||
void authError( int, const QString& );
|
void authError( int, const QString& );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user