Core: Keep track of modes in the ModeManager directly

... instead of having the indirection of the global object pool.

ModeManagerPrivate has been maintaining the list of instantiated
modes by tracking (all...) pool object additions / removals. This
can be achieved more directly by calling functions from the
IMode base constructor/destructor.

The pattern used deviates a bit from the otherwise used 'static
QList<Foo *> allFoos();' acessor pattern as there is some sorting
logic etc. associated each time a mode is appended.
Sticking to the preexisting structure seemed less effort for now.

Change-Id: Ic1b4e641e155f949248890acc48cafbe74025115
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
This commit is contained in:
hjk
2018-01-19 15:51:23 +01:00
parent 437590a999
commit cf7f898db3
4 changed files with 41 additions and 55 deletions

View File

@@ -311,7 +311,6 @@ bool MainWindow::init(QString *errorMessage)
PluginManager::addObject(m_coreImpl);
m_statusBarManager->init();
m_modeManager->init();
m_progressManager->init(); // needs the status bar manager
PluginManager::addObject(m_generalSettings);