khtml_run.cpp
来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· C++ 代码 · 共 80 行
CPP
80 行
/* This file is part of the KDE project * * Copyright (C) 1998, 1999 Torben Weis <weis@kde.org> * 1999 Lars Knoll <knoll@kde.org> * 1999 Antti Koivisto <koivisto@kde.org> * 2000 Simon Hausmann <hausmann@kde.org> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public License * along with this library; see the file COPYING.LIB. If not, write to * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, * Boston, MA 02110-1301, USA. */#include "khtml_run.h"#include "khtml_part.h"#include <kio/job.h>#include <kdebug.h>KHTMLRun::KHTMLRun( KHTMLPart *part, khtml::ChildFrame *child, const KURL &url, const KParts::URLArgs &args, bool hideErrorDialog ): KRun( url, 0, false, false /* No GUI */ ), m_part( part ), m_args( args ), m_child( child ), m_hideErrorDialog( hideErrorDialog ){ part->started(0);}void KHTMLRun::foundMimeType( const QString &_type ){ Q_ASSERT(!m_bFinished); QString mimeType = _type; // this ref comes from the job, we lose it when using KIO again if ( static_cast<KHTMLPart *>(m_part)->processObjectRequest( m_child, m_strURL, mimeType ) ) m_bFinished = true; else { return; } if ( m_bFinished ) { m_timer.start( 0, true ); return; } //kdDebug(6050) << "KHTMLRun::foundMimeType " << _type << " couldn't open" << endl; KRun::foundMimeType( mimeType );}void KHTMLRun::slotJobResult( KIO::Job *job ){ kdDebug() << k_funcinfo << "called with job = " << job << endl; if ( job->error() && m_hideErrorDialog ) { handleError( job ); delete this; // this is extremely evil and relies on only one slot // connected to the signal. uhoh :) } else KRun::slotJobResult( job ); }void KHTMLRun::handleError( KIO::Job *job ){ if ( !job ) { kdDebug() << k_funcinfo << "null job!" << endl; return; } else { m_part->processObjectRequest( m_child, KURL(), QString::null ); }}#include "khtml_run.moc"
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?