[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[vidalia-svn] r3492: We can't call MarbleWidget::setInputHandler() until MarbleWi (vidalia/trunk/src/vidalia/network)



Author: edmanm
Date: 2009-01-31 18:31:37 -0500 (Sat, 31 Jan 2009)
New Revision: 3492

Modified:
   vidalia/trunk/src/vidalia/network/tormapwidget.cpp
Log:

We can't call MarbleWidget::setInputHandler() until MarbleWidget has
called its internal _q_initGui() method, which doesn't happen until a
QTimer::singleShot(0, this, SLOT(_q_initGui())) timer set in its
constructor times out. So force that event to process via processEvents()
before calling MarbleWidget::setInputHandler(). Sucky.


Modified: vidalia/trunk/src/vidalia/network/tormapwidget.cpp
===================================================================
--- vidalia/trunk/src/vidalia/network/tormapwidget.cpp	2009-01-31 23:16:44 UTC (rev 3491)
+++ vidalia/trunk/src/vidalia/network/tormapwidget.cpp	2009-01-31 23:31:37 UTC (rev 3492)
@@ -46,6 +46,13 @@
   connect(popupMenu, SIGNAL(displayRouterInfo(QString)),
           this, SIGNAL(displayRouterInfo(QString)));
 
+  /* We can't call setInputHandler() until MarbleWidget has called its
+   * internal _q_initGui() method, which doesn't happen until a
+   * QTimer::singleShot(0, this, SLOT(_q_initGui())) timer set in its
+   * constructor times out. So force that event to process now. */ 
+  vApp->processEvents(QEventLoop::ExcludeUserInputEvents
+                        | QEventLoop::ExcludeSocketNotifiers);
+
   setInputHandler(handler);
 }