Comment 4 for bug 238505

Revision history for this message
Marius Gedminas (mgedmin) wrote : Re: [Bug 238505] Re: duplicates in task menu after reload

On Tue, Jun 10, 2008 at 05:52:31PM +0200, Gaute Amundsen wrote:
> On Tuesday 10 June 2008 15:47:39 Marius Gedminas wrote:
> > I still cannot reproduce :/
> >
> > What do you mean by "both from task list and timelog"? (A screenshot
> > might help.)
>
> The autocomplete menu gets it's alternatives both from task list and timelog,
> right?
> In my example i have "lunsj **" in my tasks.txt
> once i wrote "lunsj and more **", and that is now in my timelog.txt
> When i start writing "lun" they both show up. If I reload they both show up
> one time extra for every reload.

Ah, so you're speaking about duplicates in the completion popup, and not
about duplicates in the task list! I can reproduce this now.

> But.. I could no longer resist : )
>
> How about this?
>
> About line 1055:
>
> seen = map(lambda x: list(x)[0], self.completion_choices)
> for entry in self.history:
> if entry not in seen:
> seen.append(entry)
> self.completion_choices.append([entry])
>
> This fixes the problem for me.

The output of 'svn diff' would have been a bit clearer, but I see what
you did there.

> There is probably a better way to get at completion_choices...

I would prefer to clear self.completion_choices instead, because if
you've fixed a typo in an earlier entry in the history, I'd rather see
just the fixed one among completions, instead of both.

And now that I understand what the bug actually is, I can fix it.

Marius Gedminas
--
Unix is the answer, but only if you phrase the question very carefully.
                -- Belinda Asbell