Commit b97b0d07 authored by Lisa's avatar Lisa

Group listing reflects new fix in the backend

parent 1bf75c0b
......@@ -67,7 +67,8 @@ void QueryOperation::start()
}
case APM::ShowAllGroups: {
listGroups();
connect(backend, SIGNAL(queryGroupsCompleted(QUuid,QList<Akabei::Group*>)), SLOT(listGroups(QUuid,QList<Akabei::Group*>)));
queryId = backend->groups();
break;
}
......@@ -236,27 +237,11 @@ void QueryOperation::showGroup(const QString& groupName, Akabei::Group::List gro
nextOperation();
}
bool QueryOperation::isGroupContained(const Akabei::Group::List& groups, Akabei::Group* g)
void QueryOperation::listGroups(QUuid uuid, QList< Akabei::Group* > groups)
{
foreach (Akabei::Group* group, groups) {
if (group->name() == g->name()) {
return true;
}
}
return false;
}
void QueryOperation::listGroups()
{
Akabei::Group::List groups;
foreach (Akabei::Database* db, Akabei::Backend::instance()->databases()) {
foreach (Akabei::Group* group, db->groups()) {
if (!isGroupContained(groups, group)) {
groups << group;
}
}
if (queryId != uuid) {
nextOperation();
return;
}
QTextStream out(stdout);
......
......@@ -44,8 +44,6 @@ private:
private:
void showInformation(Akabei::Package::List packages);
void showGroup(const QString& groupName, Akabei::Group::List groups);
bool isGroupContained(const Akabei::Group::List &, Akabei::Group *);
void listGroups();
void showChangelog(Akabei::Package::List packages);
void showLog(Akabei::Package::List packages);
void showInstalledAs(Akabei::Package::List);
......@@ -57,6 +55,7 @@ private:
private slots:
void showNotRequired(QUuid, QList<Akabei::Package*>);
void listGroups(QUuid, QList<Akabei::Group*>);
signals:
void queryFinished();
......
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