diff --git a/src/accounts/twitter/TwitterAccount.cpp b/src/accounts/twitter/TwitterAccount.cpp index 12b368cb7..527959b48 100644 --- a/src/accounts/twitter/TwitterAccount.cpp +++ b/src/accounts/twitter/TwitterAccount.cpp @@ -59,6 +59,9 @@ TwitterAccount::TwitterAccount( const QString &accountId ) connect( m_configWidget.data(), SIGNAL( twitterAuthed( bool ) ), SLOT( configDialogAuthedSignalSlot( bool ) ) ); m_twitterAuth = QWeakPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) ); + + m_onlinePixmap = QPixmap( ":/twitter-icon.png" ); + m_offlinePixmap = QPixmap( ":/twitter-offline-icon.png" ); } @@ -230,8 +233,8 @@ QPixmap TwitterAccount::icon() const { if ( connectionState() == Connected ) - return QPixmap( ":/twitter-icon.png" ); - return QPixmap( ":/twitter-offline-icon.png" ); + return m_onlinePixmap; + return m_offlinePixmap; } diff --git a/src/accounts/twitter/TwitterAccount.h b/src/accounts/twitter/TwitterAccount.h index ec9e2bbbf..14f7602cb 100644 --- a/src/accounts/twitter/TwitterAccount.h +++ b/src/accounts/twitter/TwitterAccount.h @@ -99,6 +99,9 @@ private: // for settings access friend class TwitterConfigWidget; + + QPixmap m_onlinePixmap; + QPixmap m_offlinePixmap; }; }; diff --git a/src/accounts/xmpp/XmppAccount.cpp b/src/accounts/xmpp/XmppAccount.cpp index 059053135..65e4287be 100644 --- a/src/accounts/xmpp/XmppAccount.cpp +++ b/src/accounts/xmpp/XmppAccount.cpp @@ -45,6 +45,9 @@ XmppAccount::XmppAccount( const QString &accountId ) setTypes( SipType ); m_configWidget = QWeakPointer< QWidget >( new XmppConfigWidget( this, 0 ) ); + + m_onlinePixmap = QPixmap( ":/xmpp-icon.png" ); + m_offlinePixmap = QPixmap( ":/xmpp-offline-icon.png" ); } @@ -57,8 +60,8 @@ QPixmap XmppAccount::icon() const { if ( connectionState() == Connected ) - return QPixmap( ":/xmpp-icon.png" ); - return QPixmap( ":/xmpp-offline-icon.png" ); + return m_onlinePixmap; + return m_offlinePixmap; } diff --git a/src/accounts/xmpp/XmppAccount.h b/src/accounts/xmpp/XmppAccount.h index 61d230846..08b5705fd 100644 --- a/src/accounts/xmpp/XmppAccount.h +++ b/src/accounts/xmpp/XmppAccount.h @@ -83,6 +83,9 @@ protected: QWeakPointer< QWidget > m_configWidget; // so the google wrapper can change the config dialog a bit QWeakPointer< XmppSipPlugin > m_xmppSipPlugin; QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_xmppInfoPlugin; + + QPixmap m_onlinePixmap; + QPixmap m_offlinePixmap; }; }; diff --git a/src/accounts/xmpp/googlewrapper/GoogleWrapper.cpp b/src/accounts/xmpp/googlewrapper/GoogleWrapper.cpp index 222cafff0..b001f58a3 100644 --- a/src/accounts/xmpp/googlewrapper/GoogleWrapper.cpp +++ b/src/accounts/xmpp/googlewrapper/GoogleWrapper.cpp @@ -93,6 +93,9 @@ GoogleWrapper::GoogleWrapper ( const QString& pluginID ) config->m_ui->xmppServer->setText( "talk.google.com" ); config->m_ui->xmppPort->setValue( 5222 ); config->m_ui->groupBoxXmppAdvanced->hide(); + + m_onlinePixmap = QPixmap( ":/gmail-logo.png" ); + m_offlinePixmap = QPixmap( ":/gmail-offline-logo.png" ); } GoogleWrapper::~GoogleWrapper() @@ -101,15 +104,6 @@ GoogleWrapper::~GoogleWrapper() } -QPixmap -GoogleWrapper::icon() const -{ - if ( connectionState() == Connected ) - return QPixmap( ":/gmail-logo.png" ); - return QPixmap( ":/gmail-offline-logo.png" ); -} - - SipPlugin* GoogleWrapper::sipPlugin() { diff --git a/src/accounts/xmpp/googlewrapper/GoogleWrapper.h b/src/accounts/xmpp/googlewrapper/GoogleWrapper.h index 41f538b9b..171ad9f19 100644 --- a/src/accounts/xmpp/googlewrapper/GoogleWrapper.h +++ b/src/accounts/xmpp/googlewrapper/GoogleWrapper.h @@ -69,7 +69,6 @@ public: virtual const QString name() const { return QString( "Google" ); } virtual const QString friendlyName() const { return "Google"; } - virtual QPixmap icon() const; virtual SipPlugin* sipPlugin();