void KWebDesktopRun::slotMimetype(KIO::Job *job, const QString &_type) { KIO::SimpleJob *sjob = static_cast< KIO::SimpleJob * >(job); // Update our URL in case of a redirection m_url = sjob->url(); QString type = _type; // necessary copy if we plan to use it sjob->putOnHold(); kdDebug() << "slotMimetype : " << type << endl; KParts::ReadOnlyPart *part = m_webDesktop->createPart(type); // Now open the URL in the part if(part) part->openURL(m_url); }
void AutoRefresh::slotRefresh() { if ( !parent()->inherits("KParts::ReadOnlyPart") ) { QString title = i18n( "Cannot Refresh Source" ); QString text = i18n( "<qt>This plugin cannot auto-refresh the current part.</qt>" ); QMessageBox::warning( 0, title, text ); } else { KParts::ReadOnlyPart *part = (KParts::ReadOnlyPart *) parent(); // Get URL KURL url = part->url(); part->openURL( url ); } }