Commit 470a0d78 authored by Laurent Montel's avatar Laurent Montel 😁

Rename methods

parent b9475af0
......@@ -114,7 +114,7 @@ void TextEditFindBarBase::showReplace()
void TextEditFindBarBase::setText(const QString &text)
{
mFindWidget->search()->setText(text);
mFindWidget->searchLineEdit()->setText(text);
}
QString TextEditFindBarBase::text() const
......@@ -125,8 +125,8 @@ QString TextEditFindBarBase::text() const
void TextEditFindBarBase::focusAndSetCursor()
{
setFocus();
mFindWidget->search()->selectAll();
mFindWidget->search()->setFocus();
mFindWidget->searchLineEdit()->selectAll();
mFindWidget->searchLineEdit()->setFocus();
}
void TextEditFindBarBase::slotClearSearch()
......@@ -217,8 +217,8 @@ void TextEditFindBarBase::clearSelections()
void TextEditFindBarBase::closeBar()
{
// Make sure that all old searches are cleared
mFindWidget->search()->setText(QString());
mReplaceWidget->replace()->setText(QString());
mFindWidget->searchLineEdit()->setText(QString());
mReplaceWidget->replaceLineEdit()->setText(QString());
clearSelections();
mReplaceWidget->hide();
updateGeometry();
......
......@@ -56,7 +56,7 @@ TextReplaceWidget::~TextReplaceWidget()
{
}
QLineEdit *TextReplaceWidget::replace() const
QLineEdit *TextReplaceWidget::replaceLineEdit() const
{
return mReplace;
}
......@@ -156,7 +156,7 @@ void TextFindWidget::slotAutoSearch(const QString &str)
}
}
QLineEdit *TextFindWidget::search() const
QLineEdit *TextFindWidget::searchLineEdit() const
{
return mSearch;
}
......
......@@ -36,7 +36,7 @@ public:
QTextDocument::FindFlags searchOptions() const;
QLineEdit *search() const;
QLineEdit *searchLineEdit() const;
void setFoundMatch(bool match);
......@@ -74,7 +74,7 @@ public:
explicit TextReplaceWidget(QWidget *parent = nullptr);
~TextReplaceWidget();
QLineEdit *replace() const;
QLineEdit *replaceLineEdit() const;
public Q_SLOTS:
void slotSearchStringEmpty(bool);
......
......@@ -91,7 +91,7 @@ void PlainTextEditFindBar::slotReplaceText()
{
if (d->mView->textCursor().hasSelection()) {
if (d->mView->textCursor().selectedText() == mFindWidget->searchText()) {
d->mView->textCursor().insertText(mReplaceWidget->replace()->text());
d->mView->textCursor().insertText(mReplaceWidget->replaceLineEdit()->text());
//search next after replace text.
searchText(false, false);
}
......@@ -104,9 +104,9 @@ void PlainTextEditFindBar::slotReplaceAllText()
{
QString newText;
if (mFindWidget->isRegularExpression()) {
newText = d->mView->toPlainText().replace(mFindWidget->searchRegExp(), mReplaceWidget->replace()->text());
newText = d->mView->toPlainText().replace(mFindWidget->searchRegExp(), mReplaceWidget->replaceLineEdit()->text());
} else {
newText = d->mView->toPlainText().replace(mFindWidget->searchText(), mReplaceWidget->replace()->text());
newText = d->mView->toPlainText().replace(mFindWidget->searchText(), mReplaceWidget->replaceLineEdit()->text());
}
d->mView->selectAll();
d->mView->insertPlainText(newText);
......
......@@ -91,7 +91,7 @@ void RichTextEditFindBar::slotReplaceText()
//FIXME!
if (d->mView->textCursor().hasSelection()) {
if (d->mView->textCursor().selectedText() == mFindWidget->searchText()) {
d->mView->textCursor().insertText(mReplaceWidget->replace()->text());
d->mView->textCursor().insertText(mReplaceWidget->replaceLineEdit()->text());
//search next after replace text.
searchText(false, false);
}
......@@ -104,9 +104,9 @@ void RichTextEditFindBar::slotReplaceAllText()
{
QString newText;
if (mFindWidget->isRegularExpression()) {
newText = d->mView->toPlainText().replace(mFindWidget->searchRegExp(), mReplaceWidget->replace()->text());
newText = d->mView->toPlainText().replace(mFindWidget->searchRegExp(), mReplaceWidget->replaceLineEdit()->text());
} else {
newText = d->mView->toPlainText().replace(mFindWidget->searchText(), mReplaceWidget->replace()->text());
newText = d->mView->toPlainText().replace(mFindWidget->searchText(), mReplaceWidget->replaceLineEdit()->text());
}
d->mView->selectAll();
d->mView->insertPlainText(newText);
......
Markdown is supported
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