mirror of the now-defunct rocklinux.org
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

138 lines
6.6 KiB

  1. Index: konqueror/konq_mainwindow.cc
  2. ===================================================================
  3. RCS file: /home/kde/kdebase/konqueror/konq_mainwindow.cc,v
  4. retrieving revision 1.1274.2.24
  5. diff -u -p -r1.1274.2.24 konq_mainwindow.cc
  6. --- kde-old/konqueror/konq_mainwindow.cc 7 Jun 2004 23:10:55 -0000 1.1274.2.24
  7. +++ kde-new/konqueror/konq_mainwindow.cc 3 Aug 2004 14:54:23 -0000
  8. @@ -862,6 +862,7 @@ void KonqMainWindow::slotOpenURLRequest(
  9. {
  10. kdDebug(1202) << "KonqMainWindow::slotOpenURLRequest frameName=" << args.frameName << endl;
  11. + KParts::ReadOnlyPart *callingPart = static_cast<KParts::ReadOnlyPart *>( sender()->parent() );
  12. QString frameName = args.frameName;
  13. if ( !frameName.isEmpty() )
  14. @@ -882,11 +883,11 @@ void KonqMainWindow::slotOpenURLRequest(
  15. frameName.lower() != _parent )
  16. {
  17. KParts::BrowserHostExtension *hostExtension = 0;
  18. - KonqView *view = childView( frameName, &hostExtension, 0 );
  19. + KonqView *view = childView( callingPart, frameName, &hostExtension, 0 );
  20. if ( !view )
  21. {
  22. KonqMainWindow *mainWindow = 0;
  23. - view = findChildView( frameName, &mainWindow, &hostExtension, 0 );
  24. + view = findChildView( callingPart, frameName, &mainWindow, &hostExtension, 0 );
  25. if ( !view || !mainWindow )
  26. {
  27. @@ -909,8 +910,7 @@ void KonqMainWindow::slotOpenURLRequest(
  28. }
  29. }
  30. - KParts::ReadOnlyPart *part = static_cast<KParts::ReadOnlyPart *>( sender()->parent() );
  31. - KonqView *view = childView( part );
  32. + KonqView *view = childView( callingPart );
  33. openURL( view, url, args );
  34. }
  35. @@ -1045,7 +1045,7 @@ void KonqMainWindow::slotCreateNewWindow
  36. if ( !args.frameName.isEmpty() && args.frameName.lower() != "_blank" )
  37. {
  38. KParts::BrowserHostExtension *hostExtension = 0;
  39. - if ( findChildView( args.frameName, &mainWindow, &hostExtension, &part ) )
  40. + if ( findChildView( 0, args.frameName, &mainWindow, &hostExtension, &part ) )
  41. {
  42. // Found a view. If url isn't empty, we should open it - but this never happens currently
  43. // findChildView put the resulting part in 'part', so we can just return now
  44. @@ -2097,9 +2097,9 @@ KonqView * KonqMainWindow::childView( KP
  45. return 0L;
  46. }
  47. -KonqView * KonqMainWindow::childView( const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part )
  48. +KonqView * KonqMainWindow::childView( KParts::ReadOnlyPart *callingPart, const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part )
  49. {
  50. - //kdDebug() << "KonqMainWindow::childView this=" << this << " looking for " << name << endl;
  51. + kdDebug() << "KonqMainWindow::childView this=" << this << " looking for " << name << endl;
  52. MapViews::ConstIterator it = m_mapViews.begin();
  53. MapViews::ConstIterator end = m_mapViews.end();
  54. @@ -2107,11 +2107,11 @@ KonqView * KonqMainWindow::childView( co
  55. {
  56. KonqView* view = it.data();
  57. QString viewName = view->viewName();
  58. - //kdDebug() << " - viewName=" << viewName << " "
  59. - // << "frame names:" << view->frameNames().join( "," ) << endl;
  60. + kdDebug() << " - viewName=" << viewName << " "
  61. + << "frame names:" << view->frameNames().join( "," ) << endl;
  62. if ( !viewName.isEmpty() && viewName == name )
  63. {
  64. - //kdDebug() << "found existing view by name: " << view << endl;
  65. + kdDebug() << "found existing view by name: " << view << endl;
  66. if ( hostExtension )
  67. *hostExtension = 0;
  68. if ( part )
  69. @@ -2120,8 +2120,13 @@ KonqView * KonqMainWindow::childView( co
  70. }
  71. // First look for a hostextension containing this frame name
  72. - // (KonqView looks for it recursively)
  73. - KParts::BrowserHostExtension* ext = KonqView::hostExtension( view->part(), name );
  74. + KParts::BrowserHostExtension *ext = KParts::BrowserHostExtension::childObject( view->part() );
  75. + if ( ext )
  76. + {
  77. + ext = ext->findFrameParent(callingPart, name);
  78. + }
  79. +
  80. +// KParts::BrowserHostExtension* ext = KonqView::hostExtension( view->part(), name );
  81. if ( ext )
  82. {
  83. @@ -2131,7 +2136,7 @@ KonqView * KonqMainWindow::childView( co
  84. {
  85. if ( frameIt.current()->name() == name )
  86. {
  87. - //kdDebug() << "found a frame of name " << name << " : " << frameIt.current() << endl;
  88. + kdDebug() << "found a frame of name " << name << " : " << frameIt.current() << endl;
  89. if ( hostExtension )
  90. *hostExtension = ext;
  91. if ( part )
  92. @@ -2146,7 +2151,7 @@ KonqView * KonqMainWindow::childView( co
  93. }
  94. // static
  95. -KonqView * KonqMainWindow::findChildView( const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part )
  96. +KonqView * KonqMainWindow::findChildView( KParts::ReadOnlyPart *callingPart, const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part )
  97. {
  98. if ( !s_lstViews )
  99. return 0;
  100. @@ -2154,7 +2159,7 @@ KonqView * KonqMainWindow::findChildView
  101. QPtrListIterator<KonqMainWindow> it( *s_lstViews );
  102. for (; it.current(); ++it )
  103. {
  104. - KonqView *res = it.current()->childView( name, hostExtension, part );
  105. + KonqView *res = it.current()->childView( callingPart, name, hostExtension, part );
  106. if ( res )
  107. {
  108. if ( mainWindow )
  109. Index: konqueror/konq_mainwindow.h
  110. ===================================================================
  111. RCS file: /home/kde/kdebase/konqueror/konq_mainwindow.h,v
  112. retrieving revision 1.423.2.4
  113. diff -u -p -r1.423.2.4 konq_mainwindow.h
  114. --- kde-old/konqueror/konq_mainwindow.h 7 Jun 2004 23:10:56 -0000 1.423.2.4
  115. +++ kde-new/konqueror/konq_mainwindow.h 3 Aug 2004 14:54:23 -0000
  116. @@ -145,10 +145,10 @@ public:
  117. void insertChildView( KonqView *childView );
  118. void removeChildView( KonqView *childView );
  119. KonqView *childView( KParts::ReadOnlyPart *view );
  120. - KonqView *childView( const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
  121. + KonqView *childView( KParts::ReadOnlyPart *callingPart, const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
  122. // dcop idl bug! it can't handle KonqMainWindow *&mainWindow
  123. - static KonqView *findChildView( const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
  124. + static KonqView *findChildView( KParts::ReadOnlyPart *callingPart, const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
  125. // Total number of views
  126. int viewCount() const { return m_mapViews.count(); }