mirror of
https://invent.kde.org/system/dolphin
synced 2024-09-19 00:11:21 +00:00
Fixes double inserting of terms, interestingly this problem did not existed before than the code was written.
svn path=/trunk/KDE/kdebase/apps/; revision=1041128
This commit is contained in:
parent
b7fae99c59
commit
1201c61884
|
@ -96,7 +96,6 @@ DolphinSearchCompleter::DolphinSearchCompleter(KLineEdit* linedit) :
|
|||
view->setHeaderHidden(true);
|
||||
|
||||
connect(q, SIGNAL(textEdited(QString)), this, SLOT(slotTextEdited(QString)));
|
||||
connect(m_completer, SIGNAL(activated(QModelIndex)), this, SLOT(activated(QModelIndex)));
|
||||
connect(m_completer, SIGNAL(highlighted(QModelIndex)), this, SLOT(highlighted(QModelIndex)));
|
||||
}
|
||||
|
||||
|
@ -233,18 +232,6 @@ void DolphinSearchCompleter::highlighted(const QModelIndex& index)
|
|||
q->setCursorPosition(wordStart + replace.length());
|
||||
}
|
||||
|
||||
void DolphinSearchCompleter::activated(const QModelIndex& index)
|
||||
{
|
||||
if ((m_wordStart == -1) || (m_wordStart == -1)) {
|
||||
return;
|
||||
}
|
||||
|
||||
const QString replace = index.sibling(index.row(), 0).data(Qt::UserRole).toString();
|
||||
QString newText = q->text();
|
||||
newText.replace(m_wordStart, m_wordEnd - m_wordStart + 1, replace);
|
||||
q->setText(newText);
|
||||
}
|
||||
|
||||
DolphinSearchBox::DolphinSearchBox(QWidget* parent) :
|
||||
QWidget(parent),
|
||||
m_searchInput(0),
|
||||
|
|
|
@ -43,7 +43,6 @@ public:
|
|||
|
||||
public slots:
|
||||
void highlighted(const QModelIndex& index);
|
||||
void activated(const QModelIndex& index);
|
||||
void slotTextEdited(const QString &text);
|
||||
|
||||
private:
|
||||
|
|
Loading…
Reference in a new issue