summaryrefslogtreecommitdiffstats
path: root/pica-client/accounts.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'pica-client/accounts.cpp')
-rw-r--r--pica-client/accounts.cpp18
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();