mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
Small changes to jabber SIP
Access config less often and read more from member variables
This commit is contained in:
@@ -76,15 +76,17 @@ JabberPlugin::JabberPlugin( const QString& pluginId )
|
|||||||
m_ui->setupUi( m_configWidget.data() );
|
m_ui->setupUi( m_configWidget.data() );
|
||||||
m_configWidget.data()->setVisible( false );
|
m_configWidget.data()->setVisible( false );
|
||||||
|
|
||||||
m_ui->jabberUsername->setText( accountName() );
|
|
||||||
m_ui->jabberPassword->setText( readPassword() );
|
|
||||||
m_ui->jabberServer->setText( readServer() );
|
|
||||||
m_ui->jabberPort->setValue( readPort() );
|
|
||||||
m_ui->jidExistsLabel->hide();
|
|
||||||
m_currentUsername = accountName();
|
m_currentUsername = accountName();
|
||||||
m_currentServer = readServer();
|
m_currentServer = readServer();
|
||||||
m_currentPassword = readPassword();
|
m_currentPassword = readPassword();
|
||||||
m_currentPort = readPort();
|
m_currentPort = readPort();
|
||||||
|
|
||||||
|
m_ui->jabberUsername->setText( m_currentUsername );
|
||||||
|
m_ui->jabberPassword->setText( m_currentPassword );
|
||||||
|
m_ui->jabberServer->setText( m_currentServer );
|
||||||
|
m_ui->jabberPort->setValue( m_currentPort );
|
||||||
|
m_ui->jidExistsLabel->hide();
|
||||||
|
|
||||||
|
|
||||||
connect( m_ui->jabberUsername, SIGNAL( textChanged( QString ) ), SLOT( onCheckJidExists( QString ) ) );
|
connect( m_ui->jabberUsername, SIGNAL( textChanged( QString ) ), SLOT( onCheckJidExists( QString ) ) );
|
||||||
// setup JID object
|
// setup JID object
|
||||||
@@ -481,19 +483,35 @@ void
|
|||||||
JabberPlugin::checkSettings()
|
JabberPlugin::checkSettings()
|
||||||
{
|
{
|
||||||
bool reconnect = false;
|
bool reconnect = false;
|
||||||
if ( m_currentUsername != accountName() )
|
|
||||||
|
QString username, password, server;
|
||||||
|
int port;
|
||||||
|
|
||||||
|
username = accountName();
|
||||||
|
password = readPassword();
|
||||||
|
server = readServer();
|
||||||
|
port = readPort();
|
||||||
|
|
||||||
|
if ( m_currentUsername != username )
|
||||||
|
{
|
||||||
|
m_currentUsername = username;
|
||||||
reconnect = true;
|
reconnect = true;
|
||||||
if ( m_currentPassword != readPassword() )
|
}
|
||||||
|
if ( m_currentPassword != password )
|
||||||
|
{
|
||||||
|
m_currentPassword = password;
|
||||||
reconnect = true;
|
reconnect = true;
|
||||||
if ( m_currentServer != readServer() )
|
}
|
||||||
|
if ( m_currentServer != server )
|
||||||
|
{
|
||||||
|
m_currentServer = server;
|
||||||
reconnect = true;
|
reconnect = true;
|
||||||
|
}
|
||||||
if ( m_currentPort != readPort() )
|
if ( m_currentPort != readPort() )
|
||||||
|
{
|
||||||
|
m_currentPort = port;
|
||||||
reconnect = true;
|
reconnect = true;
|
||||||
|
}
|
||||||
m_currentUsername = accountName();
|
|
||||||
m_currentPassword = readPassword();
|
|
||||||
m_currentServer = readServer();
|
|
||||||
m_currentPort = readPort();
|
|
||||||
|
|
||||||
if ( !m_currentUsername.contains( '@' ) )
|
if ( !m_currentUsername.contains( '@' ) )
|
||||||
{
|
{
|
||||||
@@ -506,11 +524,6 @@ JabberPlugin::checkSettings()
|
|||||||
qDebug() << Q_FUNC_INFO << "Reconnecting jreen plugin...";
|
qDebug() << Q_FUNC_INFO << "Reconnecting jreen plugin...";
|
||||||
disconnectPlugin();
|
disconnectPlugin();
|
||||||
|
|
||||||
m_currentUsername = accountName();
|
|
||||||
m_currentPassword = readPassword();
|
|
||||||
m_currentServer = readServer();
|
|
||||||
m_currentPort = readPort();
|
|
||||||
|
|
||||||
setupClientHelper();
|
setupClientHelper();
|
||||||
|
|
||||||
qDebug() << Q_FUNC_INFO << "Updated settings";
|
qDebug() << Q_FUNC_INFO << "Updated settings";
|
||||||
|
Reference in New Issue
Block a user