History

Continued tightening and testing of the scripting engine "glue" logic - QObject wrappers will now be reused when asked to wrap the same QObject multiple times - improved error reporting when we can't form a native call from script - dropped support for having the existing QtScript logic handle Qt object transformations - assuming that our code will handle all calls into native objects - changing timer functions to use CTimer* publicly rather than casted QObject*

Heather Anderson committed 4 years ago

Commit 55b5a2c1 parent 742fa2211 files · +262 −382Browse files

Showing the changes to libraries/script-engine/src/ScriptManager.cpp (1 of 11 files). Show all

Unified · Split

libraries/script-engine/src/ScriptManager.cpp+3−6
@@ -79,9 +79,6 @@ static const ScriptValue::PropertyFlags READONLY_HIDDEN_PROP_FLAGS{ READONLY_PRO · 78 unmodified lines
7979
8080 static const bool HIFI_AUTOREFRESH_FILE_SCRIPTS { true };
8181
82−Q_DECLARE_METATYPE(ScriptEngine::FunctionSignature)
83−int functionSignatureMetaID = qRegisterMetaType<ScriptEngine::FunctionSignature>();
84−
8582 int scriptManagerPointerMetaID = qRegisterMetaType<ScriptManagerPointer>();
8683
8784 Q_DECLARE_METATYPE(ExternalResource::Bucket);
@@ -1054,7 +1051,7 @@ void ScriptManager::timerFired() { · 966 unmodified lines
10541051 }
10551052 }
10561053
1057−QObject* ScriptManager::setupTimerWithInterval(const ScriptValue& function, int intervalMS, bool isSingleShot) {
1054+QTimer* ScriptManager::setupTimerWithInterval(const ScriptValue& function, int intervalMS, bool isSingleShot) {
10581055 // create the timer, add it to the map, and start it
10591056 QTimer* newTimer = new QTimer(this);
10601057 newTimer->setSingleShot(isSingleShot);
@@ -1078,7 +1075,7 @@ QObject* ScriptManager::setupTimerWithInterval(const ScriptValue& function, int · 17 unmodified lines
10781075 return newTimer;
10791076 }
10801077
1081−QObject* ScriptManager::setInterval(const ScriptValue& function, int intervalMS) {
1078+QTimer* ScriptManager::setInterval(const ScriptValue& function, int intervalMS) {
10821079 if (isStopped()) {
10831080 scriptWarningMessage("Script.setInterval() while shutting down is ignored... parent script:" + getFilename());
10841081 return NULL; // bail early
@@ -1087,7 +1084,7 @@ QObject* ScriptManager::setInterval(const ScriptValue& function, int intervalMS) · 2 unmodified lines
10871084 return setupTimerWithInterval(function, intervalMS, false);
10881085 }
10891086
1090−QObject* ScriptManager::setTimeout(const ScriptValue& function, int timeoutMS) {
1087+QTimer* ScriptManager::setTimeout(const ScriptValue& function, int timeoutMS) {
10911088 if (isStopped()) {
10921089 scriptWarningMessage("Script.setTimeout() while shutting down is ignored... parent script:" + getFilename());
10931090 return NULL; // bail early