khtml_no_find_3.4.patch

来自「konqueror3 embedded版本, KDE环境下的当家浏览器的嵌入式版」· PATCH 代码 · 共 299 行

PATCH
299
字号
--- /home/lmonta/kde/kdelibs-34/khtml/khtml_part.cpp	2005-02-27 12:27:51.000000000 +0100+++ khtml_part.cpp	2005-03-01 15:53:33.566730993 +0100@@ -267,6 +269,7 @@ void KHTMLPart::init( KHTMLView *view, G   d->m_paDebugDOMTree = new KAction( i18n( "Print DOM Tree to STDOUT" ), 0, this, SLOT( slotDebugDOMTree() ), actionCollection(), "debugDOMTree" );   d->m_paStopAnimations = new KAction( i18n( "Stop Animated Images" ), 0, this, SLOT( slotStopAnimations() ), actionCollection(), "stopAnimations" ); +#ifndef KONQ_EMBEDDED   d->m_paSetEncoding = new KActionMenu( i18n( "Set &Encoding" ), "charset", actionCollection(), "setEncoding" );   d->m_paSetEncoding->setDelayed( false ); @@ -300,6 +303,7 @@ void KHTMLPart::init( KHTMLView *view, G   d->m_manualDetection->setItems( encodings );   d->m_manualDetection->setCurrentItem( -1 );   d->m_paSetEncoding->insert( d->m_manualDetection );+#endif     KConfig *config = KGlobal::config();@@ -343,8 +347,10 @@ void KHTMLPart::init( KHTMLView *view, G       language = khtml::Decoder::SemiautomaticDetection;      int _id = config->readNumEntry( "AutomaticDetectionLanguage", language );+#ifndef KONQ_EMBEDDED     d->m_automaticDetection->setItemChecked( _id, true );     d->m_paSetEncoding->popupMenu()->setItemChecked( 0, true );+#endif      d->m_autoDetectLanguage = static_cast< khtml::Decoder::AutoDetectLanguage >( _id );   }@@ -734,6 +740,7 @@ bool KHTMLPart::openURL( const KURL &url    d->m_jobspeed = 0; +#ifndef KONQ_EMBEDDED   // If this was an explicit reload and the user style sheet should be used,   // do a stat to see whether the stylesheet was changed in the meanwhile.   if ( args.reload && !settings()->userStyleSheet().isEmpty() ) {@@ -742,6 +749,7 @@ bool KHTMLPart::openURL( const KURL &url     connect( job, SIGNAL( result( KIO::Job * ) ),              this, SLOT( slotUserSheetStatDone( KIO::Job * ) ) );   }+#endif // KONQ_EMBEDDED   emit started( 0L );    return true;@@ -1044,6 +1052,7 @@ QVariant KHTMLPart::crossFrameExecuteScr //#define KJS_VERBOSE  KJSErrorDlg *KHTMLPart::jsErrorExtension() {+#ifndef KONQ_EMBEDDED   if (!d->m_settings->jsErrorsEnabled()) {     return 0L;   }@@ -1072,9 +1081,13 @@ KJSErrorDlg *KHTMLPart::jsErrorExtension     }   }   return d->m_jsedlg;+#else // KONQ_EMBEDDED+  return 0;+#endif }  void KHTMLPart::removeJSErrorExtension() {+#ifndef KONQ_EMBEDDED   if (parentPart()) {     parentPart()->removeJSErrorExtension();     return;@@ -1086,9 +1099,11 @@ void KHTMLPart::removeJSErrorExtension()   }   delete d->m_jsedlg;   d->m_jsedlg = 0;+#endif // KONQ_EMBEDDED }  void KHTMLPart::disableJSErrorExtension() {+#ifndef KONQ_EMBEDDED   removeJSErrorExtension();   // These two lines are really kind of hacky, and it sucks to do this inside   // KHTML but I don't know of anything that's reasonably easy as an alternative@@ -1096,6 +1111,7 @@ void KHTMLPart::disableJSErrorExtension(   // contact all running "KHTML" instance as opposed to Konqueror instances too.   d->m_settings->setJSErrorsEnabled(false);   DCOPClient::mainClient()->send("konqueror*", "KonquerorIface", "reparseConfiguration()", QByteArray());+#endif // KONQ_EMBEDDED }  void KHTMLPart::jsErrorDialogContextMenu() {@@ -1491,6 +1507,7 @@ void KHTMLPart::slotInfoMessage(KIO::Job  void KHTMLPart::setPageSecurity( PageSecurity sec ) {+#ifndef KONQ_EMBEDDED   emit d->m_extension->setPageSecurity( sec );   if ( sec != NotCrypted && !d->m_statusBarIconLabel && !parentPart() ) {     d->m_statusBarIconLabel = new KURLLabel( d->m_statusBarExtension->statusBar() );@@ -1530,6 +1547,7 @@ void KHTMLPart::setPageSecurity( PageSec   d->m_paSecurity->setIcon( iconName );   if ( d->m_statusBarIconLabel )     d->m_statusBarIconLabel->setPixmap( SmallIcon( iconName, instance() ) );+#endif // KONQ_EMBEDDED }  void KHTMLPart::slotData( KIO::Job* kio_job, const QByteArray &data )@@ -2108,6 +2126,7 @@ void KHTMLPart::slotJobDone( KIO::Job* /  void KHTMLPart::slotUserSheetStatDone( KIO::Job *_job ) {+#ifndef KONQ_EMBEDDED   using namespace KIO;    if ( _job->error() ) {@@ -2135,6 +2154,7 @@ void KHTMLPart::slotUserSheetStatDone( K   }    setUserStyleSheet( KURL( settings()->userStyleSheet() ) );+#endif //KONQ_EMBEDDED }  void KHTMLPart::checkCompleted()@@ -2858,14 +2878,17 @@ void KHTMLPart::slotFindDone()  void KHTMLPart::slotFindDialogDestroyed() {+#ifndef KONQ_EMBEDDED   d->m_lastFindState.options = d->m_findDialog->options();   d->m_lastFindState.history = d->m_findDialog->findHistory();   d->m_findDialog->deleteLater();   d->m_findDialog = 0L;+#endif // KONQ_EMBEDDED }  void KHTMLPart::findText() {+#ifndef KONQ_EMBEDDED   // First do some init to make sure we can search in this frame   if ( !d->m_doc )     return;@@ -2900,8 +2923,10 @@ void KHTMLPart::findText()   connect( d->m_findDialog, SIGNAL(finished()), this, SLOT(slotFindDialogDestroyed()) );    findText( d->m_findDialog->pattern(), 0 /*options*/, widget(), d->m_findDialog );+#endif // KONQ_EMBEDDED } +#ifndef KONQ_EMBEDDED void KHTMLPart::findText( const QString &str, long options, QWidget *parent, KFindDialog *findDialog ) {   // First do some init to make sure we can search in this frame@@ -2929,10 +2954,12 @@ void KHTMLPart::findText( const QString                    options & KFindDialog::FromCursor );   } }+#endif // KONQ_EMBEDDED  // New method bool KHTMLPart::findTextNext() {+#ifndef KONQ_EMBEDDED   if (!d->m_find)   {     // We didn't show the find dialog yet, let's do it then (#49442)@@ -3113,6 +3139,9 @@ bool KHTMLPart::findTextNext()   }    return res == KFind::Match;+#else+  return false;+#endif // KONQ_EMBEDDED }  void KHTMLPart::slotHighlight( const QString& /*text*/, int index, int length )@@ -3247,6 +3270,7 @@ void KHTMLPart::slotHighlight( const QSt   }   emitSelectionChanged(); +#ifndef KONQ_EMBEDDED   // make the finddialog move away from the selected area   if ( d->m_findDialog && !highlightedRect.isNull() )   {@@ -3254,6 +3278,7 @@ void KHTMLPart::slotHighlight( const QSt     //kdDebug(6050) << "avoiding " << highlightedRect << endl;     KDialog::avoidArea( d->m_findDialog, highlightedRect );   }+#endif // KONQ_EMBEDDED }  QString KHTMLPart::selectedTextAsHTML() const@@ -3807,6 +3832,7 @@ void KHTMLPart::urlSelected( const QStri  void KHTMLPart::slotViewDocumentSource() {+#ifndef KONQ_EMBEDDED   KURL url(m_url);   bool isTempFile = false;   if (!(url.isLocalFile()) && KHTMLPageCache::self()->isComplete(d->m_cacheId))@@ -3822,10 +3848,12 @@ void KHTMLPart::slotViewDocumentSource()   }    (void) KRun::runURL( url, QString::fromLatin1("text/plain"), isTempFile );+#endif //KONQ_EMBEDDED }  void KHTMLPart::slotViewPageInfo() {+#ifndef KONQ_EMBEDDED   KHTMLInfoDlg *dlg = new KHTMLInfoDlg(NULL, "KHTML Page Info Dialog", false, WDestructiveClose);   dlg->_close->setGuiItem(KStdGuiItem::close()); @@ -3874,11 +3902,13 @@ void KHTMLPart::slotViewPageInfo()    dlg->show();   /* put no code here */+#endif // KONQ_EMBEDDED }   void KHTMLPart::slotViewFrameSource() {+#ifndef KONQ_EMBEDDED   KParts::ReadOnlyPart *frame = currentFrame();   if ( !frame )     return;@@ -3903,6 +3933,7 @@ void KHTMLPart::slotViewFrameSource()   }    (void) KRun::runURL( url, QString::fromLatin1("text/plain"), isTempFile );+#endif // KONQ_EMBEDDED }  KURL KHTMLPart::backgroundURL() const@@ -4238,6 +4271,7 @@ bool KHTMLPart::processObjectRequest( kh     // However we don't want to ask for flash and other plugin things..     if ( child->m_type != khtml::ChildFrame::Object )     {+#ifndef KONQ_EMBEDDED       QString suggestedFilename;       if ( child->m_run )         suggestedFilename = child->m_run->suggestedFilename();@@ -4255,6 +4289,7 @@ bool KHTMLPart::processObjectRequest( kh       default: // Open         break;       }+#endif     }      QStringList dummy; // the list of servicetypes handled by the part is now unused.@@ -4473,9 +4513,11 @@ KParts::ReadOnlyPart *KHTMLPart::createP         return res;       }     } else {+#ifndef KONQ_EMBEDDED       // TODO KMessageBox::error and i18n, like in KonqFactory::createView?       kdWarning() << QString("There was an error loading the module %1.\nThe diagnostics is:\n%2")                       .arg(service->name()).arg(KLibLoader::self()->lastErrorMessage()) << endl;+#endif // KONQ_EMBEDDED     }   }   return 0;@@ -5432,8 +5476,10 @@ DOM::Node KHTMLPart::nonSharedNodeUnderM void KHTMLPart::emitSelectionChanged() {   emit d->m_extension->enableAction( "copy", hasSelection() );+#ifndef KONQ_EMBEDDED   if ( d->m_findDialog )        d->m_findDialog->setHasSelection( hasSelection() );+#endif // KONQ_EMBEDDED    emit d->m_extension->selectionInfo( selectedText() );   emit selectionChanged();@@ -5896,8 +5942,10 @@ void KHTMLPart::khtmlMousePressEvent( kh     d->m_bRightMousePressed = true;   } else if ( _mouse->button() == RightButton )   {+#ifndef KONQ_EMBEDDED     popupMenu( d->m_strSelectedURL );     // might be deleted, don't touch "this"+#endif // KONQ_EMBEDDED   } } @@ -6805,13 +6858,17 @@ void KHTMLPart::slotAutomaticDetectionLa       d->m_automaticDetection->setItemChecked( i, false );   } +#ifndef KONQ_EMBEDDED   d->m_paSetEncoding->popupMenu()->setItemChecked( 0, true );+#endif // KONQ_EMBEDDED    setEncoding( QString::null, false ); +#ifndef KONQ_EMBEDDED   if( d->m_manualDetection )     d->m_manualDetection->setCurrentItem( -1 );   d->m_paSetEncoding->popupMenu()->setItemChecked( d->m_paSetEncoding->popupMenu()->idAt( 2 ), false );+#endif // KONQ_EMBEDDED }  khtml::Decoder *KHTMLPart::createDecoder()

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?