Intergrating mht file to konqueror

Spiros Georgaras sngeorgaras at otenet.gr
Sun Nov 7 19:56:33 GMT 2004


Στις Κυριακή 7 Νοέμβριος 2004 14:37, ο/η Thiago Macieira έγραψε:
> I have two ideas:
>
> 1) treat kio_mhtml as a container-like protocol, just like kio_tar and
> kio_zip. In that case, it is a T_FILESYSTEM protocol and will always
> return a file listing for listDir("/"). Konqueror will see that one file
> is called "index.html" or "index.xhtml" and decide to open it on its own,
> just as it does with normal files.
>
I don't think this will do, cause this way we will not be able to get the 
directory listing (like in 'war:/my_warfile.war/') if one of the index files 
exist in the mhtml file
>
> The question is: does Konqueror automatically open index.html for
> protocols other than kio_file?
>
> 2) treat kio_mhtml like a remote protocol, like kio_ftp. When Konqueror
> sends get("/"), kio_mhtml will send back a redirection to /index.html
> or /index.xhtml.

Same thing here.
>
> The questions are: when does Konqueror send listDir("/") or get("/")? How
> do we get a directory listing?

What could be done is that konqueror always requests '/index.html' and 
kio_mhtml returns 'index.html', 'index.xhtml' or '/' depending on what exists 
in the mhtml file.

But then konqueror should update its location bar, and I do not know if this 
can be done in a generic way....


Another solution would be to use a scheme like the one in 
http://lists.kde.org/?l=kfm-devel&m=109982140416184&w=2 with some changes:

[Property::X-KDE-LocalProtocol]
Type=QString
Value=mhtml

[Property::X-KDE-LocalFile]
Type=QStringList
Value=index.html,index.xhtml,/

[Property::X-KDE-LocalServiceType]
Type=QStringList
Value=text/html,application/xhtml+xml,inode/directory

With this scheme konqueror would ask for index.html (with serviceType 
text/html) and if it gets a valid answer it would display it. If not it would 
ask for index.xhtml and so on. The fallback solution would be to display the 
directory listing.

The problem is that this asking - answering thing should be trasparent to the 
user (I don' know how it could be done)




More information about the kfm-devel mailing list