History

cleanup naked qDebug() calls

Brad Hefta-Gaub committed 9 years ago

Commit dbbed461 parent 1e5e6a184 files · +383 −316Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+33−33
@@ -551,7 +551,7 @@ void ScriptEngine::init() { · 550 unmodified lines
551551 void ScriptEngine::registerValue(const QString& valueName, QScriptValue value) {
552552 if (QThread::currentThread() != thread()) {
553553 #ifdef THREAD_DEBUGGING
554− qDebug() << "*** WARNING *** ScriptEngine::registerValue() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
554+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerValue() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
555555 #endif
556556 QMetaObject::invokeMethod(this, "registerValue",
557557 Q_ARG(const QString&, valueName),
@@ -581,7 +581,7 @@ void ScriptEngine::registerValue(const QString& valueName, QScriptValue value) { · 23 unmodified lines
581581 void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) {
582582 if (QThread::currentThread() != thread()) {
583583 #ifdef THREAD_DEBUGGING
584− qDebug() << "*** WARNING *** ScriptEngine::registerGlobalObject() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name;
584+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerGlobalObject() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name;
585585 #endif
586586 QMetaObject::invokeMethod(this, "registerGlobalObject",
587587 Q_ARG(const QString&, name),
@@ -589,7 +589,7 @@ void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { · 1 unmodified line
589589 return;
590590 }
591591 #ifdef THREAD_DEBUGGING
592− qDebug() << "ScriptEngine::registerGlobalObject() called on thread [" << QThread::currentThread() << "] name:" << name;
592+ qCDebug(scriptengine) << "ScriptEngine::registerGlobalObject() called on thread [" << QThread::currentThread() << "] name:" << name;
593593 #endif
594594
595595 if (!globalObject().property(name).isValid()) {
@@ -605,7 +605,7 @@ void ScriptEngine::registerGlobalObject(const QString& name, QObject* object) { · 9 unmodified lines
605605 void ScriptEngine::registerFunction(const QString& name, QScriptEngine::FunctionSignature functionSignature, int numArguments) {
606606 if (QThread::currentThread() != thread()) {
607607 #ifdef THREAD_DEBUGGING
608− qDebug() << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name;
608+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name;
609609 #endif
610610 QMetaObject::invokeMethod(this, "registerFunction",
611611 Q_ARG(const QString&, name),
@@ -614,7 +614,7 @@ void ScriptEngine::registerFunction(const QString& name, QScriptEngine::Function · 2 unmodified lines
614614 return;
615615 }
616616 #ifdef THREAD_DEBUGGING
617− qDebug() << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] name:" << name;
617+ qCDebug(scriptengine) << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] name:" << name;
618618 #endif
619619
620620 QScriptValue scriptFun = newFunction(functionSignature, numArguments);
@@ -624,7 +624,7 @@ void ScriptEngine::registerFunction(const QString& name, QScriptEngine::Function · 3 unmodified lines
624624 void ScriptEngine::registerFunction(const QString& parent, const QString& name, QScriptEngine::FunctionSignature functionSignature, int numArguments) {
625625 if (QThread::currentThread() != thread()) {
626626 #ifdef THREAD_DEBUGGING
627− qDebug() << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] parent:" << parent << "name:" << name;
627+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerFunction() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] parent:" << parent << "name:" << name;
628628 #endif
629629 QMetaObject::invokeMethod(this, "registerFunction",
630630 Q_ARG(const QString&, name),
@@ -633,7 +633,7 @@ void ScriptEngine::registerFunction(const QString& parent, const QString& name, · 2 unmodified lines
633633 return;
634634 }
635635 #ifdef THREAD_DEBUGGING
636− qDebug() << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] parent:" << parent << "name:" << name;
636+ qCDebug(scriptengine) << "ScriptEngine::registerFunction() called on thread [" << QThread::currentThread() << "] parent:" << parent << "name:" << name;
637637 #endif
638638
639639 QScriptValue object = globalObject().property(parent);
@@ -647,7 +647,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 7 unmodified lines
647647 QScriptEngine::FunctionSignature setter, const QString& parent) {
648648 if (QThread::currentThread() != thread()) {
649649 #ifdef THREAD_DEBUGGING
650− qDebug() << "*** WARNING *** ScriptEngine::registerGetterSetter() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
650+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::registerGetterSetter() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
651651 " name:" << name << "parent:" << parent;
652652 #endif
653653 QMetaObject::invokeMethod(this, "registerGetterSetter",
@@ -658,7 +658,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 4 unmodified lines
658658 return;
659659 }
660660 #ifdef THREAD_DEBUGGING
661− qDebug() << "ScriptEngine::registerGetterSetter() called on thread [" << QThread::currentThread() << "] name:" << name << "parent:" << parent;
661+ qCDebug(scriptengine) << "ScriptEngine::registerGetterSetter() called on thread [" << QThread::currentThread() << "] name:" << name << "parent:" << parent;
662662 #endif
663663
664664 QScriptValue setterFunction = newFunction(setter, 1);
@@ -680,7 +680,7 @@ void ScriptEngine::registerGetterSetter(const QString& name, QScriptEngine::Func · 15 unmodified lines
680680 void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QString& eventName, QScriptValue handler) {
681681 if (QThread::currentThread() != thread()) {
682682 #ifdef THREAD_DEBUGGING
683− qDebug() << "*** WARNING *** ScriptEngine::removeEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
683+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::removeEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
684684 "entityID:" << entityID << " eventName:" << eventName;
685685 #endif
686686 QMetaObject::invokeMethod(this, "removeEventHandler",
@@ -690,7 +690,7 @@ void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QStrin · 3 unmodified lines
690690 return;
691691 }
692692 #ifdef THREAD_DEBUGGING
693− qDebug() << "ScriptEngine::removeEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName;
693+ qCDebug(scriptengine) << "ScriptEngine::removeEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName;
694694 #endif
695695
696696 if (!_registeredHandlers.contains(entityID)) {
@@ -710,7 +710,7 @@ void ScriptEngine::removeEventHandler(const EntityItemID& entityID, const QStrin · 13 unmodified lines
710710 void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& eventName, QScriptValue handler) {
711711 if (QThread::currentThread() != thread()) {
712712 #ifdef THREAD_DEBUGGING
713− qDebug() << "*** WARNING *** ScriptEngine::addEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
713+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::addEventHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
714714 "entityID:" << entityID << " eventName:" << eventName;
715715 #endif
716716
@@ -721,7 +721,7 @@ void ScriptEngine::addEventHandler(const EntityItemID& entityID, const QString& · 4 unmodified lines
721721 return;
722722 }
723723 #ifdef THREAD_DEBUGGING
724− qDebug() << "ScriptEngine::addEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName;
724+ qCDebug(scriptengine) << "ScriptEngine::addEventHandler() called on thread [" << QThread::currentThread() << "] entityID:" << entityID << " eventName : " << eventName;
725725 #endif
726726
727727 if (_registeredHandlers.count() == 0) { // First time any per-entity handler has been added in this script...
@@ -796,7 +796,7 @@ QScriptValue ScriptEngine::evaluate(const QString& sourceCode, const QString& fi · 68 unmodified lines
796796 if (QThread::currentThread() != thread()) {
797797 QScriptValue result;
798798 #ifdef THREAD_DEBUGGING
799− qDebug() << "*** WARNING *** ScriptEngine::evaluate() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
799+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::evaluate() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
800800 "sourceCode:" << sourceCode << " fileName:" << fileName << "lineNumber:" << lineNumber;
801801 #endif
802802 QMetaObject::invokeMethod(this, "evaluate", Qt::BlockingQueuedConnection,
@@ -1010,7 +1010,7 @@ void ScriptEngine::stop(bool marshal) { · 207 unmodified lines
10101010 void ScriptEngine::callAnimationStateHandler(QScriptValue callback, AnimVariantMap parameters, QStringList names, bool useNames, AnimVariantResultHandler resultHandler) {
10111011 if (QThread::currentThread() != thread()) {
10121012 #ifdef THREAD_DEBUGGING
1013− qDebug() << "*** WARNING *** ScriptEngine::callAnimationStateHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name;
1013+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callAnimationStateHandler() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] name:" << name;
10141014 #endif
10151015 QMetaObject::invokeMethod(this, "callAnimationStateHandler",
10161016 Q_ARG(QScriptValue, callback),
@@ -1182,7 +1182,7 @@ void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callbac · 165 unmodified lines
11821182 thisURL = expandScriptUrl(QUrl::fromLocalFile(expandScriptPath(file)));
11831183 QUrl defaultScriptsLoc = defaultScriptsLocation();
11841184 if (!defaultScriptsLoc.isParentOf(thisURL)) {
1185− qDebug() << "ScriptEngine::include -- skipping" << file << "-- outside of standard libraries";
1185+ qCDebug(scriptengine) << "ScriptEngine::include -- skipping" << file << "-- outside of standard libraries";
11861186 continue;
11871187 }
11881188 isStandardLibrary = true;
@@ -1297,7 +1297,7 @@ void ScriptEngine::load(const QString& loadFile) { · 108 unmodified lines
12971297 // Look up the handler associated with eventName and entityID. If found, evalute the argGenerator thunk and call the handler with those args
12981298 void ScriptEngine::forwardHandlerCall(const EntityItemID& entityID, const QString& eventName, QScriptValueList eventHandlerArgs) {
12991299 if (QThread::currentThread() != thread()) {
1300− qDebug() << "*** ERROR *** ScriptEngine::forwardHandlerCall() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
1300+ qCDebug(scriptengine) << "*** ERROR *** ScriptEngine::forwardHandlerCall() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
13011301 assert(false);
13021302 return ;
13031303 }
@@ -1331,7 +1331,7 @@ void ScriptEngine::loadEntityScript(QWeakPointer<ScriptEngine> theEngine, const · 27 unmodified lines
13311331 QSharedPointer<ScriptEngine> strongEngine = theEngine.toStrongRef();
13321332 if (strongEngine) {
13331333 #ifdef THREAD_DEBUGGING
1334− qDebug() << "ScriptEngine::entityScriptContentAvailable() IN LAMBDA contentAvailable on thread ["
1334+ qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable() IN LAMBDA contentAvailable on thread ["
13351335 << QThread::currentThread() << "] expected thread [" << strongEngine->thread() << "]";
13361336 #endif
13371337 strongEngine->entityScriptContentAvailable(entityID, scriptOrURL, contents, isURL, success);
@@ -1344,7 +1344,7 @@ void ScriptEngine::loadEntityScript(QWeakPointer<ScriptEngine> theEngine, const · 6 unmodified lines
13441344 void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, const QString& scriptOrURL, const QString& contents, bool isURL, bool success) {
13451345 if (QThread::currentThread() != thread()) {
13461346 #ifdef THREAD_DEBUGGING
1347− qDebug() << "*** WARNING *** ScriptEngine::entityScriptContentAvailable() called on wrong thread ["
1347+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::entityScriptContentAvailable() called on wrong thread ["
13481348 << QThread::currentThread() << "], invoking on correct thread [" << thread()
13491349 << "] " "entityID:" << entityID << "scriptOrURL:" << scriptOrURL << "contents:"
13501350 << contents << "isURL:" << isURL << "success:" << success;
@@ -1360,7 +1360,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 9 unmodified lines
13601360 }
13611361
13621362 #ifdef THREAD_DEBUGGING
1363− qDebug() << "ScriptEngine::entityScriptContentAvailable() thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]";
1363+ qCDebug(scriptengine) << "ScriptEngine::entityScriptContentAvailable() thread [" << QThread::currentThread() << "] expected thread [" << thread() << "]";
13641364 #endif
13651365
13661366 auto scriptCache = DependencyManager::get<ScriptCache>();
@@ -1448,7 +1448,7 @@ void ScriptEngine::entityScriptContentAvailable(const EntityItemID& entityID, co · 81 unmodified lines
14481448 void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) {
14491449 if (QThread::currentThread() != thread()) {
14501450 #ifdef THREAD_DEBUGGING
1451− qDebug() << "*** WARNING *** ScriptEngine::unloadEntityScript() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1451+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadEntityScript() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
14521452 "entityID:" << entityID;
14531453 #endif
14541454
@@ -1457,7 +1457,7 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { · 2 unmodified lines
14571457 return;
14581458 }
14591459 #ifdef THREAD_DEBUGGING
1460− qDebug() << "ScriptEngine::unloadEntityScript() called on correct thread [" << thread() << "] "
1460+ qCDebug(scriptengine) << "ScriptEngine::unloadEntityScript() called on correct thread [" << thread() << "] "
14611461 "entityID:" << entityID;
14621462 #endif
14631463
@@ -1471,14 +1471,14 @@ void ScriptEngine::unloadEntityScript(const EntityItemID& entityID) { · 7 unmodified lines
14711471 void ScriptEngine::unloadAllEntityScripts() {
14721472 if (QThread::currentThread() != thread()) {
14731473 #ifdef THREAD_DEBUGGING
1474− qDebug() << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
1474+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::unloadAllEntityScripts() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "]";
14751475 #endif
14761476
14771477 QMetaObject::invokeMethod(this, "unloadAllEntityScripts");
14781478 return;
14791479 }
14801480 #ifdef THREAD_DEBUGGING
1481− qDebug() << "ScriptEngine::unloadAllEntityScripts() called on correct thread [" << thread() << "]";
1481+ qCDebug(scriptengine) << "ScriptEngine::unloadAllEntityScripts() called on correct thread [" << thread() << "]";
14821482 #endif
14831483 foreach(const EntityItemID& entityID, _entityScripts.keys()) {
14841484 callEntityScriptMethod(entityID, "unload");
@@ -1486,13 +1486,13 @@ void ScriptEngine::unloadAllEntityScripts() { · 1 unmodified line
14861486 _entityScripts.clear();
14871487
14881488 #ifdef DEBUG_ENGINE_STATE
1489− qDebug() << "---- CURRENT STATE OF ENGINE: --------------------------";
1489+ qCDebug(scriptengine) << "---- CURRENT STATE OF ENGINE: --------------------------";
14901490 QScriptValueIterator it(globalObject());
14911491 while (it.hasNext()) {
14921492 it.next();
1493− qDebug() << it.name() << ":" << it.value().toString();
1493+ qCDebug(scriptengine) << it.name() << ":" << it.value().toString();
14941494 }
1495− qDebug() << "--------------------------------------------------------";
1495+ qCDebug(scriptengine) << "--------------------------------------------------------";
14961496 #endif // DEBUG_ENGINE_STATE
14971497 }
14981498
@@ -1563,7 +1563,7 @@ void ScriptEngine::callWithEnvironment(const EntityItemID& entityID, const QUrl& · 64 unmodified lines
15631563 void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const QStringList& params) {
15641564 if (QThread::currentThread() != thread()) {
15651565 #ifdef THREAD_DEBUGGING
1566− qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1566+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
15671567 "entityID:" << entityID << "methodName:" << methodName;
15681568 #endif
15691569
@@ -1574,7 +1574,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 4 unmodified lines
15741574 return;
15751575 }
15761576 #ifdef THREAD_DEBUGGING
1577− qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
1577+ qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
15781578 "entityID:" << entityID << "methodName:" << methodName;
15791579 #endif
15801580
@@ -1595,7 +1595,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 14 unmodified lines
15951595 void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const PointerEvent& event) {
15961596 if (QThread::currentThread() != thread()) {
15971597 #ifdef THREAD_DEBUGGING
1598− qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1598+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
15991599 "entityID:" << entityID << "methodName:" << methodName << "event: mouseEvent";
16001600 #endif
16011601
@@ -1606,7 +1606,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 4 unmodified lines
16061606 return;
16071607 }
16081608 #ifdef THREAD_DEBUGGING
1609− qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
1609+ qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
16101610 "entityID:" << entityID << "methodName:" << methodName << "event: pointerEvent";
16111611 #endif
16121612
@@ -1627,7 +1627,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 14 unmodified lines
16271627 void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QString& methodName, const EntityItemID& otherID, const Collision& collision) {
16281628 if (QThread::currentThread() != thread()) {
16291629 #ifdef THREAD_DEBUGGING
1630− qDebug() << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
1630+ qCDebug(scriptengine) << "*** WARNING *** ScriptEngine::callEntityScriptMethod() called on wrong thread [" << QThread::currentThread() << "], invoking on correct thread [" << thread() << "] "
16311631 "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision";
16321632 #endif
16331633
@@ -1639,7 +1639,7 @@ void ScriptEngine::callEntityScriptMethod(const EntityItemID& entityID, const QS · 5 unmodified lines
16391639 return;
16401640 }
16411641 #ifdef THREAD_DEBUGGING
1642− qDebug() << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
1642+ qCDebug(scriptengine) << "ScriptEngine::callEntityScriptMethod() called on correct thread [" << thread() << "] "
16431643 "entityID:" << entityID << "methodName:" << methodName << "otherID:" << otherID << "collision: collision";
16441644 #endif
16451645