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

@@ -38,6 +38,9 @@ namespace BlackCore
Q_OBJECT
public:
//! Constructor
CInputManager(QObject *parent = nullptr);
//! Register new action
void registerAction(const QString &action, const QPixmap &icon = BlackMisc::CIcons::empty16());
@@ -93,9 +96,6 @@ namespace BlackCore
//! Releases all devices
void releaseDevices();
//! Creates a native keyboard handler object
static CInputManager *instance();
signals:
//! Event hotkeyfunction occured
void remoteActionFromLocal(const QString &action, bool argument);
@@ -109,12 +109,6 @@ namespace BlackCore
//! New hotkey action is registered
void hotkeyActionRegistered(const QStringList &actions);
protected:
//! Constructor
CInputManager(QObject *parent = nullptr);
private:
//! Handle to a bound action
struct BindInfo