History

* Add Qt::DirectConnection to signalHandlerException * CR feedback / coding standards

humbletim committed 9 years ago

Commit 132a8891 parent 417587d1 file · +7 −7Browse files

Showing the changes to libraries/script-engine/src/ScriptEngine.cpp (1 of 1 file). Show all

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+7−7
@@ -72,7 +72,7 @@ · 71 unmodified lines
72static const QScriptEngine::QObjectWrapOptions DEFAULT_QOBJECT_WRAP_OPTIONS =72static const QScriptEngine::QObjectWrapOptions DEFAULT_QOBJECT_WRAP_OPTIONS =
73 QScriptEngine::ExcludeDeleteLater | QScriptEngine::ExcludeChildObjects;73 QScriptEngine::ExcludeDeleteLater | QScriptEngine::ExcludeChildObjects;
74static const QScriptValue::PropertyFlags READONLY_PROP_FLAGS { QScriptValue::ReadOnly | QScriptValue::Undeletable };74static const QScriptValue::PropertyFlags READONLY_PROP_FLAGS { QScriptValue::ReadOnly | QScriptValue::Undeletable };
75static const QScriptValue::PropertyFlags HIDDEN_PROP_FLAGS { READONLY_PROP_FLAGS | QScriptValue::SkipInEnumeration };75static const QScriptValue::PropertyFlags READONLY_HIDDEN_PROP_FLAGS { READONLY_PROP_FLAGS | QScriptValue::SkipInEnumeration };
76 76
77 77
78 78
@@ -165,7 +165,7 @@ ScriptEngine::ScriptEngine(Context context, const QString& scriptContents, const · 86 unmodified lines
165 // ... but may not always be available -- so if needed we fallback to the passed exception165 // ... but may not always be available -- so if needed we fallback to the passed exception
166 emit unhandledException(exception);166 emit unhandledException(exception);
167 }167 }
168 });168 }, Qt::DirectConnection);
169 169
170 setProcessEventsInterval(MSECS_PER_SECOND);170 setProcessEventsInterval(MSECS_PER_SECOND);
171 if (isEntityServerScript()) {171 if (isEntityServerScript()) {
@@ -1250,7 +1250,7 @@ void ScriptEngine::stopTimer(QTimer *timer) { · 1078 unmodified lines
1250 1250
1251QUrl ScriptEngine::resolvePath(const QString& include) const {1251QUrl ScriptEngine::resolvePath(const QString& include) const {
1252 QUrl url(include);1252 QUrl url(include);
1253 // first lets check to see if it's already a full URL1253 // first lets check to see if it's already a full URL -- or a Windows path like "c:/"
1254 if (include.startsWith("/") || url.scheme().length() == 1) {1254 if (include.startsWith("/") || url.scheme().length() == 1) {
1255 url = QUrl::fromLocalFile(include);1255 url = QUrl::fromLocalFile(include);
1256 }1256 }
@@ -1261,12 +1261,12 @@ QUrl ScriptEngine::resolvePath(const QString& include) const { · 4 unmodified lines
1261 // we apparently weren't a fully qualified url, so, let's assume we're relative1261 // we apparently weren't a fully qualified url, so, let's assume we're relative
1262 // to the first absolute URL in the JS scope chain1262 // to the first absolute URL in the JS scope chain
1263 QUrl parentURL;1263 QUrl parentURL;
1264 auto ctx = currentContext();1264 auto context = currentContext();
1265 do {1265 do {
1266 QScriptContextInfo contextInfo { ctx };1266 QScriptContextInfo contextInfo { context };
1267 parentURL = QUrl(contextInfo.fileName());1267 parentURL = QUrl(contextInfo.fileName());
1268 ctx = ctx->parentContext();1268 context = context->parentContext();
1269 } while (parentURL.isRelative() && ctx);1269 } while (parentURL.isRelative() && context);
1270 1270
1271 if (parentURL.isRelative()) {1271 if (parentURL.isRelative()) {
1272 // fallback to the "include" parent (if defined, this will already be absolute)1272 // fallback to the "include" parent (if defined, this will already be absolute)