Commit ec4ad021 authored by Lisa's avatar Lisa

deInit now always called before exiting from anything

parent 1a027786
......@@ -33,7 +33,7 @@ OperationManager::OperationManager(APM::OperationType type, QList<APM::Operation
m_operations(operations),
m_options(options),
m_args(args)
{
{
connect(AkabeiClient::Backend::instance(), SIGNAL(statusChanged(Akabei::Backend::Status)), SLOT(statusChanged(Akabei::Backend::Status)), Qt::QueuedConnection);
QString root;
QString cache;
......@@ -102,31 +102,31 @@ void OperationManager::start()
switch (m_type) {
case APM::QueryOperationType: {
QueryOperation * query = new QueryOperation(m_operations, m_options, m_args, this);
connect(query, SIGNAL(queryFinished()), QCoreApplication::instance(), SLOT(quit()));
connect(query, SIGNAL(queryFinished()), this, SLOT(quit()));
query->start();
break;
}
case APM::RemoveOperationType: {
RemoveOperation * remove = new RemoveOperation(m_operations, m_options, m_args, this);
connect(remove, SIGNAL(removeFinished()), QCoreApplication::instance(), SLOT(quit()));
connect(remove, SIGNAL(removeFinished()), this, SLOT(quit()));
remove->start();
break;
}
case APM::SyncOperationType: {
SyncOperation * sync = new SyncOperation(m_operations, m_options, m_args, this);
connect(sync, SIGNAL(syncFinished()), QCoreApplication::instance(), SLOT(quit()));
connect(sync, SIGNAL(syncFinished()), this, SLOT(quit()));
sync->start();
break;
}
case APM::UpgradeOperationType: {
UpgradeOperation * upgrade = new UpgradeOperation(this);
connect(upgrade, SIGNAL(upgradeFinished()), QCoreApplication::instance(), SLOT(quit()));
connect(upgrade, SIGNAL(upgradeFinished()), this, SLOT(quit()));
upgrade->start(m_operations, m_options, m_args);
break;
}
case APM::PerformOperationType: {
PerformOperation * perform = new PerformOperation(this);
connect(perform, SIGNAL(performFinished()), QCoreApplication::instance(), SLOT(quit()));
connect(perform, SIGNAL(performFinished()), this, SLOT(quit()));
perform->start(m_options, m_args);
break;
}
......@@ -135,4 +135,10 @@ void OperationManager::start()
}
}
void OperationManager::quit()
{
Akabei::Backend::instance()->deInit();
QCoreApplication::instance()->quit();
}
#include "apm.moc"
......@@ -27,6 +27,7 @@ public:
private slots:
void statusChanged(Akabei::Backend::Status);
void start();
void quit();
private:
APM::OperationType m_type;
......
......@@ -287,10 +287,6 @@ void QueueOperation::validationFinished(bool valid)
/* No confirmation given */
if (!input.empty() && input != i18n("y").toStdString()) {
/* Operations to perform before exiting */
Akabei::Backend::instance()->deInit();
emit finished();
return;
}
......
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