Added support for settings
This commit is contained in:
+11
-2
@@ -26,7 +26,7 @@ public:
|
||||
m_pluginId = pluginId;
|
||||
}
|
||||
|
||||
QList<QSharedPointer<T> > all() {
|
||||
QList<QSharedPointer<T> > all(const QString &where = "") {
|
||||
odb::database *db = Context::instance().db();
|
||||
|
||||
Q_ASSERT(db);
|
||||
@@ -36,7 +36,16 @@ public:
|
||||
|
||||
try
|
||||
{
|
||||
odb::result<T> res = db->template query<T>();
|
||||
odb::result<T> res;
|
||||
|
||||
if (where.isEmpty())
|
||||
{
|
||||
res = db->template query<T>();
|
||||
}
|
||||
else
|
||||
{
|
||||
res = db->template query<T>(where.toStdString());
|
||||
}
|
||||
|
||||
for (typename odb::result<T>::iterator it = res.begin(); it != res.end(); it++) {
|
||||
ret.append(it.load());
|
||||
|
||||
Reference in New Issue
Block a user