(From update of attachment 411924)
(In reply to comment #68)
> This patch should fix all mentioned issues. Only the 'check that all data are
> flushed' confused me... doesn't Close() flush the stream automatically before
> it closes?
Yes, it tries to, but that may not succeed. Check the return value of
outputStream->Close() to see whether it succeeded.
(From update of attachment 411924)
(In reply to comment #68)
> This patch should fix all mentioned issues. Only the 'check that all data are
> flushed' confused me... doesn't Close() flush the stream automatically before
> it closes?
Yes, it tries to, but that may not succeed. Check the return value of >Close( ) to see whether it succeeded.
outputStream-
>+ // (http:// bugreports. qt.nokia. com/browse/ QTBUG-5441)
Thanks for filing that. That looks like a sensible suggestion (from my
limited understanding of the Qt APIs).
>+ tmpDir- >CreateUnique( nsIFile: :DIRECTORY_ TYPE, 0700);
I think there should be a check for success here before adding to
mTemporaryFiles to be deleted.
The directory is created here, but this function can still fail to set
mTempFileUri (after cancelling the timer) ...
>+ if (!mTempFileUrl. IsEmpty( )) { >InitWithCallba ck(static_ cast<nsITimerCa llback* >(this) , :TYPE_ONE_ SHOT);
>+ // start time to remove temporary files
>+ mTempFileTimer-
>+ NS_DND_TIMEOUT,
>+ nsITimer:
so I think this should check mTemporaryFiles .Count( ) instead of mTempFileUrl.
>+ // check whether transferable contains FilePromiseUrl flavor... eFlavor = PR_FALSE;
>+ PRBool foundFilePromis
>+ PRUint32 i;
>+ for (i = 0; i < numDragItems; i++) {
No need for a loop here as numDragItems == 1.