Commit 260f16bd authored by Lukas Appelhans's avatar Lukas Appelhans
Browse files

Show it when a package is upgradeable

parent 2e273e81
...@@ -243,15 +243,19 @@ void SyncOperation::searchResult(QUuid , QList< Akabei::Package* > packages) ...@@ -243,15 +243,19 @@ void SyncOperation::searchResult(QUuid , QList< Akabei::Package* > packages)
continue; continue;
alreadyDisplayed << p->name(); alreadyDisplayed << p->name();
//Search if package is already installed, if so, what version is installed
Akabei::Package::List result = Akabei::Backend::instance()->localDatabase()->searchPackages(p->name(), Akabei::SearchNameEqual);
out << qSetFieldWidth(0); out << qSetFieldWidth(0);
out << "*~ " << db->name() << '/' << p->name(); out << "*~ " << db->name() << '/' << p->name();
if (p->isInstalled()) if (!result.isEmpty() && result.first()->version() == p->version())
out << ' ' << QObject::tr("[Installed]"); out << ' ' << QObject::tr("[Installed]");
else if (!result.isEmpty())
out << ' ' << QObject::tr("[Upgradeable]");
out << endl; out << endl;
if (!m_options.contains(APM::ShowLess)) { if (!m_options.contains(APM::ShowLess)) {
Akabei::Package::List result = Akabei::Backend::instance()->localDatabase()->searchPackages(p->name(), Akabei::SearchNameEqual);
out << "\t" << qSetFieldWidth(n) << fields["Available version:"] << qSetFieldWidth(0) << p->version().toByteArray().constData() << endl; out << "\t" << qSetFieldWidth(n) << fields["Available version:"] << qSetFieldWidth(0) << p->version().toByteArray().constData() << endl;
if (!result.isEmpty() && (!smallDetails || result.first()->version() > p->version())) { if (!result.isEmpty() && (!smallDetails || result.first()->version() > p->version())) {
out << "\t" << qSetFieldWidth(n) << fields["Installed version:"] << qSetFieldWidth(0) << result.first()->version().toByteArray().constData() << endl; out << "\t" << qSetFieldWidth(n) << fields["Installed version:"] << qSetFieldWidth(0) << result.first()->version().toByteArray().constData() << endl;
......
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