summaryrefslogtreecommitdiffstats
path: root/src/scripttools/debugging/qscriptedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scripttools/debugging/qscriptedit.cpp')
-rw-r--r--src/scripttools/debugging/qscriptedit.cpp18
1 files changed, 14 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();