1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 11:20:22 +02:00

Protect-ize account members and some methods

This commit is contained in:
Jeff Mitchell
2011-11-05 19:32:57 -04:00
parent d50e41f4d2
commit 8b862774c9
3 changed files with 8 additions and 8 deletions

View File

@@ -129,9 +129,14 @@ public:
syncConfig(); syncConfig();
} }
virtual void sync() { QMutexLocker locker( &m_mutex ); syncConfig(); };
signals:
void configurationChanged();
protected:
virtual void loadFromConfig( const QString &accountId ) virtual void loadFromConfig( const QString &accountId )
{ {
QMutexLocker locker( &m_mutex );
m_accountId = accountId; m_accountId = accountId;
TomahawkSettings* s = TomahawkSettings::instance(); TomahawkSettings* s = TomahawkSettings::instance();
s->beginGroup( "accounts/" + m_accountId ); s->beginGroup( "accounts/" + m_accountId );
@@ -147,7 +152,6 @@ public:
virtual void syncConfig() virtual void syncConfig()
{ {
QMutexLocker locker( &m_mutex );
TomahawkSettings* s = TomahawkSettings::instance(); TomahawkSettings* s = TomahawkSettings::instance();
s->beginGroup( "accounts/" + m_accountId ); s->beginGroup( "accounts/" + m_accountId );
s->setValue( "accountfriendlyname", m_accountFriendlyName ); s->setValue( "accountfriendlyname", m_accountFriendlyName );
@@ -171,10 +175,6 @@ public:
QVariantMap m_acl; QVariantMap m_acl;
QStringList m_types; QStringList m_types;
mutable QMutex m_mutex; mutable QMutex m_mutex;
signals:
void configurationChanged();
}; };
class DLLEXPORT AccountFactory : public QObject class DLLEXPORT AccountFactory : public QObject

View File

@@ -94,7 +94,7 @@ private slots:
void profilePicReply(); void profilePicReply();
private: private:
inline void syncConfig() { m_account->setCredentials( m_credentials ); m_account->setConfiguration( m_configuration ); m_account->syncConfig(); } inline void syncConfig() { m_account->setCredentials( m_credentials ); m_account->setConfiguration( m_configuration ); m_account->sync(); }
bool refreshTwitterAuth(); bool refreshTwitterAuth();
void parseGotTomahawk( const QRegExp &regex, const QString &screenName, const QString &text ); void parseGotTomahawk( const QRegExp &regex, const QString &screenName, const QString &text );

View File

@@ -467,7 +467,7 @@ XmppSipPlugin::configurationChanged()
QVariantHash credentials = m_account->credentials(); QVariantHash credentials = m_account->credentials();
credentials[ "username" ] = m_currentUsername; credentials[ "username" ] = m_currentUsername;
m_account->setCredentials( credentials ); m_account->setCredentials( credentials );
m_account->syncConfig(); m_account->sync();
} }
if ( reconnect ) if ( reconnect )