basic avatar/vcard changes uploads and roster reaction

This commit is contained in:
Blue 2019-10-24 12:42:38 +03:00
parent 652381b067
commit 36c71968bc
8 changed files with 97 additions and 11 deletions

View file

@ -98,6 +98,7 @@ QVariant Models::Roster::data (const QModelIndex& index, int role) const
result = acc->getStatusIcon(false);
} else if (col == 1) {
QString path = acc->getAvatarPath();
if (path.size() > 0) {
result = QIcon(path);
}
@ -641,7 +642,8 @@ void Models::Roster::removeContact(const QString& account, const QString& jid, c
void Models::Roster::onChildChanged(Models::Item* item, int row, int col)
{
QModelIndex index = createIndex(row, 0, item);
emit dataChanged(index, index);
QModelIndex index2 = createIndex(row, 1, item);
emit dataChanged(index, index2);
}
void Models::Roster::onChildIsAboutToBeInserted(Models::Item* parent, int first, int last)

View file

@ -66,7 +66,7 @@ VCard::VCard(const QString& jid, bool edit, QWidget* parent):
}
connect(m_ui->buttonBox, &QDialogButtonBox::accepted, this, &VCard::onButtonBoxAccepted);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, m_ui->buttonBox, &QDialogButtonBox::deleteLater);
connect(m_ui->buttonBox, &QDialogButtonBox::rejected, this, &VCard::close);
avatarButtonMargins = m_ui->avatarButton->size();