Commit ea03f678 authored by Lisa's avatar Lisa
Browse files

Added deInit method to Backend with operations for a safe exit.

parent 902450ea
......@@ -263,7 +263,7 @@ void Backend::setStatus(Backend::Status s, QObject * cO, const char * cS)
AkabeiLogLine::initialize( Akabei::Config::instance()->useSyslog(), Akabei::Config::instance()->logFile() );
return;
} else if (d->status == StatusOnTransaction) {
} else if (d->status == StatusOnTransaction) {
if (Config::instance()->needsPrivileges()) {
qDebug() << "We need privileges to remove lock";
if (Akabei::Helpers::checkAuthorizationSync("org.chakraproject.akabeicorehelper.filesystem.lock")) {
......@@ -530,6 +530,10 @@ void Backend::initialize()
d->initializationWatcher->setFuture(future);
}
void Backend::deInit()
{
setStatus(Backend::StatusBare); /* remove the lock */
}
Error Backend::initError()
{
......
......@@ -205,6 +205,12 @@ class AKABEICORESHARED_EXPORT Backend : public QObject
* @returns what went wrong during initialization
*/
Error initError();
/**
* This function contains all the operations that must be performed before exiting, either normally or
* as a result of some error.
*/
void deInit();
public Q_SLOTS:
/**
......
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