diff options
| author | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-01-20 15:42:53 +0000 |
|---|---|---|
| committer | me_desk <me_desk@fb96df88-216d-11de-830c-f3023f12d8ac> | 2013-01-20 15:42:53 +0000 |
| commit | dcec9bcedc769372f1d2a84d24755a8dda43238f (patch) | |
| tree | 81eba4fddcfbe7a015052e5332b839c717d3cce3 /pica-client/accounts.cpp | |
| parent | da68f9e85db0f232656542564bd770240e28110e (diff) | |
| download | pica-pica-dcec9bcedc769372f1d2a84d24755a8dda43238f.tar.gz pica-pica-dcec9bcedc769372f1d2a84d24755a8dda43238f.zip | |
displaying history in chatwindow
git-svn-id: svn://localhost/project_picapica/trunk@221 fb96df88-216d-11de-830c-f3023f12d8ac
Diffstat (limited to 'pica-client/accounts.cpp')
| -rw-r--r-- | pica-client/accounts.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/pica-client/accounts.cpp b/pica-client/accounts.cpp index e9cf0e9..eb7b035 100644 --- a/pica-client/accounts.cpp +++ b/pica-client/accounts.cpp @@ -73,6 +73,24 @@ QList<Accounts::AccountRecord> Accounts::GetAccounts() return L; } +QString Accounts::GetName(quint32 id) +{ + QSqlQuery query; + + query.prepare("select name from accounts where id=:id"); + query.bindValue(":id", id); + query.exec(); + + lasterr=query.lastError(); + + if (lasterr.isValid()) + return QString::null; + + query.next(); + + return query.value(0).toString(); +} + bool Accounts::isOK() { return !lasterr.isValid(); |
