Commit f62e5182 authored by Lukas Appelhans's avatar Lukas Appelhans

Multi operations here we gooo

parent be37b085
......@@ -80,7 +80,7 @@ void SyncOperation::start(QList<APM::Operation> operations, QMultiHash<APM::Oper
}
m_currentDatabasePos = 0;
updateNextDatabase();
} else {
} else if (!args.isEmpty()) {
QString query = "SELECT * FROM packages WHERE";
foreach (const QString &pkg, args) {
query = query + " Name LIKE \"" + pkg + "\"";
......@@ -89,6 +89,8 @@ void SyncOperation::start(QList<APM::Operation> operations, QMultiHash<APM::Oper
}
connect(Akabei::Backend::instance(), SIGNAL(queryPackagesCompleted(QUuid,QList<Akabei::Package*>)), SLOT(install(QUuid,QList<Akabei::Package*>)));
Akabei::Backend::instance()->queryPackages(query);
} else {
QCoreApplication::instance()->quit();
}
}
......@@ -367,7 +369,9 @@ void SyncOperation::updateNextDatabase()
if (m_currentDatabasePos == AkabeiClient::Backend::instance()->databases().count()) {
QTextStream out(stdout);
out << tr("Updating all databases finished") << endl;
QCoreApplication::instance()->quit();
QList<APM::Operation> opts = m_operations;
opts.removeAll(APM::UpdateDatabases);
start(opts, m_options, m_args);
return;
}
AkabeiClient::DatabaseHandler* db = AkabeiClient::Backend::instance()->databases().at(m_currentDatabasePos);
......
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