Commit 2b801248 authored by Lisa's avatar Lisa

New formatByteSize function used to display sizes.

parent ec4ad021
......@@ -50,9 +50,9 @@ add_subdirectory(docs)
#qt4_automoc(${guzuta_SRCS})
kde4_add_executable(akabei ${apm_SRCS})
target_link_libraries(akabei ${KDE4_KDECORE_LIBRARY} ${KDE4_KIO_LIBRARY} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
target_link_libraries(akabei ${KDE4_KDECORE_LIBRARY} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
install(TARGETS akabei ${INSTALL_TARGETS_DEFAULT_ARGS})
kde4_add_executable(pakabei ${apm_SRCS})
target_link_libraries(pakabei ${KDE4_KDECORE_LIBRARY} ${KDE4_KIO_LIBRARY} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
target_link_libraries(pakabei ${KDE4_KDECORE_LIBRARY} ${AKABEICORE_LIBRARIES} ${AKABEICLIENT_LIBRARIES})
install(TARGETS pakabei ${INSTALL_TARGETS_DEFAULT_ARGS})
......@@ -12,6 +12,7 @@
#include "fieldnames.h"
#include "utils.h"
#include <akabeierror.h>
#include <akabeibackend.h>
#include <akabeigroup.h>
#include <akabeidatabase.h>
......@@ -19,7 +20,6 @@
#include <akabeihelpers.h>
#include <klocale.h>
#include <QTextStream>
#include <kio/global.h>
#include <kdebug.h>
#include <QDate>
#include <QFile>
......@@ -31,8 +31,7 @@ QueryOperation::QueryOperation(QList<APM::OperationName> operations, QHash<APM::
, m_operations(operations)
, m_options(options)
, m_args(args)
{
}
{}
QueryOperation::~QueryOperation()
{
......
......@@ -15,7 +15,6 @@
#include <akabeiclienttransactionhandler.h>
#include <akabeiclientqueue.h>
#include <QTextStream>
#include <kio/global.h>
#include <akabeiconfig.h>
#include <klocale.h>
#include <QFile>
......@@ -28,6 +27,7 @@
#include <stdio.h>
#include <QCoreApplication>
#include <akabeidatabase.h>
#include <akabeihelpers.h>
const int UPDATE_INTERVAL = 500;
......@@ -271,12 +271,12 @@ void QueueOperation::validationFinished(bool valid)
}
out << endl;
if (downloadSize > 0) {
out << i18n("Download size: %1", KIO::convertSize(downloadSize)) << endl;
out << i18n("Download size: %1", Akabei::Helpers::formatByteSize(downloadSize)) << endl;
}
if (installSize > 0) {
out << i18n("Install size: %1", KIO::convertSize(installSize)) << endl;
out << i18n("Install size: %1", Akabei::Helpers::formatByteSize(installSize)) << endl;
} else if (installSize < 0) {
out << i18n("Freed size after transaction: %1", KIO::convertSize(installSize * (-1))) << endl;
out << i18n("Freed size after transaction: %1", Akabei::Helpers::formatByteSize(installSize * (-1))) << endl;
}
out << i18n("Continue with processing?[Y/n]");
......
......@@ -17,7 +17,6 @@
#include <akabeiclienttransactionhandler.h>
#include <akabeioperationrunner.h>
#include <kdebug.h>
#include <kio/global.h>
#include <qcoreapplication.h>
#include <klocale.h>
#include <iostream>
......
......@@ -32,7 +32,6 @@
#include <klocale.h>
#include <kdebug.h>
#include <kio/global.h>
#include <iostream>
......
......@@ -17,7 +17,6 @@
#include <klocale.h>
#include <akabeiconfig.h>
#include <QFile>
#include <kio/global.h>
#include <QDir>
#include <akabeioperationrunner.h>
#include <QCoreApplication>
......
......@@ -14,13 +14,12 @@
#include <akabeigroup.h>
#include <akabeidatabase.h>
#include <akabeipackage.h>
#include <akabeihelpers.h>
#include <akabeigroup.h>
#include <klocale.h>
#include <QDateTime>
#include <QDebug>
#include <kio/global.h>
namespace Utils {
void printPackageInformation(Akabei::Package const * p, QTextStream &out, bool showLess, bool showMakeDeps)
{
......@@ -65,7 +64,7 @@ void printPackageInformation(Akabei::Package const * p, QTextStream &out, bool s
if (!showLess) {
out << "\t" << qSetFieldWidth(n) << fields["Description:"] << qSetFieldWidth(0) << p->description() << endl;
out << "\t" << qSetFieldWidth(n) << fields["Installation size:"] << qSetFieldWidth(0) << KIO::convertSize(p->size());
out << "\t" << qSetFieldWidth(n) << fields["Installation size:"] << qSetFieldWidth(0) << Akabei::Helpers::formatByteSize(p->size());
out << "\t" << qSetFieldWidth(0) << fields["Architecture:"] << " " << p->arch() << endl;
out << "\t" << qSetFieldWidth(n) << fields["Homepage:"] << qSetFieldWidth(0) << p->url().toString() << endl;
out << "\t" << qSetFieldWidth(n) << fields["Licenses:"] << qSetFieldWidth(0) << (p->licenses().isEmpty() ? i18n("None") : p->licenses().join(" ")) << 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