Commit 023dad27 authored by Lisa's avatar Lisa

Small fix. Function isInstalled used instead of direct query

parent 7fcf13cb
...@@ -216,7 +216,6 @@ void SyncOperation::searchResult(QUuid , QList< Akabei::Package* > packages) ...@@ -216,7 +216,6 @@ void SyncOperation::searchResult(QUuid , QList< Akabei::Package* > packages)
if (p->database() == Akabei::Backend::instance()->localDatabase()) if (p->database() == Akabei::Backend::instance()->localDatabase())
continue; continue;
bool installed = !Akabei::Backend::instance()->localDatabase()->queryPackages("SELECT * FROM packages WHERE name=\"" + p->name() + "\" AND version=\"" + p->version().toByteArray() + "\"").isEmpty();
AkabeiClient::DatabaseHandler * db = 0; AkabeiClient::DatabaseHandler * db = 0;
foreach (AkabeiClient::DatabaseHandler *database, AkabeiClient::Backend::instance()->databases()) { foreach (AkabeiClient::DatabaseHandler *database, AkabeiClient::Backend::instance()->databases()) {
if (database->database() == p->database()) { if (database->database() == p->database()) {
...@@ -229,11 +228,10 @@ void SyncOperation::searchResult(QUuid , QList< Akabei::Package* > packages) ...@@ -229,11 +228,10 @@ void SyncOperation::searchResult(QUuid , QList< Akabei::Package* > packages)
continue; continue;
out << db->name() << '/' << p->name() << ' ' << p->version().toByteArray().data(); out << db->name() << '/' << p->name() << ' ' << p->version().toByteArray().data();
if (installed) if (p->isInstalled())
out << ' ' << i18n("[Installed]"); out << ' ' << i18n("[Installed]") << endl;
if (!m_options.contains(APM::ShowLess)) { if (!m_options.contains(APM::ShowLess)) {
out << endl;
out << " " << p->description() << endl; out << " " << p->description() << endl;
} }
} }
......
...@@ -37,6 +37,8 @@ private slots: ...@@ -37,6 +37,8 @@ private slots:
void install(QUuid,QList<Akabei::Package*>); void install(QUuid,QList<Akabei::Package*>);
void upgrade(QUuid,QList<Akabei::Package*>); void upgrade(QUuid,QList<Akabei::Package*>);
void nextOperation();
private: private:
int m_currentDatabasePos; int m_currentDatabasePos;
int m_maxDbNameLenght; int m_maxDbNameLenght;
...@@ -45,7 +47,6 @@ private: ...@@ -45,7 +47,6 @@ private:
void updateSystem(); void updateSystem();
void updateNextDatabase(); void updateNextDatabase();
void nextOperation();
bool isIgnored(Akabei::Package *); bool isIgnored(Akabei::Package *);
QList<APM::OperationName> m_operations; QList<APM::OperationName> m_operations;
......
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