From kfm-devel Thu Nov 04 19:29:41 2004 From: David Faure Date: Thu, 04 Nov 2004 19:29:41 +0000 To: kfm-devel Subject: Re: Intergrating mht file to konqueror Message-Id: <200411042029.42360.faure () kde ! org> X-MARC-Message: https://marc.info/?l=kfm-devel&m=109959649007762 On Thursday 04 November 2004 20:08, Spiros Georgaras wrote: > David Faure wrote: > > Ah yeah I'm still behind with that. > > How about adding support for X-KDE-LocalProtocol instead? Query the > > mimetype for it, and if it's set, redirect to ://path. > > Sorry David I don't understand what you mean.... :( > Where does X-KDE-LocalProtocol refer to? > Do you mean to change the mht.protocol file? > > I see in konq_mainwindow.cc file: > //////////// Tar/zip files support > // The hack-ish and hardcoded way. > // Possible cleaner solution: 2 properties in the mimetype definition, > // e.g. X-Konq-Redirect-URL set to tar:%f/ > // and X-Konq-Redirect-Mimetype set to inode/directory > > This is something different right? It was the initial idea long ago, but after discussion with Jowenn he added X-KDE-LocalProtocol to the mimetypes instead. For instance the mimetype application/x-tar has a property X-KDE-LocalProtocol set to "tar" (see kdelibs/mimetypes/application/x-tar.desktop) So the konq_mainwindow code would be like if ( url.isLocalFile() ) { KServiceType::Ptr ptr = KServiceType::serviceType( serviceType ); if ( ptr ) { const QString protocol = ptr->property("X-KDE-LocalProtocol").toString(); if ( !protocol.isEmpty() ) { url.setProtocol( protocol ); url.setPath( url.path() + '/' ); // TODO: for *.war files we want "/index.html". New property? serviceType = "inode/directory"; // would be text/html for *.war files... } } } Please test, it should work :) Don't forget to add this to your mimetype .desktop file: [Property::X-KDE-LocalProtocol] Type=QString Value=mht Hmm, it looks like x-zip.desktop is missing it... -- David Faure, faure@kde.org, sponsored by Trolltech to work on KDE, Konqueror (http://www.konqueror.org), and KOffice (http://www.koffice.org).