|
|
|
@ -27,13 +27,13 @@
|
|
|
|
|
#include <tdehtml_part.h>
|
|
|
|
|
#include <tdehtml_settings.h>
|
|
|
|
|
|
|
|
|
|
DocumentationViewer::DocumentationViewer(TQWidget *parent, const char *name ) : KHTMLPart(parent,name, 0, 0, BrowserViewGUI)
|
|
|
|
|
DocumentationViewer::DocumentationViewer(TQWidget *parent, const char *name ) : TDEHTMLPart(parent,name, 0, 0, BrowserViewGUI)
|
|
|
|
|
{
|
|
|
|
|
m_hpos = 0;
|
|
|
|
|
TDEConfig konqConfig("konquerorrc");
|
|
|
|
|
konqConfig.setGroup("HTML Settings");
|
|
|
|
|
//const KHTMLSettings * set = settings();
|
|
|
|
|
//( const_cast<KHTMLSettings *>(set) )->init( &konqConfig, false );
|
|
|
|
|
//const TDEHTMLSettings * set = settings();
|
|
|
|
|
//( const_cast<TDEHTMLSettings *>(set) )->init( &konqConfig, false );
|
|
|
|
|
TQString rc = TDEGlobal::dirs()->findResource("appdata", "docpartui.rc");
|
|
|
|
|
setXMLFile(rc);
|
|
|
|
|
(void) KStdAction::back(this, TQT_SLOT(back()), actionCollection(),"Back" );
|
|
|
|
@ -48,15 +48,15 @@ void DocumentationViewer::urlSelected(const TQString &url, int button, int state
|
|
|
|
|
KURL cURL = completeURL(url);
|
|
|
|
|
TQString mime = KMimeType::findByURL(cURL).data()->name();
|
|
|
|
|
|
|
|
|
|
//load this URL in the embedded viewer if KHTML can handle it, or when mimetype detection failed
|
|
|
|
|
//load this URL in the embedded viewer if TDEHTML can handle it, or when mimetype detection failed
|
|
|
|
|
KService::Ptr service = KService::serviceByDesktopName("tdehtml");
|
|
|
|
|
if ( ( mime == KMimeType::defaultMimeType() ) || (service && service->hasServiceType(mime)) )
|
|
|
|
|
{
|
|
|
|
|
KHTMLPart::urlSelected(url, button, state, target, args);
|
|
|
|
|
TDEHTMLPart::urlSelected(url, button, state, target, args);
|
|
|
|
|
openURL(cURL) ;
|
|
|
|
|
addToHistory(cURL.url());
|
|
|
|
|
}
|
|
|
|
|
//KHTML can't handle it, look for an appropriate application
|
|
|
|
|
//TDEHTML can't handle it, look for an appropriate application
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
KTrader::OfferList offers = KTrader::self()->query(mime, "Type == 'Application'");
|
|
|
|
|