Persistence of KParts plugins

David Faure faure at kde.org
Mon Jul 14 15:40:48 BST 2003


On Monday 14 July 2003 15:42, Antonio Larrosa Jiménez wrote:
> Hello,
> 
> It's been a long time since I've first thought of modifying the web 
> archiver plugin of Konqueror. The main problem I had with it was that it 
> always blocks Konqueror until it finished downloading all the images on 
> the page, which can take a long time. Also, even if you try to do other 
> things with other applications while it's archiving a page, the popup of 
> multiple windows (from kio) which steal the focus is really annoying.
> 
> As a result, yesterday afternoon I made some changes to it. In my version, 
> the web archiver shows a dialog with a listview in which you can see the 
> state of all the images that are being downloaded, in a few days, you'll 
> be able to retry the download of a single image if it fails, which 
> currently just fails silently (so now, you have to open the war file after 
> archiving, just to be sure everything was loaded ok, which happens more 
> often than usual, as sometimes the download window steals the focus just 
> when you're pressing the space key, and that cancels a single download).
> 
> I've also ported it to use KIO::Job instead of the NetAccess class, and the 
> dialog is non-modal so that you can still use Konqueror to navigate while 
> the page is being archived.
Great.

> But now I have a problem, and it's that it seems that when konqueror 
> deletes the khtmlpart, it deletes the plugins, so if you close the web 
> page that is being archived, the archiver exits too.

Your dialog has the plugin as parent? Change that to 0, so that
the dialog can't be deleted by any other means than itself being closed
(use e.g. WDestructiveClose).

> Can somebody tell me if there's any way to do this correctly so that the 
> archiver stays open even if the user closes the whole konqueror window?
> (the dialog has a cancel button so that should be the way to exit from the 
> archiver).

kapp->ref() when showing the dialog, kapp->deref() when closing it.
This will ensure that the process doesn't exit until the dialog is closed.

-- 
David FAURE, faure at kde.org, sponsored by Trolltech to work on KDE,
Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).
Qtella users - stability patches at http://blackie.dk/~dfaure/qtella.html




More information about the kfm-devel mailing list