Bug 360624 - Implement "Invert Filter" option
Summary: Implement "Invert Filter" option
Status: ASSIGNED
Alias: None
Product: dolphin
Classification: Applications
Component: bars: filter (show other bugs)
Version: 16.12.2
Platform: unspecified Linux
: NOR wishlist
Target Milestone: ---
Assignee: Dolphin Bug Assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-03-16 18:28 UTC by sowieso
Modified: 2020-11-11 07:36 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description sowieso 2016-03-16 18:28:43 UTC
I love the filter bar, and it's one of Dolphin's features I miss immediately  in other file browsers. 
As I often use this feature, I had many cases where I wished I had an invert-filter option, to only show the files where the filter did not match.

Use case: 
For instance, I have a folder with all the files from a camera, containing not only *.jpg, but also various info-files, movies, sounds, …. It would be great to type ctrl+i and .jpg, then press an invert-filter-checkbox and only the non-jpeg-files are shown, so that I can ctrl+a these files and delete/move them.

I suggest to add an 'Invert' checkbox after the filter bar, but a well documented pattern expression for inversion  would also be fine (maybe a ! at the  start  of a pattern). I hope it is not to complex to be implemented and hope that it is useful for many more people. 

Reproducible: Always
Comment 1 stu109382 2016-11-06 10:28:26 UTC
I like the idea.

Maybe one could extend the search/filter functionality even further with other keywords. An example for such a thing is the advanced search in windows 7 explorer (http://www.howtogeek.com/73065/learn-the-advanced-search-operators-in-windows-7/).
The syntax to search stuff that does not contain some text in its name, is to write a minus in front of it (just like in google, youtube, etc.).
So it would be -jpg in your use case.
Comment 2 tuxflo 2018-09-10 12:26:30 UTC
I'm looking for the same feature! This bug is here for 2 years now, so any updates on that issue?
Comment 3 Julian Steinmann 2018-09-11 19:27:04 UTC
Hello tuxflo and thanks for your comment. As KDE is a community project, we cannot (and do not want to) decide what the developers should work on. A good way to raise the visibility of an issue is to vote on it (there should be a link next to the "Importance" field). You are of course also more than welcome to implement the feature yourself. Have a nice day!
Comment 4 tuxflo 2018-09-12 07:02:43 UTC
Hi Julian!
My intention was not to yell "when do we get this feature", but just to ask if someone is already has that on his or her work in progress table.
I took a short look into the dolphin source code and it seems that it might be not too complicated for me to implement that feature on my own (as you suggested).
What kind of symbol would be good to indicate that the current filter should be inverted? My first thought was, to add a ! in front of the search items. Any other ideas? Or should there be a new button that inverts the result?
Comment 5 sowieso 2018-09-12 15:11:24 UTC
Great that someone want to try to implement this!

I suggest to go with a checkbox (called 'invert' or 'invert filter') if you intend to only implement this. That way every user immediately sees the new feature without having to learn a new grammar. But if you want to do more, like extended globbing, full regexes or advanced searches like proposed in the second reply, the checkbox would be redundant. In that case make sure to properly document the syntax :-)

In case of extended globbing, there are two variants:
bash: !(pattern)
zsh: ^pattern
Comment 6 Julian Steinmann 2018-09-14 09:06:43 UTC
It's great to hear that you'd like to implement this feature! Regarding the UI: Please join us in the #kde-vdg (our Visual Design group) channel via Matrix or IRC . We'll be happy to help you with all your UI/UX questions.
Comment 7 tuxflo 2018-09-27 08:26:10 UTC
Hey there!
After finally setting up the build environment and digging into the code I found out that its not as easy as I thought. I managed to get the Invert function working but I'm not able to connect the function to a new created button. Since I'm currently writing my Diploma thesis my time to spend on this feature is currently limited, maybe I'll implement the feature after finishing my thesis.

Meanwhile I also found a way to simulate the behavior without changing dolphin, by using a regular expression: one could view all files that don't include "iso" by entering [^iso]* to the Filterbar. Also if you just want to select some filtered files you can use the filter normally, select the files, then clear the filter and use the "Control->Invert Selection" from the menubar or using the shortcut Ctrl+Shift+A
Comment 8 Justin Zobel 2020-10-27 04:31:11 UTC
(In reply to tuxflo from comment #7)
> Hey there!
> After finally setting up the build environment and digging into the code I
> found out that its not as easy as I thought. I managed to get the Invert
> function working but I'm not able to connect the function to a new created
> button. Since I'm currently writing my Diploma thesis my time to spend on
> this feature is currently limited, maybe I'll implement the feature after
> finishing my thesis.
> 
> Meanwhile I also found a way to simulate the behavior without changing
> dolphin, by using a regular expression: one could view all files that don't
> include "iso" by entering [^iso]* to the Filterbar. Also if you just want to
> select some filtered files you can use the filter normally, select the
> files, then clear the filter and use the "Control->Invert Selection" from
> the menubar or using the shortcut Ctrl+Shift+A

If you're still interested in implementing this jump in #KDE-devel either via Matrix or IRC and ask around, I'm sure others would be happy to assist.
Comment 9 Bug Janitor Service 2020-11-11 04:33:39 UTC
Dear Bug Submitter,

This bug has been in NEEDSINFO status with no change for at least
15 days. Please provide the requested information as soon as
possible and set the bug status as REPORTED. Due to regular bug
tracker maintenance, if the bug is still in NEEDSINFO status with
no change in 30 days the bug will be closed as RESOLVED > WORKSFORME
due to lack of needed information.

For more information about our bug triaging procedures please read the
wiki located here:
https://community.kde.org/Guidelines_and_HOWTOs/Bug_triaging

If you have already provided the requested information, please
mark the bug as REPORTED so that the KDE team knows that the bug is
ready to be confirmed.

Thank you for helping us make KDE software even better for everyone!
Comment 10 sowieso 2020-11-11 07:36:57 UTC
Reset the status to ASSIGNED. Not sure if that is correct though.

If I find enough time during the Christmas holidays I'll try to do it myself. Shouldn't be too difficult, but that's what tuxflo thought too… :) I'll keep in mind to ask at #KDE-devel in case of trouble.

Tuxflo's workaround works splendidly btw, so in case you think this wouldn't get merged anyway, please let me know.