mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-17 03:24:15 +02:00
Cache pixmaps.
This commit is contained in:
@@ -59,6 +59,9 @@ TwitterAccount::TwitterAccount( const QString &accountId )
|
|||||||
connect( m_configWidget.data(), SIGNAL( twitterAuthed( bool ) ), SLOT( configDialogAuthedSignalSlot( bool ) ) );
|
connect( m_configWidget.data(), SIGNAL( twitterAuthed( bool ) ), SLOT( configDialogAuthedSignalSlot( bool ) ) );
|
||||||
|
|
||||||
m_twitterAuth = QWeakPointer< TomahawkOAuthTwitter >( new TomahawkOAuthTwitter( TomahawkUtils::nam(), this ) );
|
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
|
TwitterAccount::icon() const
|
||||||
{
|
{
|
||||||
if ( connectionState() == Connected )
|
if ( connectionState() == Connected )
|
||||||
return QPixmap( ":/twitter-icon.png" );
|
return m_onlinePixmap;
|
||||||
return QPixmap( ":/twitter-offline-icon.png" );
|
return m_offlinePixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -99,6 +99,9 @@ private:
|
|||||||
|
|
||||||
// for settings access
|
// for settings access
|
||||||
friend class TwitterConfigWidget;
|
friend class TwitterConfigWidget;
|
||||||
|
|
||||||
|
QPixmap m_onlinePixmap;
|
||||||
|
QPixmap m_offlinePixmap;
|
||||||
};
|
};
|
||||||
|
|
||||||
};
|
};
|
||||||
|
@@ -45,6 +45,9 @@ XmppAccount::XmppAccount( const QString &accountId )
|
|||||||
setTypes( SipType );
|
setTypes( SipType );
|
||||||
|
|
||||||
m_configWidget = QWeakPointer< QWidget >( new XmppConfigWidget( this, 0 ) );
|
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
|
XmppAccount::icon() const
|
||||||
{
|
{
|
||||||
if ( connectionState() == Connected )
|
if ( connectionState() == Connected )
|
||||||
return QPixmap( ":/xmpp-icon.png" );
|
return m_onlinePixmap;
|
||||||
return QPixmap( ":/xmpp-offline-icon.png" );
|
return m_offlinePixmap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -83,6 +83,9 @@ protected:
|
|||||||
QWeakPointer< QWidget > m_configWidget; // so the google wrapper can change the config dialog a bit
|
QWeakPointer< QWidget > m_configWidget; // so the google wrapper can change the config dialog a bit
|
||||||
QWeakPointer< XmppSipPlugin > m_xmppSipPlugin;
|
QWeakPointer< XmppSipPlugin > m_xmppSipPlugin;
|
||||||
QWeakPointer< Tomahawk::InfoSystem::XmppInfoPlugin > m_xmppInfoPlugin;
|
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->xmppServer->setText( "talk.google.com" );
|
||||||
config->m_ui->xmppPort->setValue( 5222 );
|
config->m_ui->xmppPort->setValue( 5222 );
|
||||||
config->m_ui->groupBoxXmppAdvanced->hide();
|
config->m_ui->groupBoxXmppAdvanced->hide();
|
||||||
|
|
||||||
|
m_onlinePixmap = QPixmap( ":/gmail-logo.png" );
|
||||||
|
m_offlinePixmap = QPixmap( ":/gmail-offline-logo.png" );
|
||||||
}
|
}
|
||||||
|
|
||||||
GoogleWrapper::~GoogleWrapper()
|
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*
|
SipPlugin*
|
||||||
GoogleWrapper::sipPlugin()
|
GoogleWrapper::sipPlugin()
|
||||||
{
|
{
|
||||||
|
@@ -69,7 +69,6 @@ public:
|
|||||||
|
|
||||||
virtual const QString name() const { return QString( "Google" ); }
|
virtual const QString name() const { return QString( "Google" ); }
|
||||||
virtual const QString friendlyName() const { return "Google"; }
|
virtual const QString friendlyName() const { return "Google"; }
|
||||||
virtual QPixmap icon() const;
|
|
||||||
|
|
||||||
virtual SipPlugin* sipPlugin();
|
virtual SipPlugin* sipPlugin();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user