[Kget] [PATCH][BUG 184127] Kget closes automatically when a download is marked as finished in the list

Lukas Appelhans l.appelhans at gmx.de
Sat Apr 18 15:45:57 CEST 2009


On Freitag 17 April 2009 10:23:25 Nikhil Marathe wrote:
> On 4/17/09, Lukas Appelhans <l.appelhans at gmx.de> wrote:
> > Well isn't the
> >  if (transfer->status() == Job::Finished && transfer->startStatus() !=
> >  Job::Finished)
> >  already enough to decide whether we should close or not?
>
> If I have 3 downloads which have finished. I start KGet so it shows
> the 3 as finished. In that case quitFlag continues to be true. And
> allWereFinished is also true. But I might still want to create another
> download. Which means we can't rely on quitFlag only.
>
> But say I now start and finish a download. In this case quitFlag is
> true, allWereFinished is false. So we want to quit. But setting
> quitFlag itself back to true in the if (transfer->status() ==
> Job::Finished && transfer->startStatus() != Job::Finished) part will
> cause bugs due to position of the transfer in the queue. Say the first
> transfer was finished in this instance, so quitFlag is true, but
> another transfer is running, so quitFlag is false. It works perfectly.
>
> But if the last transfer in the queue has finished just now, and the
> one above it is still running. In this case quitFlag will be true even
> when we don't want to quit.
>
> I have cleaned up the return logic a bit though. Expressing it in
> terms of allWereFinished makes it simpler.
>
> Nikhil
Meh, so let's go the current patch, I still dislike having 2 vars, but ok... 
:)

Lukas


More information about the Kget mailing list