Commit 452c7124 authored by hjk's avatar hjk
Browse files

debugger: fix regression + whitespace at eol

Double click on debugger input did not jump to the output anymore.
parent 95bf1681
...@@ -208,22 +208,22 @@ private: ...@@ -208,22 +208,22 @@ private:
QPlainTextEdit::keyPressEvent(ev); QPlainTextEdit::keyPressEvent(ev);
} }
void mouseDoubleClickEvent(QMouseEvent *ev) void mouseDoubleClickEvent(QMouseEvent *ev)
{ {
QString line = cursorForPosition(ev->pos()).block().text(); QString line = cursorForPosition(ev->pos()).block().text();
int n = 0; int n = 0;
// cut time string // cut time string
if (line.size() > 18 && line.at(0) == '[') if (line.size() > 18 && line.at(0) == '[')
line = line.mid(18); line = line.mid(18);
//qDebug() << line; //qDebug() << line;
for (int i = 0; i != line.size(); ++i) { for (int i = 0; i != line.size(); ++i) {
QChar c = line.at(i); QChar c = line.at(i);
if (!c.isDigit()) if (!c.isDigit())
break; break;
n = 10 * n + c.unicode() - '0'; n = 10 * n + c.unicode() - '0';
} }
emit commandSelected(n); emit commandSelected(n);
} }
...@@ -231,14 +231,14 @@ private: ...@@ -231,14 +231,14 @@ private:
{ {
menu->addAction(theDebuggerAction(ExecuteCommand)); menu->addAction(theDebuggerAction(ExecuteCommand));
} }
void focusInEvent(QFocusEvent *ev) void focusInEvent(QFocusEvent *ev)
{ {
emit statusMessageRequested(tr("Type Ctrl-<Return> to execute a line."), -1); emit statusMessageRequested(tr("Type Ctrl-<Return> to execute a line."), -1);
QPlainTextEdit::focusInEvent(ev); QPlainTextEdit::focusInEvent(ev);
} }
void focusOutEvent(QFocusEvent *ev) void focusOutEvent(QFocusEvent *ev)
{ {
emit statusMessageRequested(QString(), -1); emit statusMessageRequested(QString(), -1);
QPlainTextEdit::focusOutEvent(ev); QPlainTextEdit::focusOutEvent(ev);
...@@ -264,9 +264,9 @@ public: ...@@ -264,9 +264,9 @@ public:
public slots: public slots:
void gotoResult(int i) void gotoResult(int i)
{ {
QString needle = QString::number(i) + '^'; QString needle = QString::number(i) + '^';
QString needle2 = QLatin1String(">:") + needle; QString needle2 = QLatin1String(">") + needle;
QTextCursor cursor(document()); QTextCursor cursor(document());
do { do {
const QString line = cursor.block().text(); const QString line = cursor.block().text();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment