Sophie

Sophie

distrib > Fedora > 15 > i386 > by-pkgid > 1f9eb832ba1e4b88d9a5c2b384813bb4 > files > 6319

kdelibs3-apidocs-3.5.10-31.fc15.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en_US" xml:lang="en_US">

<head>
  <title>kparts: browserrun.cpp Source File (kparts)</title>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

  <meta http-equiv="Content-Style-Type" content="text/css" />

  <meta http-equiv="pics-label" content='(pics-1.1 "http://www.icra.org/ratingsv02.html" comment "ICRAonline DE v2.0" l gen true for "http://www.kde.org"  r (nz 1 vz 1 lz 1 oz 1 cb 1) "http://www.rsac.org/ratingsv01.html" l gen true for "http://www.kde.org"  r (n 0 s 0 v 0 l 0))' />

  <meta name="trademark" content="KDE e.V." />
  <meta name="description" content="K Desktop Environment Homepage, KDE.org" />
  <meta name="MSSmartTagsPreventParsing" content="true" />
  <meta name="robots" content="all" />

  <link rel="shortcut icon" href="../../favicon.ico" />

<link rel="stylesheet" media="screen" type="text/css" title="APIDOX" href="doxygen.css" />



</head>

<body>

<div id="nav_header_top" align="right">
  <a href="#content" class="doNotDisplay" accesskey="2">Skip to main content ::</a>

  <a href="../.."><img id="nav_header_logo" alt="Home" align="left" src="../../kde_gear_64.png" border="0" /></a>
  <span class="doNotDisplay">::</span>

  <div id="nav_header_title" align="left">KDE API Reference</div>


</div>

<div id="nav_header_bottom" align="right">
  <span class="doNotDisplay">:: <a href="#navigation" accesskey="5">Skip to Link Menu</a><br/></span>
  <div id="nav_header_bottom_right" style="text-align: left;">
/ <a href="../..">API Reference</a>
 / <a href=".">kparts</a>
  </div>
</div>


<table id="main" border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
      <td valign="top" class="menuheader" height="0"></td>

  <td id="contentcolumn" valign="top" rowspan="2" >
    <div id="content" style="padding-top: 0px;"><div style="width:100%; margin: 0px; padding: 0px;">
    <a name="content"></a>


<!-- Generated by Doxygen 1.7.4 -->
<div class="header">
  <div class="headertitle">
<div class="title">browserrun.cpp</div>  </div>
</div>
<div class="contents">
<div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* This file is part of the KDE project</span>
<a name="l00002"></a>00002 <span class="comment"> *</span>
<a name="l00003"></a>00003 <span class="comment"> * Copyright (C) 2002 David Faure &lt;faure@kde.org&gt;</span>
<a name="l00004"></a>00004 <span class="comment"> * This library is free software; you can redistribute it and/or</span>
<a name="l00005"></a>00005 <span class="comment"> * modify it under the terms of the GNU Library General Public</span>
<a name="l00006"></a>00006 <span class="comment"> * License version 2, as published by the Free Software Foundation.</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> * This library is distributed in the hope that it will be useful,</span>
<a name="l00009"></a>00009 <span class="comment"> * but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00010"></a>00010 <span class="comment"> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU</span>
<a name="l00011"></a>00011 <span class="comment"> * Library General Public License for more details.</span>
<a name="l00012"></a>00012 <span class="comment"> *</span>
<a name="l00013"></a>00013 <span class="comment"> * You should have received a copy of the GNU Library General Public License</span>
<a name="l00014"></a>00014 <span class="comment"> * along with this library; see the file COPYING.LIB.  If not, write to</span>
<a name="l00015"></a>00015 <span class="comment"> * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,</span>
<a name="l00016"></a>00016 <span class="comment"> * Boston, MA 02110-1301, USA.</span>
<a name="l00017"></a>00017 <span class="comment"> */</span>
<a name="l00018"></a>00018 
<a name="l00019"></a>00019 <span class="preprocessor">#include &quot;browserrun.h&quot;</span>
<a name="l00020"></a>00020 <span class="preprocessor">#include &lt;kmessagebox.h&gt;</span>
<a name="l00021"></a>00021 <span class="preprocessor">#include &lt;kfiledialog.h&gt;</span>
<a name="l00022"></a>00022 <span class="preprocessor">#include &lt;kio/job.h&gt;</span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &lt;kio/scheduler.h&gt;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/klocale_8h.html">klocale.h</a>&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;kprocess.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;kstringhandler.h&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;kuserprofile.h&gt;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &lt;ktempfile.h&gt;</span>
<a name="l00029"></a>00029 <span class="preprocessor">#include &lt;kdebug.h&gt;</span>
<a name="l00030"></a>00030 <span class="preprocessor">#include &lt;kstandarddirs.h&gt;</span>
<a name="l00031"></a>00031 <span class="preprocessor">#include &lt;assert.h&gt;</span>
<a name="l00032"></a>00032 
<a name="l00033"></a>00033 <span class="keyword">using namespace </span>KParts;
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">class </span>BrowserRun::BrowserRunPrivate
<a name="l00036"></a>00036 {
<a name="l00037"></a>00037 <span class="keyword">public</span>:
<a name="l00038"></a>00038   <span class="keywordtype">bool</span> m_bHideErrorDialog;
<a name="l00039"></a>00039   <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="classKParts_1_1BrowserRun.html#a2e9f4b81983a433daea8e7464df11f54">contentDisposition</a>;
<a name="l00040"></a>00040 };
<a name="l00041"></a>00041 
<a name="l00042"></a><a class="code" href="classKParts_1_1BrowserRun.html#a99cb1a5bad86b2e5736d767b28a28149">00042</a> <a class="code" href="classKParts_1_1BrowserRun.html#a99cb1a5bad86b2e5736d767b28a28149">BrowserRun::BrowserRun</a>( <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a>&amp; url, <span class="keyword">const</span> <a class="code" href="structKParts_1_1URLArgs.html" title="URLArgs is a set of arguments bundled into a structure, to allow specifying how a URL should be opene...">KParts::URLArgs</a>&amp; args,
<a name="l00043"></a>00043                         <a class="code" href="classKParts_1_1ReadOnlyPart.html" title="Base class for any &quot;viewer&quot; part.">KParts::ReadOnlyPart</a> *part, <a class="codeRef" href="qwidget.html">QWidget</a>* window,
<a name="l00044"></a>00044                         <span class="keywordtype">bool</span> removeReferrer, <span class="keywordtype">bool</span> trustedSource )
<a name="l00045"></a>00045     : KRun( url, window, 0 <span class="comment">/*mode*/</span>, false <span class="comment">/*is_local_file known*/</span>, false <span class="comment">/* no GUI */</span> ),
<a name="l00046"></a>00046       m_args( args ), m_part( part ), m_window( window ),
<a name="l00047"></a>00047       m_bRemoveReferrer( removeReferrer ), m_bTrustedSource( trustedSource )
<a name="l00048"></a>00048 {
<a name="l00049"></a>00049   d = <span class="keyword">new</span> BrowserRunPrivate;
<a name="l00050"></a>00050   d-&gt;m_bHideErrorDialog = <span class="keyword">false</span>;
<a name="l00051"></a>00051 }
<a name="l00052"></a>00052 
<a name="l00053"></a>00053 <span class="comment">// BIC: merge with above ctor</span>
<a name="l00054"></a><a class="code" href="classKParts_1_1BrowserRun.html#ac056bae8866583802b328875f52d4a55">00054</a> <a class="code" href="classKParts_1_1BrowserRun.html#a99cb1a5bad86b2e5736d767b28a28149">BrowserRun::BrowserRun</a>( <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a>&amp; url, <span class="keyword">const</span> <a class="code" href="structKParts_1_1URLArgs.html" title="URLArgs is a set of arguments bundled into a structure, to allow specifying how a URL should be opene...">KParts::URLArgs</a>&amp; args,
<a name="l00055"></a>00055                         <a class="code" href="classKParts_1_1ReadOnlyPart.html" title="Base class for any &quot;viewer&quot; part.">KParts::ReadOnlyPart</a> *part, <a class="codeRef" href="qwidget.html">QWidget</a>* window,
<a name="l00056"></a>00056                         <span class="keywordtype">bool</span> removeReferrer, <span class="keywordtype">bool</span> trustedSource, <span class="keywordtype">bool</span> hideErrorDialog )
<a name="l00057"></a>00057     : KRun( url, window, 0 <span class="comment">/*mode*/</span>, false <span class="comment">/*is_local_file known*/</span>, false <span class="comment">/* no GUI */</span> ),
<a name="l00058"></a>00058       m_args( args ), m_part( part ), m_window( window ),
<a name="l00059"></a>00059       m_bRemoveReferrer( removeReferrer ), m_bTrustedSource( trustedSource )
<a name="l00060"></a>00060 {
<a name="l00061"></a>00061   d = <span class="keyword">new</span> BrowserRunPrivate;
<a name="l00062"></a>00062   d-&gt;m_bHideErrorDialog = <a class="code" href="classKParts_1_1BrowserRun.html#aa12658e1ed02cdcca9943dc2eb457403">hideErrorDialog</a>;
<a name="l00063"></a>00063 }
<a name="l00064"></a>00064 
<a name="l00065"></a>00065 BrowserRun::~BrowserRun()
<a name="l00066"></a>00066 {
<a name="l00067"></a>00067   <span class="keyword">delete</span> d;
<a name="l00068"></a>00068 }
<a name="l00069"></a>00069 
<a name="l00070"></a><a class="code" href="classKParts_1_1BrowserRun.html#a8d38674c3e53616f457f154863c06224">00070</a> <span class="keywordtype">void</span> <a class="code" href="classKParts_1_1BrowserRun.html#a8d38674c3e53616f457f154863c06224" title="Reimplemented from KRun.">BrowserRun::init</a>()
<a name="l00071"></a>00071 {
<a name="l00072"></a>00072   <span class="keywordflow">if</span> ( d-&gt;m_bHideErrorDialog )
<a name="l00073"></a>00073   {
<a name="l00074"></a>00074     <span class="comment">// ### KRun doesn&#39;t call a virtual method when it finds out that the URL</span>
<a name="l00075"></a>00075     <span class="comment">// is either malformed, or points to a non-existing local file...</span>
<a name="l00076"></a>00076     <span class="comment">// So we need to reimplement some of the checks, to handle m_bHideErrorDialog</span>
<a name="l00077"></a>00077     <span class="keywordflow">if</span> ( !m_strURL.isValid() ) {
<a name="l00078"></a>00078         redirectToError( KIO::ERR_MALFORMED_URL, m_strURL.url() );
<a name="l00079"></a>00079         <span class="keywordflow">return</span>;
<a name="l00080"></a>00080     }
<a name="l00081"></a>00081     <span class="keywordflow">if</span> ( !m_bIsLocalFile &amp;&amp; !m_bFault &amp;&amp; m_strURL.isLocalFile() )
<a name="l00082"></a>00082       m_bIsLocalFile = <span class="keyword">true</span>;
<a name="l00083"></a>00083 
<a name="l00084"></a>00084     <span class="keywordflow">if</span> ( m_bIsLocalFile )  {
<a name="l00085"></a>00085       <span class="keyword">struct </span>stat buff;
<a name="l00086"></a>00086       <span class="keywordflow">if</span> ( stat( <a class="codeRef" href="qfile.html#encodeName">QFile::encodeName</a>(m_strURL.path()), &amp;buff ) == -1 )
<a name="l00087"></a>00087       {
<a name="l00088"></a>00088         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun::init : &quot;</span> &lt;&lt; m_strURL.prettyURL() &lt;&lt; <span class="stringliteral">&quot; doesn&#39;t exist.&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00089"></a>00089         redirectToError( KIO::ERR_DOES_NOT_EXIST, m_strURL.path() );
<a name="l00090"></a>00090         <span class="keywordflow">return</span>;
<a name="l00091"></a>00091       }
<a name="l00092"></a>00092       m_mode = buff.st_mode; <span class="comment">// while we&#39;re at it, save it for KRun::init() to use it</span>
<a name="l00093"></a>00093     }
<a name="l00094"></a>00094   }
<a name="l00095"></a>00095   <a class="code" href="classKParts_1_1BrowserRun.html#a8d38674c3e53616f457f154863c06224" title="Reimplemented from KRun.">KRun::init</a>();
<a name="l00096"></a>00096 }
<a name="l00097"></a>00097 
<a name="l00098"></a><a class="code" href="classKParts_1_1BrowserRun.html#a6270aaed82661d4cc771d718c4608702">00098</a> <span class="keywordtype">void</span> <a class="code" href="classKParts_1_1BrowserRun.html#a6270aaed82661d4cc771d718c4608702" title="Reimplemented from KRun.">BrowserRun::scanFile</a>()
<a name="l00099"></a>00099 {
<a name="l00100"></a>00100   <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun::scanfile &quot;</span> &lt;&lt; m_strURL.prettyURL() &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00101"></a>00101 
<a name="l00102"></a>00102   <span class="comment">// Let&#39;s check for well-known extensions</span>
<a name="l00103"></a>00103   <span class="comment">// Not when there is a query in the URL, in any case.</span>
<a name="l00104"></a>00104   <span class="comment">// Optimization for http/https, findByURL doesn&#39;t trust extensions over http.</span>
<a name="l00105"></a>00105   <span class="keywordflow">if</span> ( m_strURL.query().isEmpty() &amp;&amp; !m_strURL.protocol().startsWith(<span class="stringliteral">&quot;http&quot;</span>) )
<a name="l00106"></a>00106   {
<a name="l00107"></a>00107     KMimeType::Ptr mime = KMimeType::findByURL( m_strURL );
<a name="l00108"></a>00108     assert( mime != 0L );
<a name="l00109"></a>00109     <span class="keywordflow">if</span> ( mime-&gt;name() != <span class="stringliteral">&quot;application/octet-stream&quot;</span> || m_bIsLocalFile )
<a name="l00110"></a>00110     {
<a name="l00111"></a>00111       <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;Scanfile: MIME TYPE is &quot;</span> &lt;&lt; mime-&gt;name() &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00112"></a>00112       foundMimeType( mime-&gt;name() );
<a name="l00113"></a>00113       <span class="keywordflow">return</span>;
<a name="l00114"></a>00114     }
<a name="l00115"></a>00115   }
<a name="l00116"></a>00116 
<a name="l00117"></a>00117   <span class="keywordflow">if</span> ( m_part )
<a name="l00118"></a>00118   {
<a name="l00119"></a>00119       <a class="codeRef" href="qstring.html">QString</a> proto = m_part-&gt;<a class="code" href="classKParts_1_1ReadOnlyPart.html#acb4ef957a59d80168a38c4bf24d0dd11" title="Returns the currently in part used URL.">url</a>().<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a4be1d1602a1d0f0afeee230167ebfdc4">protocol</a>().<a class="codeRef" href="qstring.html#lower">lower</a>();
<a name="l00120"></a>00120 
<a name="l00121"></a>00121       <span class="keywordflow">if</span> (proto == <span class="stringliteral">&quot;https&quot;</span> || proto == <span class="stringliteral">&quot;webdavs&quot;</span>) {
<a name="l00122"></a>00122           m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>().<a class="codeRef" href="qmap.html#insert">insert</a>(<span class="stringliteral">&quot;main_frame_request&quot;</span>, <span class="stringliteral">&quot;TRUE&quot;</span> );
<a name="l00123"></a>00123           m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>().<a class="codeRef" href="qmap.html#insert">insert</a>(<span class="stringliteral">&quot;ssl_was_in_use&quot;</span>, <span class="stringliteral">&quot;TRUE&quot;</span> );
<a name="l00124"></a>00124           m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>().<a class="codeRef" href="qmap.html#insert">insert</a>(<span class="stringliteral">&quot;ssl_activate_warnings&quot;</span>, <span class="stringliteral">&quot;TRUE&quot;</span> );
<a name="l00125"></a>00125       } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (proto == <span class="stringliteral">&quot;http&quot;</span> || proto == <span class="stringliteral">&quot;webdav&quot;</span>) {
<a name="l00126"></a>00126           m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>().<a class="codeRef" href="qmap.html#insert">insert</a>(<span class="stringliteral">&quot;ssl_activate_warnings&quot;</span>, <span class="stringliteral">&quot;TRUE&quot;</span> );
<a name="l00127"></a>00127           m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>().<a class="codeRef" href="qmap.html#insert">insert</a>(<span class="stringliteral">&quot;ssl_was_in_use&quot;</span>, <span class="stringliteral">&quot;FALSE&quot;</span> );
<a name="l00128"></a>00128       }
<a name="l00129"></a>00129 
<a name="l00130"></a>00130       <span class="comment">// Set the PropagateHttpHeader meta-data if it has not already been set...</span>
<a name="l00131"></a>00131       <span class="keywordflow">if</span> (!m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>().<a class="codeRef" href="qmap.html#contains">contains</a>(<span class="stringliteral">&quot;PropagateHttpHeader&quot;</span>))
<a name="l00132"></a>00132           m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>().<a class="codeRef" href="qmap.html#insert">insert</a>(<span class="stringliteral">&quot;PropagateHttpHeader&quot;</span>, <span class="stringliteral">&quot;TRUE&quot;</span>);
<a name="l00133"></a>00133   }
<a name="l00134"></a>00134 
<a name="l00135"></a>00135   KIO::TransferJob *job;
<a name="l00136"></a>00136   <span class="keywordflow">if</span> ( m_args.<a class="code" href="structKParts_1_1URLArgs.html#adff3144249d635b75cb9f87d207bc3e2" title="KHTML-specific field, whether to do a POST instead of a GET, for the next openURL.">doPost</a>() &amp;&amp; m_strURL.protocol().startsWith(<span class="stringliteral">&quot;http&quot;</span>))
<a name="l00137"></a>00137   {
<a name="l00138"></a>00138       job = KIO::http_post( m_strURL, m_args.<a class="code" href="structKParts_1_1URLArgs.html#a5c185a473bb70a25e2379701beba2a8d" title="KHTML-specific field, contents of the HTTP POST data.">postData</a>, <span class="keyword">false</span> );
<a name="l00139"></a>00139       job-&gt;addMetaData( <span class="stringliteral">&quot;content-type&quot;</span>, m_args.<a class="code" href="structKParts_1_1URLArgs.html#aaa8f11b78a6a4e6159e477607dd3ceb7" title="KHTML-specific field, header defining the type of the POST data.">contentType</a>() );
<a name="l00140"></a>00140   }
<a name="l00141"></a>00141   <span class="keywordflow">else</span>
<a name="l00142"></a>00142       job = KIO::get(m_strURL, m_args.<a class="code" href="structKParts_1_1URLArgs.html#a8050ee8bb3a7d7c6b23c6549e6156303" title="reload is set when the cache shouldn&#39;t be used (forced reload).">reload</a>, <span class="keyword">false</span>);
<a name="l00143"></a>00143 
<a name="l00144"></a>00144   <span class="keywordflow">if</span> ( m_bRemoveReferrer )
<a name="l00145"></a>00145      m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>().<a class="codeRef" href="qmap.html#remove">remove</a>(<span class="stringliteral">&quot;referrer&quot;</span>);
<a name="l00146"></a>00146 
<a name="l00147"></a>00147   job-&gt;addMetaData( m_args.<a class="code" href="structKParts_1_1URLArgs.html#a498868b5e78d5e41a3b092f0f8272d97" title="Meta-data to associate with the next KIO operation.">metaData</a>() );
<a name="l00148"></a>00148   job-&gt;setWindow( m_window );
<a name="l00149"></a>00149   connect( job, SIGNAL( result( KIO::Job *)),
<a name="l00150"></a>00150            <span class="keyword">this</span>, SLOT( slotBrowserScanFinished(KIO::Job *)));
<a name="l00151"></a>00151   connect( job, SIGNAL( mimetype( KIO::Job *, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;)),
<a name="l00152"></a>00152            <span class="keyword">this</span>, SLOT( slotBrowserMimetype(KIO::Job *, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;)));
<a name="l00153"></a>00153   m_job = job;
<a name="l00154"></a>00154 }
<a name="l00155"></a>00155 
<a name="l00156"></a>00156 <span class="keywordtype">void</span> BrowserRun::slotBrowserScanFinished(KIO::Job *job)
<a name="l00157"></a>00157 {
<a name="l00158"></a>00158   <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun::slotBrowserScanFinished&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00159"></a>00159   <span class="keywordflow">if</span> ( job-&gt;error() == KIO::ERR_IS_DIRECTORY )
<a name="l00160"></a>00160   {
<a name="l00161"></a>00161       <span class="comment">// It is in fact a directory. This happens when HTTP redirects to FTP.</span>
<a name="l00162"></a>00162       <span class="comment">// Due to the &quot;protocol doesn&#39;t support listing&quot; code in BrowserRun, we</span>
<a name="l00163"></a>00163       <span class="comment">// assumed it was a file.</span>
<a name="l00164"></a>00164       <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;It is in fact a directory!&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00165"></a>00165       <span class="comment">// Update our URL in case of a redirection</span>
<a name="l00166"></a>00166       m_strURL = <span class="keyword">static_cast&lt;</span>KIO::TransferJob *<span class="keyword">&gt;</span>(job)-&gt;<a class="code" href="classKParts_1_1BrowserRun.html#a2646233eb9f6ff37b4725d3232c6ac9f">url</a>();
<a name="l00167"></a>00167       m_job = 0;
<a name="l00168"></a>00168       foundMimeType( <span class="stringliteral">&quot;inode/directory&quot;</span> );
<a name="l00169"></a>00169   }
<a name="l00170"></a>00170   <span class="keywordflow">else</span>
<a name="l00171"></a>00171   {
<a name="l00172"></a>00172       <span class="keywordflow">if</span> ( job-&gt;error() )
<a name="l00173"></a>00173           <a class="code" href="classKParts_1_1BrowserRun.html#a8cb5f34d1c92111e70768ac269b17e0b" title="Called when an error happens.">handleError</a>( job );
<a name="l00174"></a>00174       <span class="keywordflow">else</span>
<a name="l00175"></a>00175           KRun::slotScanFinished(job);
<a name="l00176"></a>00176   }
<a name="l00177"></a>00177 }
<a name="l00178"></a>00178 
<a name="l00179"></a>00179 <span class="keywordtype">void</span> BrowserRun::slotBrowserMimetype( KIO::Job *_job, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;type )
<a name="l00180"></a>00180 {
<a name="l00181"></a>00181   Q_ASSERT( _job == m_job );
<a name="l00182"></a>00182   KIO::TransferJob *job = <span class="keyword">static_cast&lt;</span>KIO::TransferJob *<span class="keyword">&gt;</span>(m_job);
<a name="l00183"></a>00183   <span class="comment">// Update our URL in case of a redirection</span>
<a name="l00184"></a>00184   <span class="comment">//kdDebug(1000) &lt;&lt; &quot;old URL=&quot; &lt;&lt; m_strURL.url() &lt;&lt; endl;</span>
<a name="l00185"></a>00185   <span class="comment">//kdDebug(1000) &lt;&lt; &quot;new URL=&quot; &lt;&lt; job-&gt;url().url() &lt;&lt; endl;</span>
<a name="l00186"></a>00186   m_strURL = job-&gt;url();
<a name="l00187"></a>00187   <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;slotBrowserMimetype: found &quot;</span> &lt;&lt; type &lt;&lt; <span class="stringliteral">&quot; for &quot;</span> &lt;&lt; m_strURL.prettyURL() &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00188"></a>00188 
<a name="l00189"></a>00189   m_suggestedFilename = job-&gt;queryMetaData(<span class="stringliteral">&quot;content-disposition-filename&quot;</span>);
<a name="l00190"></a>00190   d-&gt;contentDisposition = job-&gt;queryMetaData(<span class="stringliteral">&quot;content-disposition-type&quot;</span>);
<a name="l00191"></a>00191   <span class="comment">//kdDebug(1000) &lt;&lt; &quot;m_suggestedFilename=&quot; &lt;&lt; m_suggestedFilename &lt;&lt; endl;</span>
<a name="l00192"></a>00192 
<a name="l00193"></a>00193   <span class="comment">// Make a copy to avoid a dead reference</span>
<a name="l00194"></a>00194   <a class="codeRef" href="qstring.html">QString</a> _type = type;
<a name="l00195"></a>00195   job-&gt;putOnHold();
<a name="l00196"></a>00196   m_job = 0;
<a name="l00197"></a>00197 
<a name="l00198"></a>00198   KRun::setSuggestedFileName(m_suggestedFilename);
<a name="l00199"></a>00199 
<a name="l00200"></a>00200   foundMimeType( _type );
<a name="l00201"></a>00201 }
<a name="l00202"></a>00202 
<a name="l00203"></a><a class="code" href="classKParts_1_1BrowserRun.html#a620eeb51117a09a603240d58692f0d53">00203</a> <a class="code" href="classKParts_1_1BrowserRun.html#af7f4f75d5ab28c3183f9f5ee96b8a79f" title="NotHandled means that foundMimeType should call KRun::foundMimeType, i.e.">BrowserRun::NonEmbeddableResult</a> <a class="code" href="classKParts_1_1BrowserRun.html#a620eeb51117a09a603240d58692f0d53" title="Helper for foundMimeType: call this if the mimetype couldn&#39;t be embedded.">BrowserRun::handleNonEmbeddable</a>( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; _mimeType )
<a name="l00204"></a>00204 {
<a name="l00205"></a>00205     <a class="codeRef" href="qstring.html">QString</a> mimeType( _mimeType );
<a name="l00206"></a>00206     Q_ASSERT( !m_bFinished ); <span class="comment">// only come here if the mimetype couldn&#39;t be embedded</span>
<a name="l00207"></a>00207     <span class="comment">// Support for saving remote files.</span>
<a name="l00208"></a>00208     <span class="keywordflow">if</span> ( mimeType != <span class="stringliteral">&quot;inode/directory&quot;</span> &amp;&amp; <span class="comment">// dirs can&#39;t be saved</span>
<a name="l00209"></a>00209          !m_strURL.isLocalFile() )
<a name="l00210"></a>00210     {
<a name="l00211"></a>00211         <span class="keywordflow">if</span> ( isTextExecutable(mimeType) )
<a name="l00212"></a>00212             mimeType = <a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;text/plain&quot;</span>); <span class="comment">// view, don&#39;t execute</span>
<a name="l00213"></a>00213         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun: ask for saving&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00214"></a>00214         KService::Ptr offer = KServiceTypeProfile::preferredService(mimeType, <span class="stringliteral">&quot;Application&quot;</span>);
<a name="l00215"></a>00215         <span class="comment">// ... -&gt; ask whether to save</span>
<a name="l00216"></a>00216         KParts::BrowserRun::AskSaveResult res = <a class="code" href="classKParts_1_1BrowserRun.html#acf2a328da7456c5beff019e1bc5e626d" title="Ask the user whether to save or open a url in another application.">askSave</a>( m_strURL, offer, mimeType, m_suggestedFilename );
<a name="l00217"></a>00217         <span class="keywordflow">if</span> ( res == KParts::BrowserRun::Save ) {
<a name="l00218"></a>00218             save( m_strURL, m_suggestedFilename );
<a name="l00219"></a>00219             <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun::handleNonEmbeddable: Save: returning Handled&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00220"></a>00220             m_bFinished = <span class="keyword">true</span>;
<a name="l00221"></a>00221             <span class="keywordflow">return</span> Handled;
<a name="l00222"></a>00222         }
<a name="l00223"></a>00223         <span class="keywordflow">else</span> <span class="keywordflow">if</span> ( res == KParts::BrowserRun::Cancel ) {
<a name="l00224"></a>00224             <span class="comment">// saving done or canceled</span>
<a name="l00225"></a>00225             <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun::handleNonEmbeddable: Cancel: returning Handled&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00226"></a>00226             m_bFinished = <span class="keyword">true</span>;
<a name="l00227"></a>00227             <span class="keywordflow">return</span> Handled;
<a name="l00228"></a>00228         }
<a name="l00229"></a>00229         <span class="keywordflow">else</span> <span class="comment">// &quot;Open&quot; chosen (done by KRun::foundMimeType, called when returning NotHandled)</span>
<a name="l00230"></a>00230         {
<a name="l00231"></a>00231             <span class="comment">// If we were in a POST, we can&#39;t just pass a URL to an external application.</span>
<a name="l00232"></a>00232             <span class="comment">// We must save the data to a tempfile first.</span>
<a name="l00233"></a>00233             <span class="keywordflow">if</span> ( m_args.<a class="code" href="structKParts_1_1URLArgs.html#adff3144249d635b75cb9f87d207bc3e2" title="KHTML-specific field, whether to do a POST instead of a GET, for the next openURL.">doPost</a>() )
<a name="l00234"></a>00234             {
<a name="l00235"></a>00235                 <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun: request comes from a POST, can&#39;t pass a URL to another app, need to save&quot;</span> &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00236"></a>00236                 m_sMimeType = mimeType;
<a name="l00237"></a>00237                 <a class="codeRef" href="qstring.html">QString</a> extension;
<a name="l00238"></a>00238                 <a class="codeRef" href="qstring.html">QString</a> fileName = m_suggestedFilename.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() ? m_strURL.fileName() : m_suggestedFilename;
<a name="l00239"></a>00239                 <span class="keywordtype">int</span> extensionPos = fileName.<a class="codeRef" href="qstring.html#findRev">findRev</a>( <span class="charliteral">&#39;.&#39;</span> );
<a name="l00240"></a>00240                 <span class="keywordflow">if</span> ( extensionPos != -1 )
<a name="l00241"></a>00241                     extension = fileName.<a class="codeRef" href="qstring.html#mid">mid</a>( extensionPos ); <span class="comment">// keep the &#39;.&#39;</span>
<a name="l00242"></a>00242                 <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKTempFile.html">KTempFile</a> tempFile( QString::null, extension );
<a name="l00243"></a>00243                 <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> destURL;
<a name="l00244"></a>00244                 destURL.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a6c0a0828b4b9f1126b13380076e2b2f3">setPath</a>( tempFile.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKTempFile.html#a712884c609987c0921aa0123cab34b16">name</a>() );
<a name="l00245"></a>00245                 KIO::Job *job = KIO::file_copy( m_strURL, destURL, 0600, <span class="keyword">true</span> <span class="comment">/*overwrite*/</span>, <span class="keyword">false</span> <span class="comment">/*no resume*/</span>, <span class="keyword">true</span> <span class="comment">/*progress info*/</span> );
<a name="l00246"></a>00246                 job-&gt;setWindow (m_window);
<a name="l00247"></a>00247                 connect( job, SIGNAL( result( KIO::Job *)),
<a name="l00248"></a>00248                          <span class="keyword">this</span>, SLOT( slotCopyToTempFileResult(KIO::Job *)) );
<a name="l00249"></a>00249                 <span class="keywordflow">return</span> Delayed; <span class="comment">// We&#39;ll continue after the job has finished</span>
<a name="l00250"></a>00250             }
<a name="l00251"></a>00251         }
<a name="l00252"></a>00252     }
<a name="l00253"></a>00253 
<a name="l00254"></a>00254     <span class="comment">// Check if running is allowed</span>
<a name="l00255"></a>00255     <span class="keywordflow">if</span> ( !m_bTrustedSource &amp;&amp; <span class="comment">// ... and untrusted source...</span>
<a name="l00256"></a>00256          !allowExecution( mimeType, m_strURL ) ) <span class="comment">// ...and the user said no (for executables etc.)</span>
<a name="l00257"></a>00257     {
<a name="l00258"></a>00258         m_bFinished = <span class="keyword">true</span>;
<a name="l00259"></a>00259         <span class="keywordflow">return</span> Handled;
<a name="l00260"></a>00260     }
<a name="l00261"></a>00261 
<a name="l00262"></a>00262     KIO::SimpleJob::removeOnHold(); <span class="comment">// Kill any slave that was put on hold.</span>
<a name="l00263"></a>00263     <span class="keywordflow">return</span> NotHandled;
<a name="l00264"></a>00264 }
<a name="l00265"></a>00265 
<a name="l00266"></a>00266 <span class="comment">//static</span>
<a name="l00267"></a>00267 <span class="keywordtype">bool</span> BrowserRun::allowExecution( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;serviceType, <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> &amp;url )
<a name="l00268"></a>00268 {
<a name="l00269"></a>00269     <span class="keywordflow">if</span> ( !<a class="code" href="classKParts_1_1BrowserRun.html#a0dafb092588eb3bf4a67470c51fd977d" title="BIC: Obsoleted by KRun::isExecutable( const QString &amp;serviceType );.">isExecutable</a>( serviceType ) )
<a name="l00270"></a>00270       <span class="keywordflow">return</span> <span class="keyword">true</span>;
<a name="l00271"></a>00271 
<a name="l00272"></a>00272     <span class="keywordflow">if</span> ( !url.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a942448c47652c6453f3c6ce59ae62731">isLocalFile</a>() ) <span class="comment">// Don&#39;t permit to execute remote files</span>
<a name="l00273"></a>00273         <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00274"></a>00274 
<a name="l00275"></a>00275     <span class="keywordflow">return</span> ( <a class="codeRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKMessageBox.html#ae42807cfa5b1fb5eb30e0ffee34710b9">KMessageBox::warningContinueCancel</a>( 0, i18n( <span class="stringliteral">&quot;Do you really want to execute &#39;%1&#39;? &quot;</span> ).arg( url.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a9382bc0e035124e884f755cff962530f">prettyURL</a>() ),
<a name="l00276"></a>00276     i18n(<span class="stringliteral">&quot;Execute File?&quot;</span>), i18n(<span class="stringliteral">&quot;Execute&quot;</span>) ) == KMessageBox::Continue );
<a name="l00277"></a>00277 }
<a name="l00278"></a>00278 
<a name="l00279"></a>00279 <span class="keyword">static</span> <a class="codeRef" href="qstring.html">QString</a> makeQuestion( <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a>&amp; url, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; mimeType, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; suggestedFilename )
<a name="l00280"></a>00280 {
<a name="l00281"></a>00281     <a class="codeRef" href="qstring.html">QString</a> surl = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKStringHandler.html#a5d09c657585f2b3443e5af9e8a1fbef7">KStringHandler::csqueeze</a>( url.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a9382bc0e035124e884f755cff962530f">prettyURL</a>() );
<a name="l00282"></a>00282     KMimeType::Ptr mime = KMimeType::mimeType( mimeType );
<a name="l00283"></a>00283     <a class="codeRef" href="qstring.html">QString</a> comment = mimeType;
<a name="l00284"></a>00284 
<a name="l00285"></a>00285     <span class="comment">// Test if the mimeType is not recognize as octet-stream.</span>
<a name="l00286"></a>00286     <span class="comment">// If so then keep mime-type as comment</span>
<a name="l00287"></a>00287     <span class="keywordflow">if</span> (mime-&gt;name() != KMimeType::defaultMimeType()) {
<a name="l00288"></a>00288         <span class="comment">// The mime-type is known so display the comment instead of mime-type</span>
<a name="l00289"></a>00289         comment = mime-&gt;comment();
<a name="l00290"></a>00290     }
<a name="l00291"></a>00291     <span class="comment">// The strange order in the i18n() calls below is due to the possibility</span>
<a name="l00292"></a>00292     <span class="comment">// of surl containing a &#39;%&#39;</span>
<a name="l00293"></a>00293     <span class="keywordflow">if</span> ( suggestedFilename.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() )
<a name="l00294"></a>00294         <span class="keywordflow">return</span> i18n(<span class="stringliteral">&quot;Open &#39;%2&#39;?\nType: %1&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(comment, surl);
<a name="l00295"></a>00295     <span class="keywordflow">else</span>
<a name="l00296"></a>00296         <span class="keywordflow">return</span> i18n(<span class="stringliteral">&quot;Open &#39;%3&#39;?\nName: %2\nType: %1&quot;</span>).arg(comment, suggestedFilename, surl);
<a name="l00297"></a>00297 }
<a name="l00298"></a>00298 
<a name="l00299"></a>00299 <span class="comment">//static</span>
<a name="l00300"></a><a class="code" href="classKParts_1_1BrowserRun.html#acf2a328da7456c5beff019e1bc5e626d">00300</a> BrowserRun::AskSaveResult <a class="code" href="classKParts_1_1BrowserRun.html#acf2a328da7456c5beff019e1bc5e626d" title="Ask the user whether to save or open a url in another application.">BrowserRun::askSave</a>( <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> &amp; url, KService::Ptr offer, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; mimeType, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp; suggestedFilename )
<a name="l00301"></a>00301 {
<a name="l00302"></a>00302     <span class="comment">// SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC</span>
<a name="l00303"></a>00303     <span class="comment">// NOTE: Keep this function in sync with kdebase/kcontrol/filetypes/filetypedetails.cpp</span>
<a name="l00304"></a>00304     <span class="comment">//       FileTypeDetails::updateAskSave()</span>
<a name="l00305"></a>00305 
<a name="l00306"></a>00306     <a class="codeRef" href="qstring.html">QString</a> question = makeQuestion( url, mimeType, suggestedFilename );
<a name="l00307"></a>00307 
<a name="l00308"></a>00308     <span class="comment">// Text used for the open button</span>
<a name="l00309"></a>00309     <a class="codeRef" href="qstring.html">QString</a> openText = (offer &amp;&amp; !offer-&gt;name().isEmpty())
<a name="l00310"></a>00310                        ? i18n(<span class="stringliteral">&quot;&amp;Open with &#39;%1&#39;&quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(offer-&gt;name())
<a name="l00311"></a>00311                        : i18n(<span class="stringliteral">&quot;&amp;Open With...&quot;</span>);
<a name="l00312"></a>00312 
<a name="l00313"></a>00313     <span class="keywordtype">int</span> choice = <a class="codeRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKMessageBox.html#a34291f64cd9fb1beef9087f42a5cc50c">KMessageBox::questionYesNoCancel</a>(
<a name="l00314"></a>00314         0L, question, url.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#adf3ad35581a0ca25ecc16e073f8275ca">host</a>(),
<a name="l00315"></a>00315         <a class="codeRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKStdGuiItem.html#a6a148eded293f0efb51a561937ee3c17">KStdGuiItem::saveAs</a>(), openText,
<a name="l00316"></a>00316         <a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;askSave&quot;</span>)+ mimeType ); <span class="comment">// dontAskAgainName, KEEP IN SYNC!!!</span>
<a name="l00317"></a>00317 
<a name="l00318"></a>00318     <span class="keywordflow">return</span> choice == KMessageBox::Yes ? Save : ( choice == KMessageBox::No ? Open : Cancel );
<a name="l00319"></a>00319     <span class="comment">// SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC</span>
<a name="l00320"></a>00320 }
<a name="l00321"></a>00321 
<a name="l00322"></a>00322 <span class="comment">//static</span>
<a name="l00323"></a><a class="code" href="classKParts_1_1BrowserRun.html#abb2d7b2f0ab31602a953cd9de671a3b4">00323</a> BrowserRun::AskSaveResult <a class="code" href="classKParts_1_1BrowserRun.html#abb2d7b2f0ab31602a953cd9de671a3b4" title="Similar to askSave() but for the case where the current application is able to embed the url itself (...">BrowserRun::askEmbedOrSave</a>( <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> &amp; url, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; mimeType, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp; suggestedFilename, <span class="keywordtype">int</span> flags )
<a name="l00324"></a>00324 {
<a name="l00325"></a>00325     <span class="comment">// SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC</span>
<a name="l00326"></a>00326     <span class="comment">// NOTE: Keep this funcion in sync with kdebase/kcontrol/filetypes/filetypedetails.cpp</span>
<a name="l00327"></a>00327     <span class="comment">//       FileTypeDetails::updateAskSave()</span>
<a name="l00328"></a>00328 
<a name="l00329"></a>00329     KMimeType::Ptr mime = KMimeType::mimeType( mimeType );
<a name="l00330"></a>00330     <span class="comment">// Don&#39;t ask for:</span>
<a name="l00331"></a>00331     <span class="comment">// - html (even new tabs would ask, due to about:blank!)</span>
<a name="l00332"></a>00332     <span class="comment">// - dirs obviously (though not common over HTTP :),</span>
<a name="l00333"></a>00333     <span class="comment">// - images (reasoning: no need to save, most of the time, because fast to see)</span>
<a name="l00334"></a>00334     <span class="comment">// e.g. postscript is different, because takes longer to read, so</span>
<a name="l00335"></a>00335     <span class="comment">// it&#39;s more likely that the user might want to save it.</span>
<a name="l00336"></a>00336     <span class="comment">// - multipart/* (&quot;server push&quot;, see kmultipart)</span>
<a name="l00337"></a>00337     <span class="comment">// - other strange &#39;internal&#39; mimetypes like print/manager...</span>
<a name="l00338"></a>00338     <span class="comment">// KEEP IN SYNC!!!</span>
<a name="l00339"></a>00339     <span class="keywordflow">if</span> (flags != (<span class="keywordtype">int</span>)AttachmentDisposition &amp;&amp; (
<a name="l00340"></a>00340          mime-&gt;is( <span class="stringliteral">&quot;text/html&quot;</span> ) ||
<a name="l00341"></a>00341          mime-&gt;is( <span class="stringliteral">&quot;text/xml&quot;</span> ) ||
<a name="l00342"></a>00342          mime-&gt;is( <span class="stringliteral">&quot;inode/directory&quot;</span> ) ||
<a name="l00343"></a>00343          mimeType.<a class="codeRef" href="qstring.html#startsWith">startsWith</a>( <span class="stringliteral">&quot;image&quot;</span> ) ||
<a name="l00344"></a>00344          mime-&gt;is( <span class="stringliteral">&quot;multipart/x-mixed-replace&quot;</span> ) ||
<a name="l00345"></a>00345          mime-&gt;is( <span class="stringliteral">&quot;multipart/replace&quot;</span> ) ||
<a name="l00346"></a>00346          mimeType.<a class="codeRef" href="qstring.html#startsWith">startsWith</a>( <span class="stringliteral">&quot;print&quot;</span> ) ) )
<a name="l00347"></a>00347         <span class="keywordflow">return</span> Open;
<a name="l00348"></a>00348 
<a name="l00349"></a>00349     <a class="codeRef" href="qstring.html">QString</a> question = makeQuestion( url, mimeType, suggestedFilename );
<a name="l00350"></a>00350 
<a name="l00351"></a>00351     <span class="keywordtype">int</span> choice = <a class="codeRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKMessageBox.html#a34291f64cd9fb1beef9087f42a5cc50c">KMessageBox::questionYesNoCancel</a>(
<a name="l00352"></a>00352         0L, question, url.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#adf3ad35581a0ca25ecc16e073f8275ca">host</a>(),
<a name="l00353"></a>00353         <a class="codeRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKStdGuiItem.html#a6a148eded293f0efb51a561937ee3c17">KStdGuiItem::saveAs</a>(), <a class="codeRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKGuiItem.html">KGuiItem</a>( i18n( <span class="stringliteral">&quot;&amp;Open&quot;</span> ), <span class="stringliteral">&quot;fileopen&quot;</span>),
<a name="l00354"></a>00354         <a class="codeRef" href="qstring.html#fromLatin1">QString::fromLatin1</a>(<span class="stringliteral">&quot;askEmbedOrSave&quot;</span>)+ mimeType ); <span class="comment">// dontAskAgainName, KEEP IN SYNC!!!</span>
<a name="l00355"></a>00355     <span class="keywordflow">return</span> choice == KMessageBox::Yes ? Save : ( choice == KMessageBox::No ? Open : Cancel );
<a name="l00356"></a>00356     <span class="comment">// SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC SYNC</span>
<a name="l00357"></a>00357 }
<a name="l00358"></a>00358 
<a name="l00359"></a>00359 <span class="comment">// Default implementation, overridden in KHTMLRun</span>
<a name="l00360"></a>00360 <span class="keywordtype">void</span> BrowserRun::save( <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> &amp; url, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp; suggestedFilename )
<a name="l00361"></a>00361 {
<a name="l00362"></a>00362     simpleSave( url, suggestedFilename, m_window );
<a name="l00363"></a>00363 }
<a name="l00364"></a>00364 
<a name="l00365"></a>00365 <span class="comment">// static</span>
<a name="l00366"></a><a class="code" href="classKParts_1_1BrowserRun.html#a6355ddee623de36aa7afe782550f0cf4">00366</a> <span class="keywordtype">void</span> BrowserRun::simpleSave( <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> &amp; url, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp; suggestedFilename )
<a name="l00367"></a>00367 {
<a name="l00368"></a>00368     simpleSave (url, suggestedFilename, 0);
<a name="l00369"></a>00369 }
<a name="l00370"></a>00370 
<a name="l00371"></a>00371 <span class="keywordtype">void</span> BrowserRun::simpleSave( <span class="keyword">const</span> <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> &amp; url, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp; suggestedFilename,
<a name="l00372"></a>00372                              <a class="codeRef" href="qwidget.html">QWidget</a>* window )
<a name="l00373"></a>00373 {
<a name="l00374"></a>00374     <span class="comment">// DownloadManager &lt;-&gt; konqueror integration</span>
<a name="l00375"></a>00375     <span class="comment">// find if the integration is enabled</span>
<a name="l00376"></a>00376     <span class="comment">// the empty key  means no integration</span>
<a name="l00377"></a>00377     <span class="comment">// only use the downloadmanager for non-local urls</span>
<a name="l00378"></a>00378     <span class="keywordflow">if</span> ( !url.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a942448c47652c6453f3c6ce59ae62731">isLocalFile</a>() )
<a name="l00379"></a>00379     {
<a name="l00380"></a>00380         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKConfig.html">KConfig</a> cfg(<span class="stringliteral">&quot;konquerorrc&quot;</span>, <span class="keyword">false</span>, <span class="keyword">false</span>);
<a name="l00381"></a>00381         cfg.setGroup(<span class="stringliteral">&quot;HTML Settings&quot;</span>);
<a name="l00382"></a>00382         <a class="codeRef" href="qstring.html">QString</a> downloadManger = cfg.readPathEntry(<span class="stringliteral">&quot;DownloadManager&quot;</span>);
<a name="l00383"></a>00383         <span class="keywordflow">if</span> (!downloadManger.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>())
<a name="l00384"></a>00384         {
<a name="l00385"></a>00385             <span class="comment">// then find the download manager location</span>
<a name="l00386"></a>00386             <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;Using: &quot;</span>&lt;&lt;downloadManger &lt;&lt;<span class="stringliteral">&quot; as Download Manager&quot;</span> &lt;&lt;<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00387"></a>00387             <a class="codeRef" href="qstring.html">QString</a> cmd=<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKStandardDirs.html#acff5cb412926a454bcacc6849a4b4a7c">KStandardDirs::findExe</a>(downloadManger);
<a name="l00388"></a>00388             <span class="keywordflow">if</span> (cmd.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>())
<a name="l00389"></a>00389             {
<a name="l00390"></a>00390                 <a class="codeRef" href="qstring.html">QString</a> errMsg=i18n(<span class="stringliteral">&quot;The Download Manager (%1) could not be found in your $PATH &quot;</span>).<a class="codeRef" href="qstring.html#arg">arg</a>(downloadManger);
<a name="l00391"></a>00391                 <a class="codeRef" href="qstring.html">QString</a> errMsgEx= i18n(<span class="stringliteral">&quot;Try to reinstall it  \n\nThe integration with Konqueror will be disabled!&quot;</span>);
<a name="l00392"></a>00392                 <a class="codeRef" doxygen="kdeui.tag:../../kdeui/html/" href="../../kdeui/html/classKMessageBox.html#a534a405722c2b1130a185a70bc409698">KMessageBox::detailedSorry</a>(0,errMsg,errMsgEx);
<a name="l00393"></a>00393                 cfg.writePathEntry(<span class="stringliteral">&quot;DownloadManager&quot;</span>,QString::null);
<a name="l00394"></a>00394                 cfg.sync ();
<a name="l00395"></a>00395             }
<a name="l00396"></a>00396             <span class="keywordflow">else</span>
<a name="l00397"></a>00397             {
<a name="l00398"></a>00398                 <span class="comment">// ### suggestedFilename not taken into account. Fix this (and</span>
<a name="l00399"></a>00399                 <span class="comment">// the duplicated code) with shiny new KDownload class for 3.2 (pfeiffer)</span>
<a name="l00400"></a>00400                 <span class="comment">// Until the shiny new class comes about, send the suggestedFilename</span>
<a name="l00401"></a>00401                 <span class="comment">// along with the actual URL to download. (DA)</span>
<a name="l00402"></a>00402                 cmd += <span class="stringliteral">&quot; &quot;</span> + <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKProcess.html#a1ce049f3abcc805d6e5d44988451d32a">KProcess::quote</a>(url.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#aaf8593b924647a9db73016fbeab1812a">url</a>());
<a name="l00403"></a>00403                 <span class="keywordflow">if</span> ( !suggestedFilename.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() )
<a name="l00404"></a>00404                     cmd +=<span class="stringliteral">&quot; &quot;</span> + <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKProcess.html#a1ce049f3abcc805d6e5d44988451d32a">KProcess::quote</a>(suggestedFilename);
<a name="l00405"></a>00405 
<a name="l00406"></a>00406                 <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;Calling command  &quot;</span> &lt;&lt; cmd &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00407"></a>00407                 <span class="comment">// slave is already on hold (slotBrowserMimetype())</span>
<a name="l00408"></a>00408                 KIO::Scheduler::publishSlaveOnHold();
<a name="l00409"></a>00409                 KRun::runCommand(cmd);
<a name="l00410"></a>00410                 <span class="keywordflow">return</span>;
<a name="l00411"></a>00411             }
<a name="l00412"></a>00412         }
<a name="l00413"></a>00413     }
<a name="l00414"></a>00414 
<a name="l00415"></a>00415     <span class="comment">// no download manager available, let&#39;s do it ourself</span>
<a name="l00416"></a>00416     KFileDialog *dlg = <span class="keyword">new</span> KFileDialog( QString::null, QString::null <span class="comment">/*all files*/</span>,
<a name="l00417"></a>00417                                         window , <span class="stringliteral">&quot;filedialog&quot;</span>, <span class="keyword">true</span> );
<a name="l00418"></a>00418     dlg-&gt;setOperationMode( KFileDialog::Saving );
<a name="l00419"></a>00419     dlg-&gt;setCaption(i18n(<span class="stringliteral">&quot;Save As&quot;</span>));
<a name="l00420"></a>00420 
<a name="l00421"></a>00421     dlg-&gt;setSelection( suggestedFilename.<a class="codeRef" href="qstring.html#isEmpty">isEmpty</a>() ? url.<a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a0634d0fc02c9883ca164966b4764a692">fileName</a>() : <a class="code" href="classKParts_1_1BrowserRun.html#a51124ba9631ad99b54dd7780e0818c30">suggestedFilename</a> );
<a name="l00422"></a>00422     <span class="keywordflow">if</span> ( dlg-&gt;exec() )
<a name="l00423"></a>00423     {
<a name="l00424"></a>00424         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> destURL( dlg-&gt;selectedURL() );
<a name="l00425"></a>00425         <span class="keywordflow">if</span> ( destURL.isValid() )
<a name="l00426"></a>00426         {
<a name="l00427"></a>00427             KIO::Job *job = KIO::copy( url, destURL );
<a name="l00428"></a>00428             job-&gt;setWindow (window);
<a name="l00429"></a>00429             job-&gt;setAutoErrorHandlingEnabled( <span class="keyword">true</span> );
<a name="l00430"></a>00430         }
<a name="l00431"></a>00431     }
<a name="l00432"></a>00432     <span class="keyword">delete</span> dlg;
<a name="l00433"></a>00433 }
<a name="l00434"></a>00434 
<a name="l00435"></a>00435 <span class="keywordtype">void</span> BrowserRun::slotStatResult( KIO::Job *job )
<a name="l00436"></a>00436 {
<a name="l00437"></a>00437     <span class="keywordflow">if</span> ( job-&gt;error() ) {
<a name="l00438"></a>00438         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#gafbb9aa4a84d6c0563d46550454b9714b">kdDebug</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun::slotStatResult : &quot;</span> &lt;&lt; job-&gt;errorString() &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00439"></a>00439         <a class="code" href="classKParts_1_1BrowserRun.html#a8cb5f34d1c92111e70768ac269b17e0b" title="Called when an error happens.">handleError</a>( job );
<a name="l00440"></a>00440     } <span class="keywordflow">else</span>
<a name="l00441"></a>00441         KRun::slotStatResult( job );
<a name="l00442"></a>00442 }
<a name="l00443"></a>00443 
<a name="l00444"></a><a class="code" href="classKParts_1_1BrowserRun.html#a8cb5f34d1c92111e70768ac269b17e0b">00444</a> <span class="keywordtype">void</span> <a class="code" href="classKParts_1_1BrowserRun.html#a8cb5f34d1c92111e70768ac269b17e0b" title="Called when an error happens.">BrowserRun::handleError</a>( KIO::Job * job )
<a name="l00445"></a>00445 {
<a name="l00446"></a>00446     <span class="keywordflow">if</span> ( !job ) { <span class="comment">// Shouldn&#39;t happen, see docu.</span>
<a name="l00447"></a>00447         <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga9acd682001598171edf8ecb104fdad2b">kdWarning</a>(1000) &lt;&lt; <span class="stringliteral">&quot;BrowserRun::handleError called with job=0! hideErrorDialog=&quot;</span> &lt;&lt; d-&gt;m_bHideErrorDialog &lt;&lt; <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/group__kdebug.html#ga313d520ed8f8f6b46eeef22cfb3b082a">endl</a>;
<a name="l00448"></a>00448         <span class="keywordflow">return</span>;
<a name="l00449"></a>00449     }
<a name="l00450"></a>00450 
<a name="l00451"></a>00451     <span class="keywordflow">if</span> (d-&gt;m_bHideErrorDialog &amp;&amp; job-&gt;error() != KIO::ERR_NO_CONTENT)
<a name="l00452"></a>00452     {
<a name="l00453"></a>00453         redirectToError( job-&gt;error(), job-&gt;errorText() );
<a name="l00454"></a>00454         <span class="keywordflow">return</span>;
<a name="l00455"></a>00455     }
<a name="l00456"></a>00456 
<a name="l00457"></a>00457     <span class="comment">// Reuse code in KRun, to benefit from d-&gt;m_showingError etc.</span>
<a name="l00458"></a>00458     KRun::slotStatResult( job );
<a name="l00459"></a>00459 }
<a name="l00460"></a>00460 
<a name="l00461"></a>00461 <span class="keywordtype">void</span> BrowserRun::redirectToError( <span class="keywordtype">int</span> error, <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a>&amp; errorText )
<a name="l00462"></a>00462 {
<a name="l00473"></a>00473     <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html">KURL</a> newURL(<a class="codeRef" href="qstring.html">QString</a>(<span class="stringliteral">&quot;error:/?error=%1&amp;errText=%2&quot;</span>)
<a name="l00474"></a>00474                 .arg( error ).arg( <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a5a12896c25a17ab12abf2097a7c75713">KURL::encode_string</a>(errorText) ), 106 );
<a name="l00475"></a>00475     m_strURL.setPass( QString::null ); <span class="comment">// don&#39;t put the password in the error URL</span>
<a name="l00476"></a>00476 
<a name="l00477"></a>00477     <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL_1_1List.html">KURL::List</a> lst;
<a name="l00478"></a>00478     lst &lt;&lt; newURL &lt;&lt; m_strURL;
<a name="l00479"></a>00479     m_strURL = <a class="codeRef" doxygen="kdecore.tag:../../kdecore/html/" href="../../kdecore/html/classKURL.html#a95df01647f7ddf97be8c3ab018fd1f36">KURL::join</a>( lst );
<a name="l00480"></a>00480     <span class="comment">//kdDebug(1202) &lt;&lt; &quot;BrowserRun::handleError m_strURL=&quot; &lt;&lt; m_strURL.prettyURL() &lt;&lt; endl;</span>
<a name="l00481"></a>00481 
<a name="l00482"></a>00482     m_job = 0;
<a name="l00483"></a>00483     foundMimeType( <span class="stringliteral">&quot;text/html&quot;</span> );
<a name="l00484"></a>00484 }
<a name="l00485"></a>00485 
<a name="l00486"></a>00486 <span class="keywordtype">void</span> BrowserRun::slotCopyToTempFileResult(KIO::Job *job)
<a name="l00487"></a>00487 {
<a name="l00488"></a>00488     <span class="keywordflow">if</span> ( job-&gt;error() ) {
<a name="l00489"></a>00489         job-&gt;showErrorDialog( m_window );
<a name="l00490"></a>00490     } <span class="keywordflow">else</span> {
<a name="l00491"></a>00491         <span class="comment">// Same as KRun::foundMimeType but with a different URL</span>
<a name="l00492"></a>00492         (void) (KRun::runURL( static_cast&lt;KIO::FileCopyJob *&gt;(job)-&gt;destURL(), m_sMimeType ));
<a name="l00493"></a>00493     }
<a name="l00494"></a>00494     m_bFault = <span class="keyword">true</span>; <span class="comment">// see above</span>
<a name="l00495"></a>00495     m_bFinished = <span class="keyword">true</span>;
<a name="l00496"></a>00496     m_timer.start( 0, <span class="keyword">true</span> );
<a name="l00497"></a>00497 }
<a name="l00498"></a>00498 
<a name="l00499"></a>00499 <span class="keywordtype">bool</span> BrowserRun::isTextExecutable( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;serviceType )
<a name="l00500"></a>00500 {
<a name="l00501"></a>00501     <span class="keywordflow">return</span> ( serviceType == <span class="stringliteral">&quot;application/x-desktop&quot;</span> ||
<a name="l00502"></a>00502              serviceType == <span class="stringliteral">&quot;application/x-shellscript&quot;</span> );
<a name="l00503"></a>00503 }
<a name="l00504"></a>00504 
<a name="l00505"></a><a class="code" href="classKParts_1_1BrowserRun.html#a0dafb092588eb3bf4a67470c51fd977d">00505</a> <span class="keywordtype">bool</span> <a class="code" href="classKParts_1_1BrowserRun.html#a0dafb092588eb3bf4a67470c51fd977d" title="BIC: Obsoleted by KRun::isExecutable( const QString &amp;serviceType );.">BrowserRun::isExecutable</a>( <span class="keyword">const</span> <a class="codeRef" href="qstring.html">QString</a> &amp;serviceType )
<a name="l00506"></a>00506 {
<a name="l00507"></a>00507     <span class="keywordflow">return</span> <a class="code" href="classKParts_1_1BrowserRun.html#a0dafb092588eb3bf4a67470c51fd977d" title="BIC: Obsoleted by KRun::isExecutable( const QString &amp;serviceType );.">KRun::isExecutable</a>( serviceType );
<a name="l00508"></a>00508 }
<a name="l00509"></a>00509 
<a name="l00510"></a><a class="code" href="classKParts_1_1BrowserRun.html#aa12658e1ed02cdcca9943dc2eb457403">00510</a> <span class="keywordtype">bool</span> <a class="code" href="classKParts_1_1BrowserRun.html#aa12658e1ed02cdcca9943dc2eb457403">BrowserRun::hideErrorDialog</a>()<span class="keyword"> const</span>
<a name="l00511"></a>00511 <span class="keyword"></span>{
<a name="l00512"></a>00512     <span class="keywordflow">return</span> d-&gt;m_bHideErrorDialog;
<a name="l00513"></a>00513 }
<a name="l00514"></a>00514 
<a name="l00515"></a><a class="code" href="classKParts_1_1BrowserRun.html#a2e9f4b81983a433daea8e7464df11f54">00515</a> <a class="codeRef" href="qstring.html">QString</a> <a class="code" href="classKParts_1_1BrowserRun.html#a2e9f4b81983a433daea8e7464df11f54">BrowserRun::contentDisposition</a>()<span class="keyword"> const </span>{
<a name="l00516"></a>00516     <span class="keywordflow">return</span> d-&gt;contentDisposition;
<a name="l00517"></a>00517 }
<a name="l00518"></a>00518 
<a name="l00519"></a>00519 <span class="preprocessor">#include &quot;browserrun.moc&quot;</span>
</pre></div></div>
</div>
    </div></div>


      </td>
  </tr>
  <tr>
    <td valign="top" id="leftmenu" width="25%">
      <a name="navigation"></a>
      <div class="menu_box"><h2>kparts</h2>
<div class="nav_list">
<ul><li><a href="index.html">Main Page</a></li><li><a href="namespaces.html">Namespace List</a></li><li><a href="hierarchy.html">Class Hierarchy</a></li><li><a href="classes.html">Alphabetical List</a></li><li><a href="annotated.html">Class List</a></li><li><a href="files.html">File List</a></li><li><a href="namespacemembers.html">Namespace Members</a></li><li><a href="functions.html">Class Members</a></li></ul>
<!--
<h2>Class Picker</h2>
<div style="text-align: center;">
<form name="guideform">
<select name="guidelinks" style="width:100%;" onChange="window.location=document.guideform.guidelinks.options[document.guideform.guidelinks.selectedIndex].value">
<option value="annotated.html">-- Choose --</option>
  <option value="classKParts_1_1BrowserExtension.html">kparts::browserextension</option>,  <option value="classKParts_1_1BrowserHostExtension.html">kparts::browserhostextension</option>,  <option value="classKParts_1_1BrowserInterface.html">kparts::browserinterface</option>,  <option value="classKParts_1_1BrowserRun.html">kparts::browserrun</option>,  <option value="classKParts_1_1DockMainWindow.html">kparts::dockmainwindow</option>,  <option value="classKParts_1_1Event.html">kparts::event</option>,  <option value="classKParts_1_1Factory.html">kparts::factory</option>,  <option value="classKParts_1_1GenericFactory.html">kparts::genericfactory</option>,  <option value="classKParts_1_1GUIActivateEvent.html">kparts::guiactivateevent</option>,  <option value="classKParts_1_1HistoryProvider.html">kparts::historyprovider</option>,  <option value="classKParts_1_1LiveConnectExtension.html">kparts::liveconnectextension</option>,  <option value="classKParts_1_1MainWindow.html">kparts::mainwindow</option>,  <option value="classKParts_1_1OpenURLEvent.html">kparts::openurlevent</option>,  <option value="classKParts_1_1Part.html">kparts::part</option>,  <option value="classKParts_1_1PartActivateEvent.html">kparts::partactivateevent</option>,  <option value="classKParts_1_1PartBase.html">kparts::partbase</option>,  <option value="classKParts_1_1PartManager.html">kparts::partmanager</option>,  <option value="classKParts_1_1PartSelectEvent.html">kparts::partselectevent</option>,  <option value="classKParts_1_1Plugin.html">kparts::plugin</option>,  <option value="classKParts_1_1ReadOnlyPart.html">kparts::readonlypart</option>,  <option value="classKParts_1_1ReadWritePart.html">kparts::readwritepart</option>,  <option value="classKParts_1_1StatusBarExtension.html">kparts::statusbarextension</option>,
</select>
</form>
</div>
-->
</div></div>
<div class="menu_box"><h2>API Dox</h2>
<div class="nav_list">
<ul>
<li><a href="../../arts/html/index.html">arts</a></li><li><a href="../../dcop/html/index.html">dcop</a></li><li><a href="../../dnssd/html/index.html">dnssd</a></li><li><a href="../../interfaces/html/index.html">interfaces</a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../interfaces/kimproxy/interface/html/index.html">interface</a></li><li>&nbsp;&nbsp;&nbsp;&nbsp;<a href="../../interfaces/kimproxy/library/html/index.html">library</a></li><li>&nbsp;&nbsp;<a href="../../interfaces/kspeech/html/index.html">kspeech</a></li><li>&nbsp;&nbsp;<a href="../../interfaces/ktexteditor/html/index.html">ktexteditor</a></li><li><a href="../../kabc/html/index.html">kabc</a></li><li><a href="../../kate/html/index.html">kate</a></li><li><a href="../../kcmshell/html/index.html">kcmshell</a></li><li><a href="../../kdecore/html/index.html">kdecore</a></li><li><a href="../../kded/html/index.html">kded</a></li><li><a href="../../kdefx/html/index.html">kdefx</a></li><li><a href="../../kdeprint/html/index.html">kdeprint</a></li><li><a href="../../kdesu/html/index.html">kdesu</a></li><li><a href="../../kdeui/html/index.html">kdeui</a></li><li><a href="../../kdoctools/html/index.html">kdoctools</a></li><li><a href="../../khtml/html/index.html">khtml</a></li><li><a href="../../kimgio/html/index.html">kimgio</a></li><li><a href="../../kinit/html/index.html">kinit</a></li><li><a href="../../kio/html/index.html">kio</a></li><li>&nbsp;&nbsp;<a href="../../kio/bookmarks/html/index.html">bookmarks</a></li><li>&nbsp;&nbsp;<a href="../../kio/httpfilter/html/index.html">httpfilter</a></li><li>&nbsp;&nbsp;<a href="../../kio/kfile/html/index.html">kfile</a></li><li>&nbsp;&nbsp;<a href="../../kio/kio/html/index.html">kio</a></li><li>&nbsp;&nbsp;<a href="../../kio/kioexec/html/index.html">kioexec</a></li><li>&nbsp;&nbsp;<a href="../../kio/kpasswdserver/html/index.html">kpasswdserver</a></li><li>&nbsp;&nbsp;<a href="../../kio/kssl/html/index.html">kssl</a></li><li><a href="../../kioslave/html/index.html">kioslave</a></li><li>&nbsp;&nbsp;<a href="../../kioslave/http/html/index.html">http</a></li><li><a href="../../kjs/html/index.html">kjs</a></li><li><a href="../../kmdi/html/index.html">kmdi</a></li><li>&nbsp;&nbsp;<a href="../../kmdi/kmdi/html/index.html">kmdi</a></li><li><a href="../../knewstuff/html/index.html">knewstuff</a></li><li><a href="../../kparts/html/index.html">kparts</a></li><li><a href="../../kresources/html/index.html">kresources</a></li><li><a href="../../kspell2/html/index.html">kspell2</a></li><li><a href="../../kunittest/html/index.html">kunittest</a></li><li><a href="../../kutils/html/index.html">kutils</a></li><li><a href="../../kwallet/html/index.html">kwallet</a></li><li><a href="../../libkmid/html/index.html">libkmid</a></li><li><a href="../../libkscreensaver/html/index.html">libkscreensaver</a></li>
</ul></div></div>


        </td>
</tr>
</table>

<span class="doNotDisplay">
  <a href="http://www.kde.org/" accesskey="8">KDE Home</a> |
  <a href="http://accessibility.kde.org/" accesskey="9">KDE Accessibility Home</a> |
  <a href="http://www.kde.org/media/accesskeys.php" accesskey="0">Description of Access Keys</a>
</span>


<div style="height: 8px"></div>

<div id="footer">
  <div id="footer_left">
    Maintained by <a href="&#109;&#97;&#105;&#108;&#116;&#111;&#58;groo&#116;&#64;kde&#46;or&#x67;">Adriaan de Groot</a>
and
<a href="&#109;a&#105;&#108;&#116;&#111;&#58;w&#105;nter&#64;kde&#46;or&#x67">Allen Winter</a>.
<br/>
    KDE and K Desktop Environment are trademarks of <a href="http://www.kde.org/areas/kde-ev/" title="Homepage of the KDE non-profit Organization">KDE e.V.</a> |
    <a href="http://www.kde.org/contact/impressum.php">Legal</a>
  </div>
  <div id="footer_right"><img src="/media/images/footer_right.png" style="margin: 0px" alt="" /></div>
</div>

<!--
WARNING: DO NOT SEND MAIL TO THE FOLLOWING EMAIL ADDRESS! YOU WILL
BE BLOCKED INSTANTLY AND PERMANENTLY!
<a href="mailto:aaaatrap-425acc3b5374943f@kde.org">Block me</a>
WARNING END
-->

</body>
</html>