]> cloud.milkyroute.net Git - dolphin.git/commit
Include "Space" in the keyboard search string
authorFrank Reininghaus <frank78ac@googlemail.com>
Mon, 7 Oct 2013 07:08:55 +0000 (09:08 +0200)
committerFrank Reininghaus <frank78ac@googlemail.com>
Mon, 7 Oct 2013 07:09:00 +0000 (09:09 +0200)
commit46a27ca937309d97153268cd11da8b9d75d3f1f4
tree90dacb316c99870f55e39794607eaafa8c51c4e8
parent4cb0a239e51749c6e6099fd056309f9a81b8a481
Include "Space" in the keyboard search string

Before this commit, we only added pressed keys to the search string if
they have no other meaning. This means that files containing a Space in
their name could not be searched because Ctrl+Space toggles the
selection state of the current item, and Space alone selects the
current item.

After this commit, Space is added to the search string if

(a) the key press did not have any other effect, i.e., if Ctrl was not
    pressed, and the current item is selected already, and
(b) a keyboard search has been started already (to prevent unexpected
    effects when pressing Space accidentally - I think that it's rather
    uncommon to have files whose names start with a Space - and to make
    the unit test simpler).

I modified the unit test of KItemListController, which did not test
keyboard search yet. This uncovered a small problem in
KItemListController::slotChangeCurrentItem() when NoSelection mode is
used. It's not really relevant for anything that is executed inside
Dolphin, but I still fixed it to make the unit test happy.

BUG: 324479
FIXED-IN: 4.11.3
REVIEW: 113071
src/kitemviews/kitemlistcontroller.cpp
src/kitemviews/private/kitemlistkeyboardsearchmanager.cpp
src/tests/kitemlistcontrollertest.cpp