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

List:       kfm-devel
Subject:    Re: kio::netaccess and imagepreview
From:       Simon Hausmann <shaus () helios ! med ! Uni-Magdeburg ! DE>
Date:       2000-06-11 8:38:45
[Download RAW message or body]

On Sun, 11 Jun 2000, David Faure wrote:

> On Sat, Jun 10, 2000 at 06:12:27PM -0700, Waldo Bastian wrote:
> > On Sat, 10 Jun 2000, David Faure wrote:
> > > > Yes, this is exactly the problem I filed a bugreport for the other day..
> > > > if you do a saveAs in konqueror and then close the window, the "save-as"
> > > > action gets aborted.
> > > >
> > > > What about registering network operations to kapp and/or ktmainwindow
> > > > (refcounting)?
> > > >
> > > > Basically you want a generic signal like
> > > > "no active parts left". KTMainWindow::queryExit() is a signal like this
> > > > but specific to "mainwindows", to handle this situation we need a more
> > > > generic solution.
> > > >
> > > > Note that a typical KDE application never actually should do something
> > > > with queryExit() besides returning true.
> > > >
> > > > What about adding something like "ref()" and "deref()" to KApplication.
> > > > When the ref-count decreases and becomes 0 or smaller we quit. Then it's
> > > > just a matter of letting KTMainWindow do a ref() and ~KTMainWindow do a
> > > > deref(), things like download then need to do their own ref() and
> > > > deref().
> > >
> > > I totally agree with this very good (and very general) solution.
> > >
> > > Note, however that it will fix the problem you reported (konqueror aborting
> > > the download because exiting) but _not_, as far as I can see, the problem
> > > that Simon reported.
> > > Unless I misunderstood, the problem with NetAccess is that
> > > enter_loop/exit_loop trick. You make a call, the control supposedly stays
> > > there but in fact the application still process events. If somebody closes
> > > the window (even if it's not the last one !) you would still get a crash,
> > > when the NetAccess call returns... into a class that was deleted.
> > >
> > > :-(
> > 
> > Ah.. I see. NetAccess should behave as if it had a modal dialog active, even 
> > if it doesn't actually have one :-)
> Exactly.
> 
> > I asked the trolls for such a feature in a wishreport... but I don't think it 
> > made it into Qt2.1.1
> Oh, yes, I remember about that.
> 
> > What about the following hack (see attachment) Microsoft would be proud of 
> > our exploitation of this hidden API >:-)
> Hehe :-)
> The difference is that we can do that because Qt is open source... so we
> can look for the hidden API quite easily :)
> 
> So we need to do the enter_loop AND the qt_enter_modal ? Wow.
> I see. It emulates a modal dialog.... which doesn't exist.
> 
> Hmm, it's getting late. I'll test it tomorrow, if Simon isn't faster.

;-)

I applied the patch and hmm, not much changed. I attached two backtraces.

The first one shows a nice loop of KIO::NetAccess::stat() being called
recursively from local event loops (this seems a good candidate for
Waldo's proposed reference counting?) .

The second one shows the event loop problem (a timer event into the
iconview although the mainwindow including all views (iconview) have
already been destructed (according to the debug output above) .

(yes, the init_libkonqiconview trace is obviously wrong ;) - I guess it's
the usual broken gdb trace which should be some slot in KonqIconView?)


It might be however that the backtraces are simply broken (this is a usual
case for the gdb on my system ;-)


BTW, shall we really name the thumbnail directory .mospics? I mean, it's
probably cool for mosfet :-)) but it doesn't tell very much. How about
calling it .kthumbs or so? Just my HO :-)


Bye,
 Simon

["bt.txt" (TEXT/PLAIN)]

#0  0x40000006 in ?? () from /lib/ld-linux.so.2
#1  0x4083c9dc in QIconView::onItem ()
#2  0x407600f6 in QIconView::contentsMouseMoveEvent ()
#3  0x407c4859 in QScrollView::viewportMouseMoveEvent ()
#4  0x407c3f75 in QScrollView::eventFilter ()
#5  0x4076568b in QIconView::eventFilter ()
#6  0x406dcd3e in QObject::activate_filters ()
#7  0x40736f6c in QWidget::event ()
#8  0x40684c5a in QApplication::notify ()
#9  0x40616cce in QETWidget::translateMouseEvent ()
#10 0x406144d8 in QApplication::x11ProcessEvent ()
#11 0x40613d77 in QApplication::processNextEvent ()
#12 0x4068621d in QApplication::enter_loop ()
#13 0x40206544 in KIO::NetAccess::statInternal ()
#14 0x40205e5d in KIO::NetAccess::stat ()
#15 0x4009fcca in KonqFileItem::pixmap ()
#16 0x400a1f4f in KFileIVI::setIcon ()
#17 0x400a47d4 in KonqIconViewWidget::slotOnItem ()
#18 0x4083c9dc in QIconView::onItem ()
#19 0x407600f6 in QIconView::contentsMouseMoveEvent ()
#20 0x407c4859 in QScrollView::viewportMouseMoveEvent ()
#21 0x407c3f75 in QScrollView::eventFilter ()
#22 0x4076568b in QIconView::eventFilter ()
#23 0x406dcd3e in QObject::activate_filters ()
#24 0x40736f6c in QWidget::event ()
#25 0x40684c5a in QApplication::notify ()
#26 0x40616cce in QETWidget::translateMouseEvent ()
#27 0x406144d8 in QApplication::x11ProcessEvent ()
#28 0x40613d77 in QApplication::processNextEvent ()
#29 0x4068621d in QApplication::enter_loop ()
#30 0x40206544 in KIO::NetAccess::statInternal ()
#31 0x40205e5d in KIO::NetAccess::stat ()
#32 0x4009fcca in KonqFileItem::pixmap ()
#33 0x400a1f4f in KFileIVI::setIcon ()
#34 0x400a488c in KonqIconViewWidget::slotOnViewport ()
#35 0x406dedb5 in QObject::activate_signal ()
#36 0x4083ca6b in QIconView::onViewport ()
#37 0x40760109 in QIconView::contentsMouseMoveEvent ()
#38 0x407c4859 in QScrollView::viewportMouseMoveEvent ()
#39 0x407c3f75 in QScrollView::eventFilter ()
#40 0x4076568b in QIconView::eventFilter ()
#41 0x406dcd3e in QObject::activate_filters ()
#42 0x40736f6c in QWidget::event ()
#43 0x40684c5a in QApplication::notify ()
#44 0x40616cce in QETWidget::translateMouseEvent ()
#45 0x406144d8 in QApplication::x11ProcessEvent ()
#46 0x40613d77 in QApplication::processNextEvent ()
#47 0x4068621d in QApplication::enter_loop ()
#48 0x40206544 in KIO::NetAccess::statInternal ()
#49 0x40205e5d in KIO::NetAccess::stat ()
#50 0x400a0463 in KonqFileItem::pixmap ()
#51 0x400a1f4f in KFileIVI::setIcon ()
#52 0x400a47d4 in KonqIconViewWidget::slotOnItem ()
#53 0x4083c9dc in QIconView::onItem ()
#54 0x407600f6 in QIconView::contentsMouseMoveEvent ()
#55 0x407c4859 in QScrollView::viewportMouseMoveEvent ()
#56 0x407c3f75 in QScrollView::eventFilter ()
#57 0x4076568b in QIconView::eventFilter ()
#58 0x406dcd3e in QObject::activate_filters ()
#59 0x40736f6c in QWidget::event ()
#60 0x40684c5a in QApplication::notify ()
#61 0x40616cce in QETWidget::translateMouseEvent ()
[...]

["bt2.txt" (TEXT/PLAIN)]

konqueror: KonqMainWindow::~KonqMainWindow
konqueror: KonqViewManager::clear:
konqueror: slotPartActivated (nil)
kparts: MainWindow::createGUI for 0L
kparts: deactivating GUI for child view
konqueror: -KonqKfmIconView
libkonq: forgetting about /home/shaus
kparts: deleting widget [KonqIconViewWidget pointer (0x810ce08) to widget qiconview, geometry=700x388+0+0
] qiconview
kparts: KPartManager::slotObjectDestroyed()
konqueror: KonqViewManager::removePart ( 0x81072f0 )
kparts: Part child view removed
konqueror: KonqFrameContainer::~KonqFrameContainer() [KonqFrameContainer pointer (0x80dcbc8) to unnamed w
idget, geometry=700x405+0+75] - KonqFrameContainer
konqueror: KonqFrame::~KonqFrame() [KonqFrame pointer (0x8100ab8) to widget KonqFrame, geometry=700x405+0
+0]
konqueror: KonqMainWindow::~KonqMainWindow done
kdecore (KURL): KURL couldn't parse URL "???????????????????????????"
kio (KIOJob): stat ???????????????????????????
kio (KIOJob): error 11 /home/shaus/.mospics/med/alphawidget.gif
kio (Scheduler): Scheduler: job finished job = 0x8127dd8 pid = 31465
kio (KIOJob): stat file:/home/shaus/.xvpics/fm1.png
kio (Scheduler): slave status
kio (Scheduler): Slave = 0x8143eb0 (PID = 31465) protocol = file host = [None] Not connected
kio (Scheduler): Scheduling job
kio (Scheduler): Scheduler Info
kio (Scheduler): ==========
kio (Scheduler): Total Slaves: 2
kio (Scheduler):  Slave: file  0 pid: 31464
kio (Scheduler):  -- active: 0 idle: 2
kio (Scheduler):  Slave: file  0 pid: 31465
kio (Scheduler):  -- active: 0 idle: 2
kio (Scheduler): Idle Slaves: 2
kio (Scheduler):  IdleSlave: file  0
kio (Scheduler):  IdleSlave: file  0
kio (Scheduler): Jobs in Queue: 1
kio (Scheduler):  Job: file:/home/shaus/.xvpics/fm1.png
kio (Scheduler): scheduler: job started 0x80892d0
kio (KIOJob): error 11 /home/shaus/.xvpics/fm1.png
kio (Scheduler): Scheduler: job finished job = 0x80892d0 pid = 31464
kio (KIOJob): stat file:/home/shaus/.mospics
kio (Scheduler): slave status
kio (Scheduler): Slave = 0x81278b8 (PID = 31464) protocol = file host = [None] Not connected
kio (Scheduler): Scheduling job
kio (Scheduler): Scheduler Info
kio (Scheduler): ==========
kio (Scheduler): Total Slaves: 2
kio (Scheduler):  Slave: file  0 pid: 31464
kio (Scheduler):  -- active: 0 idle: 2
kio (Scheduler):  Slave: file  0 pid: 31465
kio (Scheduler):  -- active: 0 idle: 2
kio (Scheduler): Idle Slaves: 2
kio (Scheduler):  IdleSlave: file  0
kio (Scheduler):  IdleSlave: file  0
kio (Scheduler): Jobs in Queue: 1
kio (Scheduler):  Job: file:/home/shaus/.mospics
kio (Scheduler): scheduler: job started 0x808be50
kio (KIOJob): StatJob::slotStatEntry
kio (Scheduler): slave status
kio (Scheduler): Slave = 0x8143eb0 (PID = 31465) protocol = file host = [None] Not connected
kio (Scheduler): Scheduling job
kio (Scheduler): Scheduler Info
kio (Scheduler): ==========
kio (Scheduler): Total Slaves: 2
kio (Scheduler):  Slave: file  0 pid: 31464
kio (Scheduler):  -- active: 0 idle: 2
kio (Scheduler):  Slave: file  0 pid: 31465
kio (Scheduler):  -- active: 0 idle: 2
kio (Scheduler): Idle Slaves: 2
kio (Scheduler):  IdleSlave: file  0
kio (Scheduler):  IdleSlave: file  0
kio (Scheduler): Jobs in Queue: 1
kio (Scheduler):  Job: file:/home/shaus/.mospics/med
kio (Scheduler): scheduler: job started 0x8096970
kio (KIOJob): StatJob::slotStatEntry
kio (KIOJob): Finished [this = 0x81278b8]
kio (Scheduler): Scheduler: job finished job = 0x8096970 pid = 31464
QPixmap::operator=: Cannot assign to pixmap during painting
(no debugging symbols found)...
Program received signal SIGSEGV, Segmentation fault.
0x4075eff0 in QIconView::gridX ()
(gdb) bt
#0  0x4075eff0 in QIconView::gridX ()
#1  0x40c4331e in init_libkonqiconview ()
#2  0x406dedb5 in QObject::activate_signal ()
#3  0x40830c1f in QTimer::timeout ()
#4  0x40724f16 in QTimer::event ()
#5  0x40684c5a in QApplication::notify ()
#6  0x40615d59 in qt_activate_timers ()
#7  0x40613f8a in QApplication::processNextEvent ()
#8  0x4068621d in QApplication::enter_loop ()
#9  0x40613d01 in QApplication::exec ()
#10 0x40032f1d in main ()
#11 0x40b330aa in __libc_start_main ()


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

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