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