Commit d10ef500 authored by Lukas Appelhans's avatar Lukas Appelhans

Exit properly when nothing is giving and smaller things we might need

parent f0ad8216
......@@ -54,7 +54,7 @@ void APM::start()
switch (m_operationType) {
case QueryOperationType: {
QueryOperation * query = new QueryOperation(this);
query->start(m_operations, m_args);
query->start(m_operations, m_options, m_args);
break;
}
case RemoveOperationType: {
......
......@@ -37,7 +37,8 @@ int main(int argc, char** argv)
options.add("D", ki18n("Database operation"));
//FIXME: For example with owsn we should use "owns <File>", this needs different parsing later as we need to use getOption
//FIXME: For example with owns we should use "owns <File>", this needs different parsing later as we need to use getOption
//Doesn't work really with -Qo stuff then :/s
options.add("Q", ki18n("Query operation"));
options.add("c");
options.add("changelog", ki18n("Shows changelog of the package"));
......
......@@ -34,7 +34,7 @@ QueryOperation::~QueryOperation()
}
void QueryOperation::start(QList<APM::Operation> operations, QStringList args)
void QueryOperation::start(QList<APM::Operation> operations, QMultiHash<APM::Operation, QString> options, QStringList args)
{
if (operations.contains(APM::ShowInformation)) {
if (args.isEmpty())
......@@ -80,11 +80,8 @@ void QueryOperation::start(QList<APM::Operation> operations, QStringList args)
showLocalPackages(QString());
else
showLocalPackages(args.first());
} else if (operations.contains(APM::ShowOwner)) {
if (args.isEmpty())
showOwner(QString());
else
showOwner(args.first());
} else if (operations.contains(APM::ShowOwner) && !args.isEmpty()) {
showOwner(args.first());
} else if (operations.contains(APM::SearchLocal)) {
QString query = "SELECT * FROM packages";
if (!args.isEmpty())
......@@ -94,6 +91,8 @@ void QueryOperation::start(QList<APM::Operation> operations, QStringList args)
showNotRequired();
} else if (operations.contains(APM::ShowUpgradeable)) {
showUpgradeable();
} else {
QCoreApplication::instance()->quit();
}
}
......
......@@ -24,7 +24,7 @@ public:
explicit QueryOperation(QObject * parent = 0);
virtual ~QueryOperation();
void start(QList<APM::Operation> operations, QStringList args);
void start(QList<APM::Operation> operations, QMultiHash<APM::Operation, QString> options, QStringList args);
private slots:
void showInformation(QList<Akabei::Package*> packages);
......
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