mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-03-13 20:39:57 +01:00
Cache pixmaps.
This commit is contained in:
parent
f2a13fbd27
commit
81f1061b16
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -99,6 +99,9 @@ private:
|
||||
|
||||
// for settings access
|
||||
friend class TwitterConfigWidget;
|
||||
|
||||
QPixmap m_onlinePixmap;
|
||||
QPixmap m_offlinePixmap;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -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;
|
||||
}
|
||||
|
||||
|
||||
|
@ -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;
|
||||
};
|
||||
|
||||
};
|
||||
|
@ -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()
|
||||
{
|
||||
|
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user