diff options
| author | Anton <anton@picapica> | 2019-05-16 21:57:53 +0400 |
|---|---|---|
| committer | Anton <anton@picapica> | 2019-05-16 21:57:53 +0400 |
| commit | 6e1d6c845ee9b3d11379cee5cec6bcc7f2f9c612 (patch) | |
| tree | 7d6f275a00a49b6a97e6254b05276bf5eb69e3ae /pica-client/contacts.cpp | |
| parent | 850b332e7e591064bd8b3245554a05752240408e (diff) | |
| download | pica-pica-6e1d6c845ee9b3d11379cee5cec6bcc7f2f9c612.tar.gz pica-pica-6e1d6c845ee9b3d11379cee5cec6bcc7f2f9c612.zip | |
pica-client: view blacklisted contacts, move contacts to and from blaclist in contact list
Diffstat (limited to 'pica-client/contacts.cpp')
| -rw-r--r-- | pica-client/contacts.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/pica-client/contacts.cpp b/pica-client/contacts.cpp index 945b193..fb2467b 100644 --- a/pica-client/contacts.cpp +++ b/pica-client/contacts.cpp @@ -126,6 +126,7 @@ QList<Contacts::ContactRecord> Contacts::GetContacts(ContactType type) { r.id = query.value(0).toByteArray(); r.name = query.value(1).toString(); + r.type = type; //CSTRL.append(" ("+query.value(0).toString()+") "+query.value(1).toString()); L << r; } @@ -198,3 +199,16 @@ void Contacts::SetContactName(QByteArray id, QString name) lasterr = query.lastError(); } +void Contacts::SetContactType(QByteArray id, ContactType type) +{ + QSqlQuery query; + + query.prepare("update contacts set type=:type where id=:id and account_id=:account_id"); + query.bindValue(":type", type); + query.bindValue(":id", id); + query.bindValue(":account_id", account_id_); + query.exec(); + + lasterr = query.lastError(); +} + |
