Review Request 125484: Allow to clear completion history
David Faure
faure at kde.org
Sat Oct 3 15:21:54 UTC 2015
> On Oct. 2, 2015, 8:43 p.m., David Faure wrote:
> > Looks ok to me, except that KHistoryComboBox also adds such a menu item to the KLineEdit popup. Can you check if it has it twice now? I would expect so. In that case you could remove the action+slot from KHistoryComboBox then? (compare the slots to be sure it's the same logic).
>
> Laurent Montel wrote:
> it's not totally the same logic
>
> it will clear the combobox + textline too.
>
> I will add a test application for khistorycombobox soon to test it.
>
> void KHistoryComboBox::clearHistory()
> {
> const QString temp = currentText();
> KComboBox::clear();
> if (useCompletion()) {
> completionObject()->clear();
> }
> setEditText(temp);
> }
>
> void KHistoryComboBoxPrivate::_k_addContextMenuItems(QMenu *menu)
> {
> Q_Q(KHistoryComboBox);
> if (menu) {
> menu->addSeparator();
> QAction *clearHistory = menu->addAction(QIcon::fromTheme("edit-clear-history"),
> KHistoryComboBox::tr("Clear &History"),
> q, SLOT(_k_clear()));
> if (!q->count()) {
> clearHistory->setEnabled(false);
> }
> }
> }
>
> Laurent Montel wrote:
> There is a test in source "kcompletionuitest"
> so not necessary to create a new test.
>
> Laurent Montel wrote:
> indeed it create 2 "clear history"
> I will investigate how to replace it.
This doesn't clear the text line (QLineEdit), on the contrary, it saves and restores its contents.
But indeed, when we have a combo, there are the combo items to clear as well, not just the completion.
So I think KLineEdit needs to emit a signal when its action is triggered, so that KHistoryComboBox can add "clearing the combo".
(I guess not KComboBox, which could have application-provided items, unrelated to completion/history)
- David
-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/125484/#review86250
-----------------------------------------------------------
On Oct. 2, 2015, 8:14 p.m., Laurent Montel wrote:
>
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/125484/
> -----------------------------------------------------------
>
> (Updated Oct. 2, 2015, 8:14 p.m.)
>
>
> Review request for KDE Frameworks and David Faure.
>
>
> Repository: kcompletion
>
>
> Description
> -------
>
> In a application we can't remove history until we close it. It can be problematic when we add a critical word as password etc.
>
>
> Diffs
> -----
>
> src/klineedit.h 59cec4e
> src/klineedit.cpp 37c079d
> src/klineedit_p.h c7b63c6
>
> Diff: https://git.reviewboard.kde.org/r/125484/diff/
>
>
> Testing
> -------
>
> Tested in kdepim from long time ago.
> Tested in klineedittest apps.
>
>
> Thanks,
>
> Laurent Montel
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20151003/d48973a4/attachment.html>
More information about the Kde-frameworks-devel
mailing list