Move CInputManager from singleton to CApplication member

The main reason why CInputManager was singleton is the easy access across
the code. That had the negative side effect that time of destruction was
at a very late stage of the shutdown and could not be controlled by us.
My moving it to CApplication, the access is equally easy (using sApp) and
allows to be cleaned up properly during graceful shutdown.

ref T391
This commit is contained in:
Roland Winklmeier
2018-10-12 12:08:02 +02:00
committed by Klaus Basan
parent 705a56b1cb
commit f6ea2a9107
14 changed files with 86 additions and 72 deletions

View File

@@ -7,6 +7,7 @@
* contained in the LICENSE file.
*/
#include "blackcore/application.h"
#include "blackcore/context/contextapplicationimpl.h"
#include "blackcore/inputmanager.h"
#include "blackmisc/dbusserver.h"
@@ -161,7 +162,7 @@ namespace BlackCore
{
m_registeredApplications.push_back(identifier);
emit this->registrationChanged();
emit this->hotkeyActionsRegistered(CInputManager::instance()->allAvailableActions(), {});
emit this->hotkeyActionsRegistered(sApp->getInputManager()->allAvailableActions(), {});
}
else
{