Commit f59ce86b authored by Lisa's avatar Lisa
Browse files

Returns a list of unique groups with groups()

parent d0695baf
...@@ -413,8 +413,16 @@ void BackendPrivate::groupQueryFinished() ...@@ -413,8 +413,16 @@ void BackendPrivate::groupQueryFinished()
QFuture< QList< Group* > > const& future = queryGroupFuturePool[uuid]->future(); QFuture< QList< Group* > > const& future = queryGroupFuturePool[uuid]->future();
QList< Group* > result; QList< Group* > result;
/*
* Since the same groups are repeated across different databases,
* avoid adding duplicates to the final list.
*/
foreach (QList< Group* > res, future.results()) { foreach (QList< Group* > res, future.results()) {
result += res; foreach (Group* group, res) {
if (!result.contains(group)) {
result << group;
}
}
} }
emit q->queryGroupsCompleted(uuid, result); emit q->queryGroupsCompleted(uuid, result);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment