History

Don't use blocking connections on the main thread

Brad Davis committed 9 years ago

Commit b52dd7b1 parent b22daa945 files · +377 −178Browse files

Showing the changes to interface/src/scripting/WindowScriptingInterface.cpp (1 of 45 files). Show all

Unified · Split

interface/src/scripting/WindowScriptingInterface.cpp+4−3
@@ -9,11 +9,14 @@ · 8 unmodified lines
99 // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
1010 //
1111
12+#include "WindowScriptingInterface.h"
13+
1214 #include <QClipboard>
1315 #include <QtCore/QDir>
1416 #include <QMessageBox>
1517 #include <QScriptValue>
1618
19+#include <shared/QtHelpers.h>
1720 #include <SettingHandle.h>
1821
1922 #include <display-plugins/CompositorHelper.h>
@@ -24,8 +27,6 @@ · 4 unmodified lines
2427 #include "Menu.h"
2528 #include "OffscreenUi.h"
2629
27−#include "WindowScriptingInterface.h"
28−
2930 static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
3031 static const QString LAST_BROWSE_LOCATION_SETTING = "LastBrowseLocation";
3132 static const QString LAST_BROWSE_ASSETS_LOCATION_SETTING = "LastBrowseAssetsLocation";
@@ -316,7 +317,7 @@ bool WindowScriptingInterface::isPhysicsEnabled() { · 284 unmodified lines
316317 int WindowScriptingInterface::openMessageBox(QString title, QString text, int buttons, int defaultButton) {
317318 if (QThread::currentThread() != thread()) {
318319 int result;
319− QMetaObject::invokeMethod(this, "openMessageBox", Qt::BlockingQueuedConnection,
320+ hifi::qt::blockingInvokeMethod(this, "openMessageBox",
320321 Q_RETURN_ARG(int, result),
321322 Q_ARG(QString, title),
322323 Q_ARG(QString, text),