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

List:       kfm-devel
Subject:    Re: kio::netaccess and imagepreview
From:       Waldo Bastian <bastian () kde ! org>
Date:       2000-06-29 23:09:20
[Download RAW message or body]

On Thu, 29 Jun 2000, David Faure wrote:
> On Tue, Jun 13, 2000 at 03:02:00PM +0200, Simon Hausmann wrote:
> >   /* this is a bit tricky. We use a faked modal dialog to be able to
> >      process the download syncronious. For the user it will look
> >      (almost) as if the kfm-dialog is the modal dialog of your
> >      application. After show() we will also enter a local event loop
> >      within Qt. The modal_hack_widget will be hidden and destroyed in
> >      the finish slot. This will implictly exit the local event loop
> >      in addition (Matthias)
> >   */
> >   modal_hack_widget = new QWidget(0,0,WType_Modal);
> >   modal_hack_widget->setGeometry(-10,-10,2,2);
> >   copy(src, target);
> >   modal_hack_widget->show();
> >   qApp->enter_loop();
> >
> > I wonder why it was removed from netaccess? :-)
> >
> > Hmmm
> > revision 1.5
> > date: 1999/12/29 19:29:18;  author: granroth;  state: Exp;  lines: +11
> > -37 [...]
> > 2) Removed modalDialogHack.  Since this existed before KIO, I assume
> >    it was somehow related to a Qt shortcoming?  In any event, I
> >    removed it and everything worked like a charm.
>
> Should we readd this, now that we don't use NetAccess anymore
> for speed-critical missions such the image preview feature ?
>
> Does this make any difference, finally ?

It is supposed to prevent reentrancy. Can't we use 
qt_enter_modal / qt_leave_modal instead of show() ?

I once sent a patch for that to the list, but that didn't work because I had 
forgotten 'WType_Modal'.

E.g. something like:

   KIO::Job * job = KIO::stat( url );
   connect( job, SIGNAL( result (KIO::Job *) ),
            this, SLOT( slotResult (KIO::Job *) ) );
+  QWidget dummy(0,0,WType_Modal);
+  qt_enter_modal(&dummy);
   qApp->enter_loop();
+  qt_leave_modal(&dummy);
   return bJobOK;
 }                                                                            

Cheers,
Waldo
-- 
Make way, KDE/Linux is coming to a desktop near you!

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

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