Beispiel #1
0
void chatRoom::displayText(Message *m, int index) {
    QMap<int, User*>::iterator it;
    it = global->find(m->getFrom());
    QString username;
    User *user = it.value();
    if(it == global->end()) {
        username.append("not yet connected");
    }
    else {
        username.append(user->getUsername());
    }
    qDebug() << m->getFrom();
    QString mText(m->getBuffer());
    if(roomID != 0) {
        QTabBar *tabBar = tab->tabBar();
        if(tabID != index) {
            tabBar->setTabTextColor(m->getDest(), Qt::red);
        }
    }
    //display->setStyleSheet("font: 9pt \"Courier\";");
    display->appendPlainText(username + ": " + mText);
}
Beispiel #2
0
// -- convenience alias
BYTE *PBKDF2(const char *text, const char *salt, int count, int length, MemBuf &out) { 
   MemBuf mText( (BYTE*)text, strlen( text ));
   MemBuf mSalt( (BYTE*)salt, strlen( salt ));   
   return PBKDF2( mText, mSalt, count, length, out );
}