diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-08-30 13:34:02 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-08-30 13:34:02 +0000 |
| commit | 0ef7c1d7471ce20fe54729c27858db864aedee91 (patch) | |
| tree | 3a71b713febdbea19fc7358af68d9f6cfa3c3158 /pica-client/contactlistwidget.cpp | |
| parent | bfd5528f28264772a245dc29f41d4bb5d29fb1eb (diff) | |
| download | pica-pica-0ef7c1d7471ce20fe54729c27858db864aedee91.tar.gz pica-pica-0ef7c1d7471ce20fe54729c27858db864aedee91.zip | |
updated pica-client to make it handle new id format. quint32 type for id is replaced with QByteArray in most places. Implemented verification callbacks in client and node that allow self-signed certificates
git-svn-id: svn://localhost/project_picapica/trunk@266 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/contactlistwidget.cpp')
| -rw-r--r-- | pica-client/contactlistwidget.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/pica-client/contactlistwidget.cpp b/pica-client/contactlistwidget.cpp index 130357f..c3096d8 100644 --- a/pica-client/contactlistwidget.cpp +++ b/pica-client/contactlistwidget.cpp @@ -27,7 +27,7 @@ ContactListWidget::ContactListWidget(QWidget *parent) : connect(this, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(start_chat())); - setContactsStorage(new Contacts(config_dbname, account_id)); + setContactsStorage(new Contacts(config_dbname, QByteArray((const char*)account_id, PICA_ID_SIZE))); } ContactListWidget::~ContactListWidget() @@ -63,9 +63,9 @@ void ContactListWidget::setContactsStorage(Contacts *ct) for (int i=0;i<contact_records.size();i++) { - addItem(QString("(%1) ").arg(contact_records[i].id)+contact_records[i].name); + addItem(QString("(%1) ").arg(contact_records[i].id.toBase64()+contact_records[i].name)); wgitem_to_recs[this->item(i)]=&contact_records[i]; - this->item(i)->setStatusTip(QString().setNum(contact_records[i].id)); + this->item(i)->setStatusTip(contact_records[i].id.toBase64()); } } @@ -76,9 +76,9 @@ void ContactListWidget::add_contact() if (ok && !input.isEmpty()) { - quint32 user_id=input.toUInt(&ok); + QByteArray user_id = QByteArray::fromBase64(input.toAscii()).left(PICA_ID_SIZE); - if (!ok) + if (user_id.size() != PICA_ID_SIZE) { QMessageBox mbx; mbx.setIcon(QMessageBox::Warning); @@ -92,7 +92,7 @@ void ContactListWidget::add_contact() { QMessageBox mbx; mbx.setIcon(QMessageBox::Warning); - mbx.setText(tr("User \"(%1) %2\" already exists").arg(user_id).arg(contact_records[i].name)); + mbx.setText(tr("User \"(%1) %2\" already exists").arg(user_id.toBase64().constData()).arg(contact_records[i].name)); mbx.exec(); return; } @@ -113,7 +113,7 @@ void ContactListWidget::add_contact() return; } - addItem(QString("(%1) ").arg(user_id)); + addItem(QString("(%1) ").arg(user_id.toBase64().constData())); contact_records.append(r); wgitem_to_recs[this->item(this->count()-1)]=&contact_records.last(); @@ -132,7 +132,7 @@ mbx.setDefaultButton(QMessageBox::No); if (QMessageBox::Yes==mbx.exec()) { - quint32 rm_id; + QByteArray rm_id; QListWidgetItem *rm_ptr; storage->Delete(rm_id = wgitem_to_recs[currentItem()]->id); |
