Project Filtering

Milian Wolff mail at milianw.de
Sun Sep 1 21:10:13 UTC 2013


On Friday 30 August 2013 20:32:58 Andreas Pakulat wrote:
> Hi,
> 
> On Fri, Aug 30, 2013 at 12:02 AM, Milian Wolff <mail at milianw.de> wrote:
> > On Monday 26 August 2013 15:02:04 Milian Wolff wrote:
> > > On Monday 26 August 2013 11:38:31 Andreas Pakulat wrote:
> > > > Unfortunately the logics are still not quite clear enough IMO. I've
> > > > put
> > > > 'wrappers' as the pattern and left the rest at the defaults (i.e.
> > 
> > relative
> > 
> > > > path, files+folders, exclusive), but this did not have any effect.
> > 
> > Neither
> > 
> > > > was the 'src/wrappers' directory removed from the treeview nor a
> > 
> > top-level
> > 
> > > > wrappers entry inside the project. After trying various combinations I
> > > > could get /src/wrappers to filter that exact directory and also
> > 
> > /wrappers
> > 
> > > > to filter that directory. What also seems to have worked was
> > 
> > '*wrappers'.
> > 
> > > > Changing from 'relative path' to just 'basename' also didn't work out
> > 
> > for
> > 
> > > > me, though I got it to hide once but then after changing back and
> > 
> > forth it
> > 
> > > > wasn't hiding anymore.
> > > 
> > > Awesome, thanks for the input. I'll look into this.
> > 
> > So, I worked on it again and hopefully have resorted all issues now :)
> > Please
> > test again! Note that I extended the tooltips and also return "*/" as
> > default
> > when adding a new filter. Then you can simply append stuff to it which
> > should
> > be the most common usecase.
> > 
> > I thought about transparently rewriting "foo" to "*/foo" in the
> > relative-path
> > case but then it would show up as "*/foo" the next time you edit the
> > filter.
> > And one would need to rewrite also when changing from basename to
> > relative-
> > path etc. which might be a bit strange I think? What do you think?
> 
> I think this works relatively good now. Its easy to get a working filter by
> just adding some text from a folder or file visible in the tree and the
> validity checks make it more understandable why some filter does not do
> anything.
> 
> > > > As you can see my expectation was that if I put just a name in there
> > > > it
> > > > filters out any item that matches that string exactly. Could this be
> > > > added?
> > > > If not the tooltip should at least include a few example, or a whats
> > 
> > this
> > 
> > > > thing so that users can discover this behavior.
> > > 
> > > Yes, this is indeed a very valid point and something that differs from
> > > .gitignore behavior (which I now use as a baseline).
> > 
> > Imo, most users should use basename matching anyways. Should I maybe make
> > this
> > the default?
> 
> Yes I think basename should be the default if thats what most people will
> use anyway.
> 
> However I'm wondering why there is made a difference anyway? Is there an
> optimization possible in one case vs. the other? Having no distinction (or
> deducing it from the filter text) would cause less confusion and could feel
> more natural for those that already wrote a gitignore or svnignore rule (or
> other types of wildcard filter rules).
> 
> Maybe you said so already, but whats the reason for requiring */ (or a
> leading slash) for relative paths? Is the implementation getting more
> complicated when you'd allow for 'foo/bar' as a path that would filter out
> any bar thats below foo anywhere in the project tree? (i.e. /my/foo/bar and
> /foo/bar and /blah/fasel/blub/foo/bar would all match)

Hehe thanks for the input, I've implemented this now. So much simpler, why 
indeed did I never think about this yet? Anyhow, this is what these 
discussions are about :) Please try again Andreas!

> Ah and one last thing just crossed my mind: Escaping, I just tried to match
> a file called 'foo*bar' (with a literal star in the filename) with a
> basename rule that had the text 'foo\*bar' (i.e. using backslash as
> escaping character) but this did not work :|

Fixed now. TIL what the difference between Wildcard and WildcardUnix is in 
QRegExp :)

I've also added a context menu entry for ProjectItems which offers a way to 
directly hide/exclude a given item from a project. Very useful imo. Please 
test that as well!

Bye
-- 
Milian Wolff
mail at milianw.de
http://milianw.de


More information about the KDevelop-devel mailing list