Commit 12b2e997 authored by Lukas Appelhans's avatar Lukas Appelhans

Multiple stuff which is needed for new features

parent d10ef500
......@@ -42,7 +42,8 @@ void QueryOperation::start(QList<APM::Operation> operations, QMultiHash<APM::Ope
if (operations.contains(APM::QueryPackageFile)) {
showInformation(QList<Akabei::Package*>() << Akabei::Backend::instance()->loadPackageFromFile(args.first()));
} else {
showInformation(Akabei::Backend::instance()->localDatabase()->searchPackages(args.first()));
showInformation(Akabei::Backend::instance()->localDatabase()->queryPackages("SELECT * FROM packages WHERE Name LIKE \"" + args.first() + "\""));
//CHange back to searchPackages when we have sorted results after Name and description
}
} else if (operations.contains(APM::ShowPackagesOfGroup)) {
if (args.isEmpty())
......
......@@ -357,7 +357,7 @@ void SyncOperation::databaseErrorTriggered(int error)
{
QTextStream out(stdout);
//FIXME: Show proper error message
out << "There has been an error while updating " << static_cast<AkabeiClient::DatabaseHandler*>(QObject::sender())->name() << endl;
out << i18n("There has been an error while updating %1!", static_cast<AkabeiClient::DatabaseHandler*>(QObject::sender())->name()) << endl;
}
void SyncOperation::databaseProgressChanged(int progress)
......@@ -374,22 +374,29 @@ void SyncOperation::databaseProgressChanged(int progress)
}
}
out << "] " << progress << "% ";//FIXME
if (progress == 100) {
out << endl;
} else {
//if (progress == 100) {
// out << endl;
//} else {
out << "\r";
}
//}
out.flush();
}
void SyncOperation::databaseStatusChanged(AkabeiClient::DatabaseHandler::Status status)
{
if (status != AkabeiClient::DatabaseHandler::StatusFinished)
if (status != AkabeiClient::DatabaseHandler::StatusFinished && status != AkabeiClient::DatabaseHandler::StatusUpToDate)
return;
AkabeiClient::DatabaseHandler* db = AkabeiClient::Backend::instance()->databases().at(m_currentDatabasePos);
disconnect(db, SIGNAL(statusChanged(AkabeiClient::DatabaseHandler::Status)), this, SLOT(databaseStatusChanged(AkabeiClient::DatabaseHandler::Status)));
disconnect(db, SIGNAL(progress(int)), this, SLOT(databaseProgressChanged(int)));
disconnect(db, SIGNAL(errorTriggered(int)), this, SLOT(databaseErrorTriggered(int)));
QTextStream out(stdout);
if (status == AkabeiClient::DatabaseHandler::StatusUpToDate) {
out << i18n("%1 already up to date!", db->name()) << endl;
} else {
out << i18n("%1 updated!", db->name()) << endl;
}
m_currentDatabasePos++;
updateNextDatabase();
......
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