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.cpp26
1 files changed, 18 insertions, 8 deletions
diff --git a/src/scripttools/debugging/qscriptedit.cpp b/src/scripttools/debugging/qscriptedit.cpp
index 0ca1ac3..c32567e 100644
--- a/src/scripttools/debugging/qscriptedit.cpp
+++ b/src/scripttools/debugging/qscriptedit.cpp
@@ -1,7 +1,6 @@
/****************************************************************************
**
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
** Contact: Nokia Corporation (qt-info@nokia.com)
**
** This file is part of the QtSCriptTools module of the Qt Toolkit.
@@ -21,9 +20,10 @@
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+** In addition, as a special exception, Nokia gives you certain
+** additional rights. These rights are described in the Nokia Qt LGPL
+** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this
+** package.
**
** If you have questions regarding the use of this file, please contact
** Nokia at qt-info@nokia.com.
@@ -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();