Diffstat (limited to 'core/apps/textedit/textedit.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | core/apps/textedit/textedit.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/core/apps/textedit/textedit.cpp b/core/apps/textedit/textedit.cpp index b81f3b4..ce868d6 100644 --- a/core/apps/textedit/textedit.cpp +++ b/core/apps/textedit/textedit.cpp | |||
@@ -1173,22 +1173,26 @@ void TextEdit::gotoLine() { | |||
1173 | QWidget *d = QApplication::desktop(); | 1173 | QWidget *d = QApplication::desktop(); |
1174 | gotoEdit = new QLineEdit( 0, "Goto line"); | 1174 | gotoEdit = new QLineEdit( 0, "Goto line"); |
1175 | 1175 | ||
1176 | gotoEdit->move( (d->width()/2) - ( gotoEdit->width()/2) , (d->height()/2) - (gotoEdit->height()/2)); | 1176 | gotoEdit->move( (d->width()/2) - ( gotoEdit->width()/2) , (d->height()/2) - (gotoEdit->height()/2)); |
1177 | gotoEdit->setFrame(true); | 1177 | gotoEdit->setFrame(true); |
1178 | gotoEdit->show(); | 1178 | gotoEdit->show(); |
1179 | connect (gotoEdit,SIGNAL(returnPressed()), this, SLOT(doGoto())); | 1179 | connect (gotoEdit,SIGNAL(returnPressed()), this, SLOT(doGoto())); |
1180 | } | 1180 | } |
1181 | 1181 | ||
1182 | void TextEdit::doGoto() { | 1182 | void TextEdit::doGoto() { |
1183 | QString number = gotoEdit->text(); | 1183 | QString number = gotoEdit->text(); |
1184 | gotoEdit->hide(); | 1184 | gotoEdit->hide(); |
1185 | if(gotoEdit) delete gotoEdit; | 1185 | if(gotoEdit) { |
1186 | delete gotoEdit; | ||
1187 | gotoEdit = 0; | ||
1188 | } | ||
1189 | |||
1186 | bool ok; | 1190 | bool ok; |
1187 | int lineNumber = number.toInt(&ok, 10); | 1191 | int lineNumber = number.toInt(&ok, 10); |
1188 | if(editor->numLines() < lineNumber) | 1192 | if(editor->numLines() < lineNumber) |
1189 | QMessageBox::message(tr("Text Edit"),tr("Not enough lines")); | 1193 | QMessageBox::message(tr("Text Edit"),tr("Not enough lines")); |
1190 | else | 1194 | else |
1191 | { | 1195 | { |
1192 | editor->setCursorPosition(lineNumber, 0, false); | 1196 | editor->setCursorPosition(lineNumber, 0, false); |
1193 | } | 1197 | } |
1194 | } | 1198 | } |