View | Details | Raw Unified | Return to bug 58271
Collapse All | Expand All

(-)konqueror/konq_mainwindow.cc (-15 / +20 lines)
Lines 862-867 void KonqMainWindow::slotOpenURLRequest( Link Here
862
{
862
{
863
  kdDebug(1202) << "KonqMainWindow::slotOpenURLRequest frameName=" << args.frameName << endl;
863
  kdDebug(1202) << "KonqMainWindow::slotOpenURLRequest frameName=" << args.frameName << endl;
864
864
865
  KParts::ReadOnlyPart *callingPart = static_cast<KParts::ReadOnlyPart *>( sender()->parent() );
865
  QString frameName = args.frameName;
866
  QString frameName = args.frameName;
866
867
867
  if ( !frameName.isEmpty() )
868
  if ( !frameName.isEmpty() )
Lines 882-892 void KonqMainWindow::slotOpenURLRequest( Link Here
882
         frameName.lower() != _parent )
883
         frameName.lower() != _parent )
883
    {
884
    {
884
      KParts::BrowserHostExtension *hostExtension = 0;
885
      KParts::BrowserHostExtension *hostExtension = 0;
885
      KonqView *view = childView( frameName, &hostExtension, 0 );
886
      KonqView *view = childView( callingPart, frameName, &hostExtension, 0 );
886
      if ( !view )
887
      if ( !view )
887
      {
888
      {
888
        KonqMainWindow *mainWindow = 0;
889
        KonqMainWindow *mainWindow = 0;
889
        view = findChildView( frameName, &mainWindow, &hostExtension, 0 );
890
        view = findChildView( callingPart, frameName, &mainWindow, &hostExtension, 0 );
890
891
891
        if ( !view || !mainWindow )
892
        if ( !view || !mainWindow )
892
        {
893
        {
Lines 909-916 void KonqMainWindow::slotOpenURLRequest( Link Here
909
    }
910
    }
910
  }
911
  }
911
912
912
  KParts::ReadOnlyPart *part = static_cast<KParts::ReadOnlyPart *>( sender()->parent() );
913
  KonqView *view = childView( callingPart );
913
  KonqView *view = childView( part );
914
  openURL( view, url, args );
914
  openURL( view, url, args );
915
}
915
}
916
916
Lines 1045-1051 void KonqMainWindow::slotCreateNewWindow Link Here
1045
    if ( !args.frameName.isEmpty() && args.frameName.lower() != "_blank" )
1045
    if ( !args.frameName.isEmpty() && args.frameName.lower() != "_blank" )
1046
    {
1046
    {
1047
        KParts::BrowserHostExtension *hostExtension = 0;
1047
        KParts::BrowserHostExtension *hostExtension = 0;
1048
        if ( findChildView( args.frameName, &mainWindow, &hostExtension, &part ) )
1048
        if ( findChildView( 0, args.frameName, &mainWindow, &hostExtension, &part ) )
1049
        {
1049
        {
1050
            // Found a view. If url isn't empty, we should open it - but this never happens currently
1050
            // Found a view. If url isn't empty, we should open it - but this never happens currently
1051
            // findChildView put the resulting part in 'part', so we can just return now
1051
            // findChildView put the resulting part in 'part', so we can just return now
Lines 2097-2105 KonqView * KonqMainWindow::childView( KP Link Here
2097
    return 0L;
2097
    return 0L;
2098
}
2098
}
2099
2099
2100
KonqView * KonqMainWindow::childView( const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part )
2100
KonqView * KonqMainWindow::childView( KParts::ReadOnlyPart *callingPart, const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part )
2101
{
2101
{
2102
  //kdDebug() << "KonqMainWindow::childView this=" << this << " looking for " << name << endl;
2102
  kdDebug() << "KonqMainWindow::childView this=" << this << " looking for " << name << endl;
2103
2103
2104
  MapViews::ConstIterator it = m_mapViews.begin();
2104
  MapViews::ConstIterator it = m_mapViews.begin();
2105
  MapViews::ConstIterator end = m_mapViews.end();
2105
  MapViews::ConstIterator end = m_mapViews.end();
Lines 2107-2117 KonqView * KonqMainWindow::childView( co Link Here
2107
  {
2107
  {
2108
    KonqView* view = it.data();
2108
    KonqView* view = it.data();
2109
    QString viewName = view->viewName();
2109
    QString viewName = view->viewName();
2110
    //kdDebug() << "       - viewName=" << viewName << "   "
2110
    kdDebug() << "       - viewName=" << viewName << "   "
2111
    //          << "frame names:" << view->frameNames().join( "," ) << endl;
2111
              << "frame names:" << view->frameNames().join( "," ) << endl;
2112
    if ( !viewName.isEmpty() && viewName == name )
2112
    if ( !viewName.isEmpty() && viewName == name )
2113
    {
2113
    {
2114
      //kdDebug() << "found existing view by name: " << view << endl;
2114
      kdDebug() << "found existing view by name: " << view << endl;
2115
      if ( hostExtension )
2115
      if ( hostExtension )
2116
        *hostExtension = 0;
2116
        *hostExtension = 0;
2117
      if ( part )
2117
      if ( part )
Lines 2120-2127 KonqView * KonqMainWindow::childView( co Link Here
2120
    }
2120
    }
2121
2121
2122
    // First look for a hostextension containing this frame name
2122
    // First look for a hostextension containing this frame name
2123
    // (KonqView looks for it recursively)
2123
    KParts::BrowserHostExtension *ext = KParts::BrowserHostExtension::childObject( view->part() );
2124
    KParts::BrowserHostExtension* ext = KonqView::hostExtension( view->part(), name );
2124
    if ( ext )
2125
    {
2126
      ext = ext->findFrameParent(callingPart, name);
2127
    }
2128
    
2129
//    KParts::BrowserHostExtension* ext = KonqView::hostExtension( view->part(), name );
2125
2130
2126
    if ( ext )
2131
    if ( ext )
2127
    {
2132
    {
Lines 2131-2137 KonqView * KonqMainWindow::childView( co Link Here
2131
      {
2136
      {
2132
        if ( frameIt.current()->name() == name )
2137
        if ( frameIt.current()->name() == name )
2133
        {
2138
        {
2134
          //kdDebug() << "found a frame of name " << name << " : " << frameIt.current() << endl;
2139
          kdDebug() << "found a frame of name " << name << " : " << frameIt.current() << endl;
2135
          if ( hostExtension )
2140
          if ( hostExtension )
2136
            *hostExtension = ext;
2141
            *hostExtension = ext;
2137
          if ( part )
2142
          if ( part )
Lines 2146-2152 KonqView * KonqMainWindow::childView( co Link Here
2146
}
2151
}
2147
2152
2148
// static
2153
// static
2149
KonqView * KonqMainWindow::findChildView( const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part )
2154
KonqView * KonqMainWindow::findChildView( KParts::ReadOnlyPart *callingPart, const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part )
2150
{
2155
{
2151
  if ( !s_lstViews )
2156
  if ( !s_lstViews )
2152
    return 0;
2157
    return 0;
Lines 2154-2160 KonqView * KonqMainWindow::findChildView Link Here
2154
  QPtrListIterator<KonqMainWindow> it( *s_lstViews );
2159
  QPtrListIterator<KonqMainWindow> it( *s_lstViews );
2155
  for (; it.current(); ++it )
2160
  for (; it.current(); ++it )
2156
  {
2161
  {
2157
    KonqView *res = it.current()->childView( name, hostExtension, part );
2162
    KonqView *res = it.current()->childView( callingPart, name, hostExtension, part );
2158
    if ( res )
2163
    if ( res )
2159
    {
2164
    {
2160
      if ( mainWindow )
2165
      if ( mainWindow )
(-)konqueror/konq_mainwindow.h (-2 / +2 lines)
Lines 145-154 public: Link Here
145
  void insertChildView( KonqView *childView );
145
  void insertChildView( KonqView *childView );
146
  void removeChildView( KonqView *childView );
146
  void removeChildView( KonqView *childView );
147
  KonqView *childView( KParts::ReadOnlyPart *view );
147
  KonqView *childView( KParts::ReadOnlyPart *view );
148
  KonqView *childView( const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
148
  KonqView *childView( KParts::ReadOnlyPart *callingPart, const QString &name, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
149
149
150
  // dcop idl bug! it can't handle KonqMainWindow *&mainWindow
150
  // dcop idl bug! it can't handle KonqMainWindow *&mainWindow
151
  static KonqView *findChildView( const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
151
  static KonqView *findChildView( KParts::ReadOnlyPart *callingPart, const QString &name, KonqMainWindow **mainWindow, KParts::BrowserHostExtension **hostExtension, KParts::ReadOnlyPart **part );
152
152
153
  // Total number of views
153
  // Total number of views
154
  int viewCount() const { return m_mapViews.count(); }
154
  int viewCount() const { return m_mapViews.count(); }

Return to bug 58271