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

Nikhil Marathe nsm.nikhil at gmail.com
Fri Apr 17 10:23:25 CEST 2009


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bug184127_rev2.patch
Type: text/x-patch
Size: 3740 bytes
Desc: not available
Url : http://mail.kde.org/pipermail/kget/attachments/20090417/e0575823/attachment.patch 


More information about the Kget mailing list