Re: [PATCH] Add flat view mode option to directory diff

On 21 March 2011 05:53, Piotr Piastucki <leech miranda gmail com> wrote:
> On Sun, Mar 20, 2011 at 3:05 AM, Kai <kai willadsen gmail com> wrote:
>> On 3 March 2011 01:03, Piotr Piastucki <leech miranda gmail com> wrote:
>> > Hi,
>> >
>> > I'm attaching a patch that adds a flat view mode to dir diff. I found it
>> > quite useful in some cases, especially when the folder hierarchy is
>> > pretty
>> > complex yet there are few modified files.
>> I like the feature, I think it's useful, and I'd love to merge it.
>> However, this patch raises all sorts of issues that ring alarm bells.
>> The big one is that I'd naively expect that the 'right' way to switch
>> between flat and tree-based views would be entirely TreeView based,
>> whereas this patch has a lot of TreeStore-based logic.
>> It may require some larger changes to the underlying store, but I'd
>> think that Flatten mode should really be implementable using a
>> TreeViewFilter and some minor treeview display toggles.
> I will be happy to implement this feature in a more appropriate way but I
>  am not quite sure how it should be implemented and I will be grateful for
> some guidance. As far as I can tell based on my limited experience with
> gtk.TreeModelFilter it filters out selected nodes along with their children,
> so this is not the behaviour we are looking for (see
> also daa com au/msg18936.html).

I admit I hadn't tried to do this, and wasn't aware about the
visible-parent requirement. That certainly makes life more difficult.

> However, I
> am not an expert when it comes to GTK and maybe there are some hacks that
> will make TreeModelFilter work differently. Any hints will be most
> appreciated.

As suggested later in that thread, it may be possible to subclass
TreeModelFilter and override the child path <--> path and child iter
<--> iter conversions to make this work. I don't really know whether
this will actually work, or how much work it would be. I've had a
quick look, and it's not trivial.

Moving DirDiff to a filtered tree model is (relatively) high on my
priority list, so that we can change state filters and such with
rescanning the entire tree. However, it's a bit of an undertaking, and
is requiring a lot of code reorganisation.

Anyway, can you attach your patch in bugzilla
( so that it doesn't
get lost?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]