[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: kio::netaccess and imagepreview
From:       David Faure <david () mandrakesoft ! com>
Date:       2000-06-13 11:38:57
[Download RAW message or body]

On Tue, Jun 13, 2000 at 01:16:08PM +0200, Simon Hausmann wrote:
> > Sure. That's why we need to implement Waldo's refcounting solution,
> > so that the app doesn't exit as long as some download/stat is going on.
> > Is it a problem if the window is closed, though ? Hmmm... For NetAccess
> > it may be (since it's called from konqiconview). Maybe we also want a refcounting
> > per window (or even part), then ?
> 
> I fear that's the only solution.. (quite complex :|
> 

In fact what we want is to abort a NetAccess operation when we close
the window / part. What about setting a parent object to the netaccess
object, then ? Either the window or the part, or whatever else. And when
the parent is destroyed, Qt destroys the child, and in the NetAccess
destructor we abort the job if it's still running.
Of course this is a major BI and SI change, since this means passing
a parent object, in each of the static methods.
But this ensures: aborts operation when parent is destroyed.
(Note: this has nothing to do with real downloads (or file saving
from an editor), which should be done with 0L as parent and a refcounting
in kapp).

Hmmmmm, but it may still lead to crashes, if the control comes back from the
NetAccess:: call, into somewhere in the object we are in the process
of destroying... (child objects are destroyed in ~QObject so most of the 
object is already freed).

For instance, the konqfileitem pixmap stuff is then used to set the icon
... in an item that would be already destroyed. We really need to limit
what one can do while a netaccess operation is going on - just like with
modal dialogs (only repaints but nothing else). See below.

> Ahh, wait, there was still Waldo's qt_enter_modal() patch. Hmmmmm, why
> didn't it work? Ah, yes, because qt_try_modal in qapplication_x11 fails.
> (due to the lack of a real modal widget) . I'm not sure if messing around
> with the activeModalWidget stuff in qt (or any other hacks ;-) would
> work...
I'm not quite sure about this issue... but does the lack of a modal
widget means that currently, when an app uses KIO::NetAccess::upload for saving
a document right before exiting, the saving doesn't have time to finish ?
That would be a huge problem indeed :-(

Oh - there's one thing we can do to get around the lack of a modal widget :
creating one, hidden :-). That's what kfm did, AFAIR, or at least 
the early implementation of NetAccess.

-- 
David FAURE
david@mandrakesoft.com, faure@kde.org
http://home.clara.net/faure/, http://www.konqueror.org/
KDE, Making The Future of Computing Available Today

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic