History

removing debug messages

ZappoMan committed 11 years ago

Commit a8d48e51 parent e5ef61e3 files · +11 −33Browse files

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

Unified · Split

libraries/script-engine/src/ScriptEngine.cpp+9−30
@@ -94,43 +94,33 @@ ScriptEngine::ScriptEngine(const QString& scriptContents, const QString& fileNam · 93 unmodified lines
9494 _isUserLoaded(false),
9595 _arrayBufferClass(new ArrayBufferClass(this))
9696 {
97− qDebug() << "[" << QThread::currentThread() << "]" << "ScriptEngine::ScriptEngine() " << getFilename() << "[" << this << "]";
9897 _allKnownScriptEngines.insert(this);
9998 }
10099
101100 ScriptEngine::~ScriptEngine() {
102− qDebug() << "[" << QThread::currentThread() << "]" << "ScriptEngine::~ScriptEngine() " << getFilename();
103101 _allKnownScriptEngines.remove(this);
104102 }
105103
106104 QSet<ScriptEngine*> ScriptEngine::_allKnownScriptEngines;
107105
108−void ScriptEngine::gracefullyStopAllScripts(QObject* application) {
109− qDebug() << "[" << QThread::currentThread() << "]" << "ScriptEngine::gracefullyStopAllScripts() ----------- START ------------------";
110−
111−
106+void ScriptEngine::stopAllScripts(QObject* application) {
112107 QMutableSetIterator<ScriptEngine*> i(_allKnownScriptEngines);
113108 while (i.hasNext()) {
114109 ScriptEngine* scriptEngine = i.next();
115− qDebug() << (void*)scriptEngine;
116−
117− if (scriptEngine->isRunning()) {
118− qDebug() << "scriptEngine still alive:" << scriptEngine->getFilename() << "[" << scriptEngine << "]";
119110
111+ // NOTE: typically all script engines are running. But there's at least one known exception to this, the
112+ // "entities sandbox" which is only used to evaluate entities scripts to test their validity before using
113+ // them. We don't need to stop scripts that aren't running.
114+ if (scriptEngine->isRunning()) {
120115 QEventLoop loop;
121116 QObject::connect(scriptEngine, &ScriptEngine::doneRunning, &loop, &QEventLoop::quit);
122117
123118 scriptEngine->disconnect(application);
124119 scriptEngine->stop();
125120
126− qDebug() << "waiting on script to stop... ";
127121 loop.exec();
128− qDebug() << "done waiting... ";
129− } else {
130− qDebug() << "WARNING! scriptEngine [" << (void*)scriptEngine << "] still in _allKnownScriptEngines but not running??? <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<";
131122 }
132123 }
133− qDebug() << "[" << QThread::currentThread() << "]" << "ScriptEngine::gracefullyStopAllScripts() ----------- DONE ------------------";
134124 }
135125
136126 QString ScriptEngine::getFilename() const {
@@ -411,14 +401,12 @@ void ScriptEngine::run() { · 274 unmodified lines
411401 }
412402
413403 if (_isFinished) {
414− qDebug() << "ScriptEngine::run()... while() about to break " << getFilename();
415404 break;
416405 }
417406
418407 QCoreApplication::processEvents();
419408
420409 if (_isFinished) {
421− qDebug() << "ScriptEngine::run()... while() about to break " << getFilename();
422410 break;
423411 }
424412
@@ -548,7 +536,6 @@ void ScriptEngine::run() { · 123 unmodified lines
548536 }
549537 lastUpdate = now;
550538 }
551− qDebug() << "ScriptEngine::run()... about to emit scriptEnding() " << getFilename();
552539 emit scriptEnding();
553540
554541 // kill the avatar identity timer
@@ -566,25 +553,19 @@ void ScriptEngine::run() { · 11 unmodified lines
566553
567554 // If we were on a thread, then wait till it's done
568555 if (thread()) {
569− qDebug() << "ScriptEngine::run()... about to call thread()->quit() " << getFilename();
570556 thread()->quit();
571557 }
572558
573− qDebug() << "ScriptEngine::run()... about to emit finished() " << getFilename();
574559 emit finished(_fileNameString);
575560
576561 _isRunning = false;
577562
578− qDebug() << "ScriptEngine::run()... about to emit runningStateChanged() " << getFilename();
579563 emit runningStateChanged();
580564
581− qDebug() << "ScriptEngine::run()... about to emit doneRunning() " << getFilename();
582565 emit doneRunning();
583− qDebug() << "ScriptEngine::run()... DONE WITH run()... " << getFilename();
584566 }
585567
586568 void ScriptEngine::stop() {
587− qDebug() << "ScriptEngine::stop()... " << getFilename();
588569 _isFinished = true;
589570 emit runningStateChanged();
590571 }
@@ -666,12 +647,10 @@ void ScriptEngine::print(const QString& message) { · 75 unmodified lines
666647 emit printedMessage(message);
667648 }
668649
669−/**
670− * If a callback is specified, the included files will be loaded asynchronously and the callback will be called
671− * when all of the files have finished loading.
672− * If no callback is specified, the included files will be loaded synchronously and will block execution until
673− * all of the files have finished loading.
674− */
650+// If a callback is specified, the included files will be loaded asynchronously and the callback will be called
651+// when all of the files have finished loading.
652+// If no callback is specified, the included files will be loaded synchronously and will block execution until
653+// all of the files have finished loading.
675654 void ScriptEngine::include(const QStringList& includeFiles, QScriptValue callback) {
676655 QList<QUrl> urls;
677656 for (QString file : includeFiles) {