Commit c50ca042 authored by Lukas Appelhans's avatar Lukas Appelhans

Quit here as well

parent aa3ff14c
......@@ -21,6 +21,7 @@
#include <QDate>
#include <QFile>
#include <QDir>
#include <QCoreApplication>
QueryOperation::QueryOperation(QObject * parent)
: QObject(parent)
......@@ -126,6 +127,7 @@ void QueryOperation::showInformation(QList<Akabei::Package*> packages)
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();
QCoreApplication::instance()->quit();
}
void QueryOperation::showGroup(QUuid uuid,QList<Akabei::Group*> groups)
......@@ -142,6 +144,7 @@ void QueryOperation::showGroup(QUuid uuid,QList<Akabei::Group*> groups)
foreach (Akabei::Package * pkg, sorted.values())
out << group->name() << ' ' << pkg->name() << endl;
out.flush();
QCoreApplication::instance()->quit();
}
void QueryOperation::showChangelog(QList< Akabei::Package* > packages)
......@@ -152,6 +155,7 @@ void QueryOperation::showChangelog(QList< Akabei::Package* > packages)
QTextStream out(stdout);
out << pkg->retrieveChangelog() << endl;
out.flush();
QCoreApplication::instance()->quit();
}
void QueryOperation::showInstalledAsDeps(QList<Akabei::Package*> packages)
......@@ -165,6 +169,7 @@ void QueryOperation::showInstalledAsDeps(QList<Akabei::Package*> packages)
foreach (Akabei::Package * pkg, sorted.values())
out << pkg->name() << ' ' << pkg->version().toByteArray().data() << endl;
out.flush();
QCoreApplication::instance()->quit();
}
void QueryOperation::checkFiles(QList<Akabei::Package*> packages)
......@@ -182,6 +187,7 @@ void QueryOperation::checkFiles(QList<Akabei::Package*> packages)
}
out << pkg->name() << ": " << all << " overall files, " << missing << " file(s) missing" << endl;
out.flush();
QCoreApplication::instance()->quit();
}
void QueryOperation::showLocalPackages(const QString &query)
......@@ -208,6 +214,7 @@ void QueryOperation::showLocalPackages(const QString &query)
out << pkg->name() << ' ' << pkg->version().toByteArray().data() << endl;
}
out.flush();
QCoreApplication::instance()->quit();
}
void QueryOperation::showOwner(const QString &query)
......@@ -216,6 +223,7 @@ void QueryOperation::showOwner(const QString &query)
if (!QFile::exists(query)) {
out << "File does not exists: " << query << endl;
out.flush();
QCoreApplication::instance()->quit();
return;
}
foreach (Akabei::Package * pkg, Akabei::Backend::instance()->localDatabase()->packages()) {
......@@ -223,12 +231,14 @@ void QueryOperation::showOwner(const QString &query)
if (Akabei::Config::instance()->rootDir().absoluteFilePath(file) == query) {
out << query << " is owned by " << pkg->name() << ' ' << pkg->version().toByteArray().data() << endl;
out.flush();
QCoreApplication::instance()->quit();
return;
}
}
}
out << "Error: No packages owns " << query << endl;
out.flush();
QCoreApplication::instance()->quit();
}
void QueryOperation::showLocalQuery(QList<Akabei::Package*> packages)
......@@ -242,6 +252,7 @@ void QueryOperation::showLocalQuery(QList<Akabei::Package*> packages)
out << "\t" << pkg->description() << endl;
}
out.flush();
QCoreApplication::instance()->quit();
}
void QueryOperation::showNotRequired()
......@@ -258,6 +269,7 @@ void QueryOperation::showNotRequired()
foreach (Akabei::Package * pkg, pkgs.values())
out << pkg->name() << ' ' << pkg->version().toByteArray().data() << endl;
out.flush();
QCoreApplication::instance()->quit();
}
void QueryOperation::showUpgradeable()
......@@ -284,4 +296,5 @@ void QueryOperation::showUpgradeable()
foreach (Akabei::Package * pkg, upgradeable.values())
out << pkg->name() << ' ' << pkg->version().toByteArray().data() << endl;
out.flush();
QCoreApplication::instance()->quit();
}
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