void DataBase::addNewUser(QString accessToken, QString accessTokenSecret, QString displayName) { connect(); QSqlQuery addNewUserQuery("INSERT INTO users (accessTokenKey, accessTokenSecret, displayName, usertype) VALUES(\""+accessToken+"\",\""+accessTokenSecret+"\",\""+displayName+"\",1)"); addNewUserQuery.finish(); emit userAdded(); }
KviRegisteredUser * KviRegisteredUserDataBase::addUser(const QString & name) { if(name.isEmpty()) return 0; if(m_pUserDict->find(name))return 0; KviRegisteredUser * u = new KviRegisteredUser(name); m_pUserDict->replace(u->name(),u); //u->name() because we're NOT copying keys! emit(userAdded(name)); return u; }
void Chat::addUser(QString const& user) { if (!m_users.contains(user)) { m_users.append(user); emit userAdded(user); } }