Commit f945fb39 authored by Lukas Appelhans's avatar Lukas Appelhans

-Qk done

parent a277f06a
......@@ -13,11 +13,14 @@
#include <akabeibackend.h>
#include <akabeigroup.h>
#include <akabeidatabase.h>
#include <akabeiconfig.h>
#include <klocale.h>
#include <QTextStream>
#include <kio/global.h>
#include <kdebug.h>
#include <QDate>
#include <QFile>
#include <QDir>
QueryOperation::QueryOperation(QObject * parent)
: QObject(parent)
......@@ -59,6 +62,12 @@ void QueryOperation::start(QList<APM::Operation> operations, QStringList args)
else
query = query + " InstallReason LIKE 1";
showInstalledAsDeps(Akabei::Backend::instance()->localDatabase()->queryPackages(query));
} else if (operations.contains(APM::CheckFiles)) {
if (args.isEmpty())
return;
connect(Akabei::Backend::instance(), SIGNAL(queryPackagesCompleted(QUuid,QList<Akabei::Package*>)),
SLOT(checkFiles(QUuid,QList<Akabei::Package*>)));
Akabei::Backend::instance()->searchPackages(args.first());
}
}
......@@ -135,3 +144,19 @@ void QueryOperation::showInstalledAsDeps(QList<Akabei::Package*> packages)
out.flush();
}
void QueryOperation::checkFiles(QUuid,QList<Akabei::Package*> packages)
{
if (packages.isEmpty())
return;
Akabei::Package * pkg = packages.first();
QTextStream out(stdout);
int all = 0;
int missing = 0;
foreach (const QString &file, pkg->retrieveFiles()) {
all++;
if (!QFile::exists(Akabei::Config::instance()->rootDir().absoluteFilePath(file)))
missing++;
}
out << pkg->name() << ": " << all << " overall files, " << missing << " file(s) missing" << endl;
}
......@@ -31,6 +31,7 @@ private slots:
void showGroup(QUuid uuid,QList<Akabei::Group*> groups);
void showChangelog(QUuid uuid, QList<Akabei::Package*> packages);
void showInstalledAsDeps(QList<Akabei::Package*>);
void checkFiles(QUuid,QList<Akabei::Package*>);
};
#endif // QUERYOPERATION_H
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