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
9// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html9// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
10//10//
11 11
12#include "WindowScriptingInterface.h"
13
12#include <QClipboard>14#include <QClipboard>
13#include <QtCore/QDir>15#include <QtCore/QDir>
14#include <QMessageBox>16#include <QMessageBox>
15#include <QScriptValue>17#include <QScriptValue>
16 18
19#include <shared/QtHelpers.h>
17#include <SettingHandle.h>20#include <SettingHandle.h>
18 21
19#include <display-plugins/CompositorHelper.h>22#include <display-plugins/CompositorHelper.h>
@@ -24,8 +27,6 @@ · 4 unmodified lines
24#include "Menu.h"27#include "Menu.h"
25#include "OffscreenUi.h"28#include "OffscreenUi.h"
26 29
27#include "WindowScriptingInterface.h"
28
29static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);30static const QString DESKTOP_LOCATION = QStandardPaths::writableLocation(QStandardPaths::DesktopLocation);
30static const QString LAST_BROWSE_LOCATION_SETTING = "LastBrowseLocation";31static const QString LAST_BROWSE_LOCATION_SETTING = "LastBrowseLocation";
31static const QString LAST_BROWSE_ASSETS_LOCATION_SETTING = "LastBrowseAssetsLocation";32static const QString LAST_BROWSE_ASSETS_LOCATION_SETTING = "LastBrowseAssetsLocation";
@@ -316,7 +317,7 @@ bool WindowScriptingInterface::isPhysicsEnabled() { · 284 unmodified lines
316int WindowScriptingInterface::openMessageBox(QString title, QString text, int buttons, int defaultButton) {317int WindowScriptingInterface::openMessageBox(QString title, QString text, int buttons, int defaultButton) {
317 if (QThread::currentThread() != thread()) {318 if (QThread::currentThread() != thread()) {
318 int result;319 int result;
319 QMetaObject::invokeMethod(this, "openMessageBox", Qt::BlockingQueuedConnection,320 hifi::qt::blockingInvokeMethod(this, "openMessageBox",
320 Q_RETURN_ARG(int, result),321 Q_RETURN_ARG(int, result),
321 Q_ARG(QString, title),322 Q_ARG(QString, title),
322 Q_ARG(QString, text),323 Q_ARG(QString, text),