void Account::removeFromConfig() { TomahawkSettings* s = TomahawkSettings::instance(); s->beginGroup( "accounts/" + m_accountId ); s->remove( "accountfriendlyname" ); s->remove( "enabled" ); s->remove( "credentials" ); s->remove( "configuration" ); s->remove( "acl" ); s->remove( "types" ); s->endGroup(); s->remove( "accounts/" + m_accountId ); }
void Account::loadFromConfig( const QString& accountId ) { m_accountId = accountId; TomahawkSettings* s = TomahawkSettings::instance(); s->beginGroup( "accounts/" + m_accountId ); m_accountFriendlyName = s->value( "accountfriendlyname", QString() ).toString(); m_enabled = s->value( "enabled", false ).toBool(); m_credentials = s->value( "credentials", QVariantHash() ).toHash(); m_configuration = s->value( "configuration", QVariantHash() ).toHash(); m_acl = s->value( "acl", QVariantMap() ).toMap(); m_types = s->value( "types", QStringList() ).toStringList(); s->endGroup(); }