Commit baa1e37b authored by Dario Freddi's avatar Dario Freddi
Browse files

Basic error handling


Signed-off-by: default avatarDario Freddi <drf@kde.org>
parent 9391d967
......@@ -32,7 +32,6 @@ void OperationPrivate::concurrentValidate()
validateLoop.data()->exec();
}
validateLoop.data()->deleteLater();
qDebug() << "Validated";
}
Operation::Operation(const QString &targetName)
......
......@@ -19,6 +19,7 @@
#include <QDebug>
#include <akabeioperationrunner.h>
#include <operations/akabeiplaininstalloperation.h>
#include <akabeierror.h>
Macky::Macky(Macky::Action action, const QStringList& targets)
: QObject(0)
......@@ -85,12 +86,22 @@ void Macky::performInstall()
backend->operationRunner()->append(new Akabei::PlainInstallOperation(p));
}
out << "validating..." << endl;
out << "Validating transaction... ";
out.flush();
QEventLoop e;
connect(backend->operationRunner(), SIGNAL(validated(bool)), &e, SLOT(quit()));
backend->operationRunner()->validate();
e.exec();
out << "validated" << endl;
if (backend->operationRunner()->errors().isEmpty()) {
out << "Done." << endl;
} else {
out << "Failed! More details follow." << endl;
foreach (Akabei::Error *err, backend->operationRunner()->errors()) {
out << err->description() << endl;
}
QCoreApplication::instance()->exit(1);
return;
}
connect(backend->operationRunner(), SIGNAL(finished(bool)), &e, SLOT(quit()));
backend->operationRunner()->run();
e.exec();
......
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