Don't crash on windows
authorManuel Nickschas <sputnick@quassel-irc.org>
Tue, 16 Feb 2010 01:26:04 +0000 (02:26 +0100)
committerManuel Nickschas <sputnick@quassel-irc.org>
Tue, 16 Feb 2010 01:26:04 +0000 (02:26 +0100)
src/qtui/qtui.cpp
src/uisupport/graphicalui.cpp
src/uisupport/graphicalui.h

index 2a08836..9dbc60a 100644 (file)
@@ -73,6 +73,8 @@ void QtUi::init() {
   _mainWin->init();
   QtUiSettings uiSettings;
   uiSettings.initAndNotify("UseSystemTrayIcon", this, SLOT(useSystemTrayChanged(QVariant)), true);
   _mainWin->init();
   QtUiSettings uiSettings;
   uiSettings.initAndNotify("UseSystemTrayIcon", this, SLOT(useSystemTrayChanged(QVariant)), true);
+
+  GraphicalUi::init(); // needs to be called after the mainWin is initialized
 }
 
 MessageModel *QtUi::createMessageModel(QObject *parent) {
 }
 
 MessageModel *QtUi::createMessageModel(QObject *parent) {
index 5d9a419..f9a3574 100644 (file)
@@ -48,9 +48,13 @@ GraphicalUi::GraphicalUi(QObject *parent) : AbstractUi(parent) {
 
 #ifdef Q_WS_WIN
   _dwTickCount = 0;
 
 #ifdef Q_WS_WIN
   _dwTickCount = 0;
-  mainWidget()->installEventFilter(this);
 #endif
 #endif
+}
 
 
+void GraphicalUi::init() {
+#ifdef Q_WS_WIN
+  mainWidget()->installEventFilter(this);
+#endif
 }
 
 GraphicalUi::~GraphicalUi() {
 }
 
 GraphicalUi::~GraphicalUi() {
index 1ed55b6..140c07f 100644 (file)
@@ -38,6 +38,7 @@ class GraphicalUi : public AbstractUi {
 public:
   GraphicalUi(QObject *parent = 0);
   virtual ~GraphicalUi();
 public:
   GraphicalUi(QObject *parent = 0);
   virtual ~GraphicalUi();
+  virtual void init();
 
   //! Access global ActionCollections.
   /** These ActionCollections are associated with the main window, i.e. they contain global
 
   //! Access global ActionCollections.
   /** These ActionCollections are associated with the main window, i.e. they contain global