kget<-->konqueror integration

David Faure david at mandrakesoft.com
Wed Jun 12 10:16:09 BST 2002


On Thursday 06 June 2002 10:42, patrick wrote:
> Hi list,
> i would like to add an integration between kget and konqueror, in the sense 
> when you click on a link ( *.gz ) instead opening the default box [save 
> as...cancel] launch the download manager.

Does kget handling the "save" case only, or also the "open" case?

> At the first look i figure out 2 way do doing this (but maybe there's a better 
> way)
> 1) modify the code in 
> 
> void BrowserRun::simpleSave( const KURL & url, const QString & 
> suggestedFilename )

Ok, this is going to be _after_ the open-or-save question then.
Which I think makes sense - in the open case, most kde apps will handle
the downloading themselves, via KIO, which gives real URLs instead of
tempfile ones - and which can also give progressive loading for some apps, etc.

> {
>  bool b_useKget;
>  b_useKget = Find_In_Some_Config_File
+ kget_is_installed.... ;)

> if ( b_useKget)
> 	save_with_kget();
> else
> simpleSave( url, suggestedFilename );
> }
> same stuff in KHTMLPopupGUIClient::saveURL

ok - not in the case where the data comes from the html cache though ;)

> 2) Or modify  KIO::copy( url, destURL );

That sounds more generic already, which might be a good thing.
Well, that really depends on how it works, which I don't know ;)
KIO::copy is the high-level recursive one anyway, it's rather file_copy
that you might want.
Then any application using file_copy (directly, via copy(), or via NetAccess)
will make the download appear in kget.
There's also the case of apps using get() - which is even more common,
but then I don't know if kget can/wants to handle that.

> Do you have suggestions?
> 
> Other question where put the config entry
> use_kget=yes
> in konquerorrc under [HTML Settings] ?

I think a KDE-wide setting would make more sense - well, depending on
which solution you go for.
(But if you go for a browserrun change, than this isn't HTML related at all,
better use a more global group.)
In fact it sounds simpler to make that a kdeglobals setting - think of the kmail
case for instance. It uses khtml, and can offer downloads too when clicking on
a file (hmm, it does its own save-or-open dialog though). This is a good example
of why a KIO::file_copy hack would be better.

-- 
David FAURE, david at mandrakesoft.com, faure at kde.org
http://people.mandrakesoft.com/~david/
Contributing to: http://www.konqueror.org/, http://www.koffice.org/
LinuxTag was fun: polar bears, bad movies, live hacking, late hacking, bed sharing, Fahrplan.





More information about the kfm-devel mailing list