diff options
author | Kent Hansen <khansen@trolltech.com> | 2009-08-20 12:22:09 (GMT) |
---|---|---|
committer | Kent Hansen <khansen@trolltech.com> | 2009-08-20 12:22:09 (GMT) |
commit | a363adb8974929b1b18e936cb0a7effa3c229f87 (patch) | |
tree | 19e8eb845ef2390c401b91d40b692757f18278d2 /src/scripttools | |
parent | c808a972f8b4beb0527af0c0e669a2aa522ccf3d (diff) | |
download | Qt-a363adb8974929b1b18e936cb0a7effa3c229f87.zip Qt-a363adb8974929b1b18e936cb0a7effa3c229f87.tar.gz Qt-a363adb8974929b1b18e936cb0a7effa3c229f87.tar.bz2 |
disable executable line number info since we don't have it yet
The old back-end relied on a script-to-XML converter to get information
about the script, but it's not implemented yet in the new back-end.
Diffstat (limited to 'src/scripttools')
-rw-r--r-- | src/scripttools/debugging/qscriptedit.cpp | 18 | ||||
-rw-r--r-- | src/scripttools/debugging/qscriptedit_p.h | 1 |
2 files changed, 15 insertions, 4 deletions
diff --git a/src/scripttools/debugging/qscriptedit.cpp b/src/scripttools/debugging/qscriptedit.cpp index 4f76695..a0c7199 100644 --- a/src/scripttools/debugging/qscriptedit.cpp +++ b/src/scripttools/debugging/qscriptedit.cpp @@ -156,6 +156,16 @@ void QScriptEdit::setExecutableLineNumbers(const QSet<int> &lineNumbers) m_executableLineNumbers = lineNumbers; } +bool QScriptEdit::isExecutableLine(int lineNumber) const +{ +#if 0 // ### enable me once we have information about the script again + return m_executableLineNumbers.contains(lineNumber); +#else + Q_UNUSED(lineNumber); + return true; +#endif +} + int QScriptEdit::currentLineNumber() const { return textCursor().blockNumber() + m_baseLineNumber; @@ -342,7 +352,7 @@ void QScriptEdit::extraAreaPaintEvent(QPaintEvent *e) icon.paint(&painter, r, Qt::AlignCenter); } - if (!m_executableLineNumbers.contains(lineNumber)) + if (!isExecutableLine(lineNumber)) painter.setPen(pal.color(QPalette::Mid)); else painter.setPen(QColor(Qt::darkCyan)); @@ -369,7 +379,7 @@ void QScriptEdit::extraAreaMouseEvent(QMouseEvent *e) if (e->type() == QEvent::MouseMove && e->buttons() == 0) { // mouse tracking bool hand = (e->pos().x() <= markWidth); int lineNumber = cursor.blockNumber() + m_baseLineNumber; - hand = hand && m_executableLineNumbers.contains(lineNumber); + hand = hand && isExecutableLine(lineNumber); #ifndef QT_NO_CURSOR if (hand != (m_extraArea->cursor().shape() == Qt::PointingHandCursor)) m_extraArea->setCursor(hand ? Qt::PointingHandCursor : Qt::ArrowCursor); @@ -379,7 +389,7 @@ void QScriptEdit::extraAreaMouseEvent(QMouseEvent *e) if (e->type() == QEvent::MouseButtonPress) { if (e->button() == Qt::LeftButton) { int lineNumber = cursor.blockNumber() + m_baseLineNumber; - bool executable = m_executableLineNumbers.contains(lineNumber); + bool executable = isExecutableLine(lineNumber); if ((e->pos().x() <= markWidth) && executable) m_extraAreaToggleBlockNumber = cursor.blockNumber(); else @@ -394,7 +404,7 @@ void QScriptEdit::extraAreaMouseEvent(QMouseEvent *e) } } else if (e->button() == Qt::RightButton) { int lineNumber = cursor.blockNumber() + m_baseLineNumber; - if (!m_executableLineNumbers.contains(lineNumber)) + if (!isExecutableLine(lineNumber)) return; bool has = m_breakpoints.contains(lineNumber); QMenu *popup = new QMenu(); diff --git a/src/scripttools/debugging/qscriptedit_p.h b/src/scripttools/debugging/qscriptedit_p.h index 2db2d7c..ee3dfc1 100644 --- a/src/scripttools/debugging/qscriptedit_p.h +++ b/src/scripttools/debugging/qscriptedit_p.h @@ -75,6 +75,7 @@ public: int executionLineNumber() const; void setExecutionLineNumber(int lineNumber, bool error); void setExecutableLineNumbers(const QSet<int> &lineNumbers); + bool isExecutableLine(int lineNumber) const; int currentLineNumber() const; void gotoLine(int lineNumber); |