summaryrefslogtreecommitdiff
path: root/src/plugins/debugger/qml
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/debugger/qml')
-rw-r--r--src/plugins/debugger/qml/baseqmldebuggerclient.h2
-rw-r--r--src/plugins/debugger/qml/qmladapter.cpp2
-rw-r--r--src/plugins/debugger/qml/qmlcppengine.cpp14
-rw-r--r--src/plugins/debugger/qml/qmlcppengine.h2
-rw-r--r--src/plugins/debugger/qml/qmlengine.cpp97
-rw-r--r--src/plugins/debugger/qml/qmlengine.h6
-rw-r--r--src/plugins/debugger/qml/qmlinspectoradapter.cpp32
-rw-r--r--src/plugins/debugger/qml/qmlinspectoradapter.h2
-rw-r--r--src/plugins/debugger/qml/qmlinspectoragent.cpp10
-rw-r--r--src/plugins/debugger/qml/qmlv8debuggerclient.cpp78
-rw-r--r--src/plugins/debugger/qml/qscriptdebuggerclient.cpp10
11 files changed, 124 insertions, 131 deletions
diff --git a/src/plugins/debugger/qml/baseqmldebuggerclient.h b/src/plugins/debugger/qml/baseqmldebuggerclient.h
index 9aa85a57f8..f356139e77 100644
--- a/src/plugins/debugger/qml/baseqmldebuggerclient.h
+++ b/src/plugins/debugger/qml/baseqmldebuggerclient.h
@@ -30,7 +30,7 @@
#ifndef BASEQMLDEBUGGERCLIENT_H
#define BASEQMLDEBUGGERCLIENT_H
-#include "debuggerengine.h"
+#include <debugger/debuggerengine.h>
#include <qmldebug/qmldebugclient.h>
namespace Debugger {
diff --git a/src/plugins/debugger/qml/qmladapter.cpp b/src/plugins/debugger/qml/qmladapter.cpp
index a5c5810c20..ef7a7434d3 100644
--- a/src/plugins/debugger/qml/qmladapter.cpp
+++ b/src/plugins/debugger/qml/qmladapter.cpp
@@ -29,7 +29,7 @@
#include "qmladapter.h"
-#include "debuggerstringutils.h"
+#include <debugger/debuggerstringutils.h>
#include "qmlengine.h"
#include "qmlv8debuggerclient.h"
#include "qscriptdebuggerclient.h"
diff --git a/src/plugins/debugger/qml/qmlcppengine.cpp b/src/plugins/debugger/qml/qmlcppengine.cpp
index 28179ba96b..00f79348b3 100644
--- a/src/plugins/debugger/qml/qmlcppengine.cpp
+++ b/src/plugins/debugger/qml/qmlcppengine.cpp
@@ -28,11 +28,11 @@
****************************************************************************/
#include "qmlcppengine.h"
-#include "debuggerruncontrolfactory.h"
-#include "debuggerstartparameters.h"
-#include "stackhandler.h"
#include "qmlengine.h"
-#include "watchhandler.h"
+#include <debugger/debuggerruncontrolfactory.h>
+#include <debugger/debuggerstartparameters.h>
+#include <debugger/stackhandler.h>
+#include <debugger/watchhandler.h>
#include <utils/qtcassert.h>
#include <texteditor/itexteditor.h>
@@ -47,8 +47,6 @@ enum { debug = 0 };
#define EDEBUG(s) do { if (debug) qDebug() << s; } while (0)
-const int ConnectionWaitTimeMs = 5000;
-
DebuggerEngine *createQmlCppEngine(const DebuggerStartParameters &sp,
QString *errorMessage)
{
@@ -699,9 +697,9 @@ void QmlCppEngine::slaveEngineStateChanged
break;
}
case InferiorShutdownOk: {
- if (state() == InferiorShutdownRequested)
+ if (state() == InferiorShutdownRequested) {
notifyInferiorShutdownOk();
- else {
+ } else {
// we got InferiorExitOk before, but ignored it ...
notifyInferiorExited();
}
diff --git a/src/plugins/debugger/qml/qmlcppengine.h b/src/plugins/debugger/qml/qmlcppengine.h
index c0a0226782..761194f74d 100644
--- a/src/plugins/debugger/qml/qmlcppengine.h
+++ b/src/plugins/debugger/qml/qmlcppengine.h
@@ -30,7 +30,7 @@
#ifndef QMLCPPENGINE_H
#define QMLCPPENGINE_H
-#include "debuggerengine.h"
+#include <debugger/debuggerengine.h>
namespace Debugger {
namespace Internal {
diff --git a/src/plugins/debugger/qml/qmlengine.cpp b/src/plugins/debugger/qml/qmlengine.cpp
index 0e07172d0f..7c33d83f59 100644
--- a/src/plugins/debugger/qml/qmlengine.cpp
+++ b/src/plugins/debugger/qml/qmlengine.cpp
@@ -31,21 +31,21 @@
#include "baseqmldebuggerclient.h"
#include "qmlinspectoragent.h"
-#include "debuggerstartparameters.h"
-#include "debuggeractions.h"
-#include "debuggercore.h"
-#include "debuggerinternalconstants.h"
-#include "debuggermainwindow.h"
-#include "debuggerrunner.h"
-#include "debuggerstringutils.h"
-#include "debuggertooltipmanager.h"
-#include "localsandexpressionswindow.h"
-#include "watchwindow.h"
-
-#include "breakhandler.h"
-#include "stackhandler.h"
-#include "watchhandler.h"
-#include "sourcefileshandler.h"
+#include <debugger/debuggerstartparameters.h>
+#include <debugger/debuggeractions.h>
+#include <debugger/debuggercore.h>
+#include <debugger/debuggerinternalconstants.h>
+#include <debugger/debuggermainwindow.h>
+#include <debugger/debuggerrunner.h>
+#include <debugger/debuggerstringutils.h>
+#include <debugger/debuggertooltipmanager.h>
+#include <debugger/localsandexpressionswindow.h>
+#include <debugger/watchwindow.h>
+
+#include <debugger/breakhandler.h>
+#include <debugger/stackhandler.h>
+#include <debugger/watchhandler.h>
+#include <debugger/sourcefileshandler.h>
#include <qmljseditor/qmljseditorconstants.h>
#include <qmljs/parser/qmljsast_p.h>
#include <qmljs/qmljsmodelmanagerinterface.h>
@@ -53,7 +53,7 @@
#include <utils/qtcassert.h>
-#include <texteditor/itexteditor.h>
+#include <texteditor/basetextdocument.h>
#include <coreplugin/editormanager/editormanager.h>
#include <coreplugin/helpmanager.h>
#include <coreplugin/icore.h>
@@ -292,7 +292,7 @@ QmlEngine::QmlEngine(const DebuggerStartParameters &startParameters, DebuggerEng
connect(&m_applicationLauncher,
- SIGNAL(processExited(int)),
+ SIGNAL(processExited(int, QProcess::ExitStatus)),
SLOT(disconnected()));
connect(&m_applicationLauncher,
SIGNAL(appendMessage(QString,Utils::OutputFormat)),
@@ -342,7 +342,7 @@ QmlEngine::~QmlEngine()
if (textEditPtr)
editorsToClose << textEditPtr.data();
}
- Core::EditorManager::instance()->closeEditors(editorsToClose);
+ Core::EditorManager::closeEditors(editorsToClose);
}
void QmlEngine::notifyInferiorSetupOk()
@@ -372,7 +372,7 @@ void QmlEngine::connectionEstablished()
if (!watchHandler()->watcherNames().isEmpty())
synchronizeWatchers();
- connect(watchersModel(),SIGNAL(layoutChanged()),this,SLOT(synchronizeWatchers()));
+ connect(watchModel(),SIGNAL(layoutChanged()),this,SLOT(synchronizeWatchers()));
if (state() == EngineRunRequested)
notifyEngineRunAndInferiorRunOk();
@@ -479,8 +479,7 @@ void QmlEngine::errorMessageBoxFinished(int result)
break;
}
case QMessageBox::Help: {
- Core::HelpManager *helpManager = Core::HelpManager::instance();
- helpManager->handleHelpRequest(QLatin1String("qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html"));
+ Core::HelpManager::handleHelpRequest(QLatin1String("qthelp://org.qt-project.qtcreator/doc/creator-debugging-qml.html"));
// fall through
}
default:
@@ -534,28 +533,25 @@ void QmlEngine::gotoLocation(const Location &location)
if (QUrl(fileName).isLocalFile()) {
// internal file from source files -> show generated .js
QTC_ASSERT(m_sourceDocuments.contains(fileName), return);
- Core::IEditor *editor = 0;
- Core::EditorManager *editorManager = Core::EditorManager::instance();
QString titlePattern = tr("JS Source for %1").arg(fileName);
- //Check if there are open editors with the same title
- QList<Core::IEditor *> editors = editorManager->openedEditors();
- foreach (Core::IEditor *ed, editors) {
- if (ed->displayName() == titlePattern) {
- editor = ed;
- break;
+ //Check if there are open documents with the same title
+ foreach (Core::IDocument *document, Core::EditorManager::documentModel()->openedDocuments()) {
+ if (document->displayName() == titlePattern) {
+ Core::EditorManager::activateEditorForDocument(document);
+ return;
}
}
- if (!editor) {
- editor = Core::EditorManager::openEditorWithContents(QmlJSEditor::Constants::C_QMLJSEDITOR_ID,
- &titlePattern);
- if (editor)
- editor->setProperty(Constants::OPENED_BY_DEBUGGER, true);
-
- updateEditor(editor, m_sourceDocuments.value(fileName));
+ Core::IEditor *editor = Core::EditorManager::openEditorWithContents(
+ QmlJSEditor::Constants::C_QMLJSEDITOR_ID, &titlePattern);
+ if (editor) {
+ editor->document()->setProperty(Constants::OPENED_BY_DEBUGGER, true);
+ QPlainTextEdit *plainTextEdit =
+ qobject_cast<QPlainTextEdit *>(editor->widget());
+ if (plainTextEdit)
+ plainTextEdit->setReadOnly(true);
+ updateDocument(editor->document(), m_sourceDocuments.value(fileName));
}
- Core::EditorManager::activateEditor(editor);
-
} else {
DebuggerEngine::gotoLocation(location);
}
@@ -563,7 +559,7 @@ void QmlEngine::gotoLocation(const Location &location)
void QmlEngine::closeConnection()
{
- disconnect(watchersModel(),SIGNAL(layoutChanged()),this,SLOT(synchronizeWatchers()));
+ disconnect(watchModel(),SIGNAL(layoutChanged()),this,SLOT(synchronizeWatchers()));
m_adapter.closeConnection();
}
@@ -600,7 +596,7 @@ void QmlEngine::startApplicationLauncher()
void QmlEngine::stopApplicationLauncher()
{
if (m_applicationLauncher.isRunning()) {
- disconnect(&m_applicationLauncher, SIGNAL(processExited(int)),
+ disconnect(&m_applicationLauncher, SIGNAL(processExited(int,QProcess::ExitStatus)),
this, SLOT(disconnected()));
m_applicationLauncher.stop();
}
@@ -1308,27 +1304,22 @@ void QmlEngine::updateScriptSource(const QString &fileName, int lineOffset, int
//update open editors
QString titlePattern = tr("JS Source for %1").arg(fileName);
//Check if there are open editors with the same title
- QList<Core::IEditor *> editors = Core::EditorManager::instance()->openedEditors();
- foreach (Core::IEditor *editor, editors) {
- if (editor->displayName() == titlePattern) {
- updateEditor(editor, document);
+ foreach (Core::IDocument *doc, Core::EditorManager::documentModel()->openedDocuments()) {
+ if (doc->displayName() == titlePattern) {
+ updateDocument(doc, document);
break;
}
}
}
-void QmlEngine::updateEditor(Core::IEditor *editor, const QTextDocument *document)
+void QmlEngine::updateDocument(Core::IDocument *document, const QTextDocument *textDocument)
{
- TextEditor::ITextEditor *textEditor = qobject_cast<TextEditor::ITextEditor*>(editor);
- if (!textEditor)
+ TextEditor::BaseTextDocument *baseTextDocument
+ = qobject_cast<TextEditor::BaseTextDocument *>(document);
+ if (!baseTextDocument)
return;
- QPlainTextEdit *plainTextEdit =
- qobject_cast<QPlainTextEdit *>(editor->widget());
- if (!plainTextEdit)
- return;
- plainTextEdit->setPlainText(document->toPlainText());
- plainTextEdit->setReadOnly(true);
+ baseTextDocument->document()->setPlainText(textDocument->toPlainText());
}
bool QmlEngine::canEvaluateScript(const QString &script)
diff --git a/src/plugins/debugger/qml/qmlengine.h b/src/plugins/debugger/qml/qmlengine.h
index 0c8ef50b47..d9b5cd0b84 100644
--- a/src/plugins/debugger/qml/qmlengine.h
+++ b/src/plugins/debugger/qml/qmlengine.h
@@ -30,10 +30,10 @@
#ifndef QMLENGINE_H
#define QMLENGINE_H
-#include "debuggerengine.h"
#include "interactiveinterpreter.h"
#include "qmladapter.h"
#include "qmlinspectoradapter.h"
+#include <debugger/debuggerengine.h>
#include <projectexplorer/applicationlauncher.h>
#include <qmldebug/qdebugmessageclient.h>
@@ -43,7 +43,7 @@
#include <QTextDocument>
namespace Core {
-class IEditor;
+class IDocument;
}
namespace Debugger {
@@ -181,7 +181,7 @@ private:
const QString &oldBasePath, const QString &newBasePath) const;
QString qmlImportPath() const;
- void updateEditor(Core::IEditor *editor, const QTextDocument *document);
+ void updateDocument(Core::IDocument *document, const QTextDocument *textDocument);
bool canEvaluateScript(const QString &script);
bool adjustBreakpointLineAndColumn(const QString &filePath, quint32 *line,
quint32 *column, bool *valid);
diff --git a/src/plugins/debugger/qml/qmlinspectoradapter.cpp b/src/plugins/debugger/qml/qmlinspectoradapter.cpp
index 20d9219b6a..57ddb45cb0 100644
--- a/src/plugins/debugger/qml/qmlinspectoradapter.cpp
+++ b/src/plugins/debugger/qml/qmlinspectoradapter.cpp
@@ -29,13 +29,13 @@
#include "qmlinspectoradapter.h"
-#include "debuggeractions.h"
-#include "debuggercore.h"
-#include "debuggerstringutils.h"
#include "qmladapter.h"
-#include "debuggerengine.h"
#include "qmlinspectoragent.h"
#include "qmllivetextpreview.h"
+#include <debugger/debuggeractions.h>
+#include <debugger/debuggercore.h>
+#include <debugger/debuggerstringutils.h>
+#include <debugger/debuggerengine.h>
#include <coreplugin/actionmanager/actionmanager.h>
#include <coreplugin/icore.h>
@@ -298,7 +298,7 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor)
!= QmlJSEditor::Constants::C_QMLJSEDITOR_ID)
return;
- QString filename = newEditor->document()->fileName();
+ QString filename = newEditor->document()->filePath();
QmlJS::ModelManagerInterface *modelManager =
QmlJS::ModelManagerInterface::instance();
if (modelManager) {
@@ -330,7 +330,7 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor)
connect(preview, SIGNAL(reloadRequest()),
this, SLOT(onReload()));
- m_textPreviews.insert(newEditor->document()->fileName(), preview);
+ m_textPreviews.insert(newEditor->document()->filePath(), preview);
preview->associateEditor(newEditor);
preview->updateDebugIds();
}
@@ -340,7 +340,7 @@ void QmlInspectorAdapter::createPreviewForEditor(Core::IEditor *newEditor)
void QmlInspectorAdapter::removePreviewForEditor(Core::IEditor *editor)
{
if (QmlLiveTextPreview *preview
- = m_textPreviews.value(editor->document()->fileName())) {
+ = m_textPreviews.value(editor->document()->filePath())) {
preview->unassociateEditor(editor);
}
}
@@ -353,9 +353,8 @@ void QmlInspectorAdapter::updatePendingPreviewDocuments(QmlJS::Document::Ptr doc
if (idx == -1)
return;
- Core::EditorManager *em = Core::EditorManager::instance();
QList<Core::IEditor *> editors
- = em->editorsForFileName(doc->fileName());
+ = Core::EditorManager::documentModel()->editorsForFilePath(doc->fileName());
if (editors.isEmpty())
return;
@@ -365,7 +364,7 @@ void QmlInspectorAdapter::updatePendingPreviewDocuments(QmlJS::Document::Ptr doc
Core::IEditor *editor = editors.takeFirst();
createPreviewForEditor(editor);
QmlLiveTextPreview *preview
- = m_textPreviews.value(editor->document()->fileName());
+ = m_textPreviews.value(editor->document()->filePath());
foreach (Core::IEditor *editor, editors)
preview->associateEditor(editor);
}
@@ -439,7 +438,6 @@ void QmlInspectorAdapter::setActiveEngineClient(BaseEngineDebugClient *client)
void QmlInspectorAdapter::initializePreviews()
{
- Core::EditorManager *em = Core::EditorManager::instance();
QmlJS::ModelManagerInterface *modelManager
= QmlJS::ModelManagerInterface::instance();
if (modelManager) {
@@ -447,6 +445,7 @@ void QmlInspectorAdapter::initializePreviews()
if (!m_listeningToEditorManager) {
m_listeningToEditorManager = true;
+ QObject *em = Core::EditorManager::instance();
connect(em, SIGNAL(editorAboutToClose(Core::IEditor*)),
this, SLOT(removePreviewForEditor(Core::IEditor*)));
connect(em, SIGNAL(editorOpened(Core::IEditor*)),
@@ -457,8 +456,15 @@ void QmlInspectorAdapter::initializePreviews()
}
// initial update
- foreach (Core::IEditor *editor, em->openedEditors())
- createPreviewForEditor(editor);
+ Core::DocumentModel *documentModel = Core::EditorManager::documentModel();
+ foreach (Core::IDocument *document, documentModel->openedDocuments()) {
+ QList<Core::IEditor *> editors = documentModel->editorsForDocument(document);
+ createPreviewForEditor(editors.takeFirst());
+ QmlLiveTextPreview *preview
+ = m_textPreviews.value(document->filePath());
+ foreach (Core::IEditor *editor, editors)
+ preview->associateEditor(editor);
+ }
}
}
diff --git a/src/plugins/debugger/qml/qmlinspectoradapter.h b/src/plugins/debugger/qml/qmlinspectoradapter.h
index b94e37d542..1bdae26a76 100644
--- a/src/plugins/debugger/qml/qmlinspectoradapter.h
+++ b/src/plugins/debugger/qml/qmlinspectoradapter.h
@@ -30,7 +30,7 @@
#ifndef QMLINSPECTORADAPTER_H
#define QMLINSPECTORADAPTER_H
-#include "debuggerconstants.h"
+#include <debugger/debuggerconstants.h>
#include <coreplugin/icontext.h>
#include <qmldebug/qmldebugclient.h>
diff --git a/src/plugins/debugger/qml/qmlinspectoragent.cpp b/src/plugins/debugger/qml/qmlinspectoragent.cpp
index 8a65a59ab0..68974bf9d4 100644
--- a/src/plugins/debugger/qml/qmlinspectoragent.cpp
+++ b/src/plugins/debugger/qml/qmlinspectoragent.cpp
@@ -29,11 +29,11 @@
#include "qmlinspectoragent.h"
-#include "debuggeractions.h"
-#include "debuggercore.h"
-#include "debuggerengine.h"
-#include "debuggerstringutils.h"
-#include "watchhandler.h"
+#include <debugger/debuggeractions.h>
+#include <debugger/debuggercore.h>
+#include <debugger/debuggerengine.h>
+#include <debugger/debuggerstringutils.h>
+#include <debugger/watchhandler.h>
#include <qmldebug/qmldebugconstants.h>
#include <utils/qtcassert.h>
diff --git a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
index 9a3677d61a..916beae49e 100644
--- a/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
+++ b/src/plugins/debugger/qml/qmlv8debuggerclient.cpp
@@ -29,14 +29,14 @@
#include "qmlv8debuggerclient.h"
#include "qmlv8debuggerclientconstants.h"
-#include "debuggerstringutils.h"
-
-#include "watchhandler.h"
-#include "breakhandler.h"
#include "qmlengine.h"
-#include "stackhandler.h"
-#include "debuggercore.h"
-#include "debuggeractions.h"
+
+#include <debugger/debuggerstringutils.h>
+#include <debugger/watchhandler.h>
+#include <debugger/breakhandler.h>
+#include <debugger/stackhandler.h>
+#include <debugger/debuggercore.h>
+#include <debugger/debuggeractions.h>
#include <utils/qtcassert.h>
#include <texteditor/basetexteditor.h>
@@ -254,13 +254,14 @@ void QmlV8DebuggerClientPrivate::evaluate(const QString expr, bool global,
args.setProperty(_(DISABLE_BREAK), QScriptValue(disableBreak));
if (addContext) {
- QAbstractItemModel *localsModel = engine->localsModel();
- int rowCount = localsModel->rowCount();
+ WatchHandler *watchHandler = engine->watchHandler();
+ QAbstractItemModel *watchModel = watchHandler->model();
+ int rowCount = watchModel->rowCount();
QScriptValue ctxtList = parser.call(QScriptValue(), QScriptValueList() << _(ARRAY ));
while (rowCount) {
- QModelIndex index = localsModel->index(--rowCount, 0);
- const WatchData *data = engine->watchHandler()->watchData(index);
+ QModelIndex index = watchModel->index(--rowCount, 0);
+ const WatchData *data = watchHandler->watchData(index);
QScriptValue ctxt = parser.call(QScriptValue(), QScriptValueList() << QScriptValue(_(OBJECT)));
ctxt.setProperty(_(NAME), QScriptValue(data->name));
ctxt.setProperty(_(HANDLE), QScriptValue(int(data->id)));
@@ -1904,7 +1905,7 @@ void QmlV8DebuggerClient::updateBreakpoints(const QVariant &bodyVal)
const QVariantList actualLocations = breakpointData.value(_("actual_locations")).toList();
foreach (const QVariant &location, actualLocations) {
const QVariantMap locationData = location.toMap();
- br.lineNumber = locationData.value(_("line")).toInt() + 1;;
+ br.lineNumber = locationData.value(_("line")).toInt() + 1;
br.enabled = breakpointData.value(_("active")).toBool();
br.hitCount = breakpointData.value(_("hit_count")).toInt();
br.ignoreCount = breakpointData.value(_("ignoreCount")).toInt();
@@ -1998,50 +1999,47 @@ void QmlV8DebuggerClient::highlightExceptionCode(int lineNumber,
const QString &filePath,
const QString &errorMessage)
{
- EditorManager *editorManager = EditorManager::instance();
- QList<IEditor *> openedEditors = editorManager->openedEditors();
+ QList<IEditor *> editors = EditorManager::documentModel()->editorsForFilePath(filePath);
// set up the format for the errors
QTextCharFormat errorFormat;
errorFormat.setUnderlineStyle(QTextCharFormat::WaveUnderline);
errorFormat.setUnderlineColor(Qt::red);
- foreach (IEditor *editor, openedEditors) {
- if (editor->document()->fileName() == filePath) {
- TextEditor::BaseTextEditorWidget *ed = qobject_cast<TextEditor::BaseTextEditorWidget *>(editor->widget());
- if (!ed)
- continue;
+ foreach (IEditor *editor, editors) {
+ TextEditor::BaseTextEditorWidget *ed = qobject_cast<TextEditor::BaseTextEditorWidget *>(editor->widget());
+ if (!ed)
+ continue;
- QList<QTextEdit::ExtraSelection> selections;
- QTextEdit::ExtraSelection sel;
- sel.format = errorFormat;
- QTextCursor c(ed->document()->findBlockByNumber(lineNumber - 1));
- const QString text = c.block().text();
- for (int i = 0; i < text.size(); ++i) {
- if (! text.at(i).isSpace()) {
- c.setPosition(c.position() + i);
- break;
- }
+ QList<QTextEdit::ExtraSelection> selections;
+ QTextEdit::ExtraSelection sel;
+ sel.format = errorFormat;
+ QTextCursor c(ed->document()->findBlockByNumber(lineNumber - 1));
+ const QString text = c.block().text();
+ for (int i = 0; i < text.size(); ++i) {
+ if (! text.at(i).isSpace()) {
+ c.setPosition(c.position() + i);
+ break;
}
- c.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
- sel.cursor = c;
+ }
+ c.movePosition(QTextCursor::EndOfBlock, QTextCursor::KeepAnchor);
+ sel.cursor = c;
- sel.format.setToolTip(errorMessage);
+ sel.format.setToolTip(errorMessage);
- selections.append(sel);
- ed->setExtraSelections(TextEditor::BaseTextEditorWidget::DebuggerExceptionSelection, selections);
+ selections.append(sel);
+ ed->setExtraSelections(TextEditor::BaseTextEditorWidget::DebuggerExceptionSelection, selections);
- QString message = QString(_("%1: %2: %3")).arg(filePath).arg(lineNumber)
- .arg(errorMessage);
- d->engine->showMessage(message, ConsoleOutput);
- }
+ QString message = QString(_("%1: %2: %3")).arg(filePath).arg(lineNumber)
+ .arg(errorMessage);
+ d->engine->showMessage(message, ConsoleOutput);
}
}
void QmlV8DebuggerClient::clearExceptionSelection()
{
- EditorManager *editorManager = EditorManager::instance();
- QList<IEditor *> openedEditors = editorManager->openedEditors();
+ DocumentModel *documentModel = EditorManager::documentModel();
+ QList<IEditor *> openedEditors = documentModel->editorsForDocuments(documentModel->openedDocuments());
QList<QTextEdit::ExtraSelection> selections;
foreach (IEditor *editor, openedEditors) {
diff --git a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp
index 2910f895f3..e01d0e4f9c 100644
--- a/src/plugins/debugger/qml/qscriptdebuggerclient.cpp
+++ b/src/plugins/debugger/qml/qscriptdebuggerclient.cpp
@@ -28,12 +28,12 @@
****************************************************************************/
#include "qscriptdebuggerclient.h"
-#include "watchhandler.h"
-#include "breakhandler.h"
#include "qmlengine.h"
-#include "stackhandler.h"
-#include "debuggercore.h"
-#include "debuggerstringutils.h"
+#include <debugger/watchhandler.h>
+#include <debugger/breakhandler.h>
+#include <debugger/stackhandler.h>
+#include <debugger/debuggercore.h>
+#include <debugger/debuggerstringutils.h>
#include <QFileInfo>
#include <QMessageBox>