Commit f4b4d25a authored by Lukas Appelhans's avatar Lukas Appelhans

Show full information

parent ee4d62a4
......@@ -18,4 +18,4 @@ include_directories(${QT_INCLUDES}
set(apm_SRCS apm.cpp queryoperation.cpp main.cpp)
#qt4_automoc(${guzuta_SRCS})
kde4_add_executable(akabei ${apm_SRCS})
target_link_libraries(akabei ${KDE4_KDEUI_LIBRARY} ${AKABEICLIENT_LIBRARIES})
target_link_libraries(akabei ${KDE4_KDEUI_LIBRARY} ${KDE4_KIO_LIBRARY} ${AKABEICLIENT_LIBRARIES})
......@@ -11,8 +11,11 @@
#include "queryoperation.h"
#include <akabeibackend.h>
#include <akabeigroup.h>
#include <klocale.h>
#include <QTextStream>
#include <kio/global.h>
#include <QDate>
QueryOperation::QueryOperation(QObject * parent)
: QObject(parent)
......@@ -43,8 +46,28 @@ void QueryOperation::showInformation(QUuid uuid,QList<Akabei::Package*> packages
return;
Akabei::Package * pkg = packages.first();
QTextStream out(stdout);
out << i18n("Name:") << pkg->name() << endl;
out << i18n("Version:") << QString(pkg->version().toByteArray().data()) << endl;
out << i18n("URL") << pkg->url().toString() << endl;
out.setFieldWidth(30);
out.setFieldAlignment(QTextStream::AlignLeft);
out << i18n("Name") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->name() << endl;
out << i18n("Version") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << QString(pkg->version().toByteArray().data()) << endl;
out << i18n("URL") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->url().toString() << endl;
out << i18n("Licenses") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->license() << endl;
QStringList groups;
foreach (Akabei::Group * g, pkg->groups())
groups << g->name();
out << i18n("Groups") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << groups.join(" ") << endl;
out << i18n("Provides") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->provides().join(" ") << endl;
out << i18n("Depends on") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->dependencies().join(" ") << endl;
out << i18n("Optional dependencies") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->optionalDependencies().join(" ") << endl;
//out << i18n("Required by:") << pkg->
out << i18n("Replaces") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->replaces().join(" ") << endl;
out << i18n("Installation size") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << KIO::convertSize(pkg->size()) << endl;
out << i18n("Packager") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->packager() << endl;
out << i18n("Architecture") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->arch() << endl;
out << i18n("Creation time") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->buildDate().toString() << endl;
out << i18n("Installation time") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->installDate().toString() << endl;
out << i18n("Install reason") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << ((pkg->installReason() == Akabei::Package::InstalledAsDependencyReason) ? i18n("Installed as dependency") : i18n("Installed explicitely")) << endl;
out << i18n("Installation script") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << (pkg->hasScriptlet() ? i18n("Yes") : i18n("No")) << endl;
out << i18n("Description") << qSetFieldWidth(2) << ":" << qSetFieldWidth(20) << pkg->description() << endl;
out.flush();
}
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