OSDN Git Service

QmlDebugger: Make JS breakpoints not pending when they're hit
authorKai Koehne <kai.koehne@nokia.com>
Mon, 4 Oct 2010 12:23:20 +0000 (14:23 +0200)
committerKai Koehne <kai.koehne@nokia.com>
Mon, 4 Oct 2010 12:26:03 +0000 (14:26 +0200)
Task-number: QTCREATORBUG-2590
Reviewed-by: Christiaan Janssen
src/plugins/debugger/qml/qmlengine.cpp

index b4c361d..b85302b 100644 (file)
@@ -661,9 +661,34 @@ void QmlEngine::messageReceived(const QByteArray &message)
                 tr("<p>An Uncaught Exception occured in <i>%1</i>:</p><p>%2</p>")
                     .arg(stackFrames.value(0).file, Qt::escape(error));
             showMessageBox(QMessageBox::Information, tr("Uncaught Exception"), msg);
-        }
+        } else {
+            //
+            // Make breakpoint non-pending
+            //
+            QString file;
+            int line = -1;
+
+            if (!stackFrames.isEmpty()) {
+                file = stackFrames.at(0).file;
+                line = stackFrames.at(0).line;
+
+                if (isShadowBuildProject()) {
+                    file = fromShadowBuildFilename(file);
+                }
+            }
 
+            Internal::BreakHandler *handler = breakHandler();
+            for (int index = 0; index != handler->size(); ++index) {
+                Internal::BreakpointData *data = handler->at(index);
+                QString processedFilename = data->fileName;
 
+                if (processedFilename == file
+                        && data->lineNumber == line) {
+                    data->pending = false;
+                    data->updateMarker();
+                }
+            }
+        }
     } else if (command == "RESULT") {
         Internal::WatchData data;
         QByteArray iname;