ICore: Make sure main window is initialized

Initialize main window even if no ICore instance is created, so in that
case methods like raiseWindow and dialogParent will still work.

Change-Id: I7b435dedac574bcc120e996c198c413fd5ccfe6f
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Eike Ziller
2016-09-26 15:13:44 +02:00
parent 9c9485e15b
commit 79be19a8a0

View File

@@ -297,8 +297,8 @@ using namespace ExtensionSystem;
namespace Core {
// The Core Singleton
static ICore *m_instance = 0;
static MainWindow *m_mainwindow;
static ICore *m_instance = nullptr;
static MainWindow *m_mainwindow = nullptr;
ICore *ICore::instance()
{
@@ -517,7 +517,7 @@ void ICore::raiseWindow(QWidget *widget)
if (!widget)
return;
QWidget *window = widget->window();
if (window == m_mainwindow) {
if (window && window == m_mainwindow) {
m_mainwindow->raiseWindow();
} else {
window->raise();