[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    branches/KDE/4.3/kdebase/apps/konqueror/src
From:       David Faure <faure () kde ! org>
Date:       2010-01-21 18:28:06
Message-ID: 1264098486.796132.6911.nullmailer () svn ! kde ! org
[Download RAW message or body]

SVN commit 1078192 by dfaure:

Backport 1076829: Fix crash on Ctrl+Tab.
Fixed for: 4.3.5
CCBUG: 203809


 M  +2 -16     konqframe.cpp  
 M  +0 -6      konqframe.h  
 M  +0 -2      konqframecontainer.h  
 M  +6 -1      konqmainwindow.cpp  
 M  +0 -2      konqtabs.h  
 M  +0 -4      konqviewmanager.cpp  


--- branches/KDE/4.3/kdebase/apps/konqueror/src/konqframe.cpp #1078191:1078192
@@ -167,29 +167,15 @@
 
    m_pLayout->activate();
 
-   widget->installEventFilter(this);
+   installEventFilter(m_pView->mainWindow()); // for Ctrl+Tab
 }
 
-bool KonqFrame::eventFilter(QObject* /*obj*/, QEvent *ev)
-{
-   if (ev->type()==QEvent::KeyPress)
-   {
-      QKeyEvent * keyEv = static_cast<QKeyEvent*>(ev);
-      if ((keyEv->key()==Qt::Key_Tab) && (keyEv->modifiers()==Qt::ControlModifier))
-      {
-         emit ((KonqFrameContainer*)parent())->ctrlTabPressed();
-         return true;
-      }
-   }
-   return false;
-}
-
 void KonqFrame::insertTopWidget( QWidget * widget )
 {
     assert(m_pLayout);
     assert(widget);
     m_pLayout->insertWidget( 0, widget );
-    widget->installEventFilter(this);
+    installEventFilter(m_pView->mainWindow()); // for Ctrl+Tab
 }
 
 void KonqFrame::setView( KonqView* child )
--- branches/KDE/4.3/kdebase/apps/konqueror/src/konqframe.h #1078191:1078192
@@ -131,12 +131,6 @@
   KParts::ReadOnlyPart *attach( const KonqViewFactory &viewFactory );
 
   /**
-   * Filters the CTRL+Tab event from the views and emits ctrlTabPressed to
-   make KonqMainWindow switch to the next view
-   */
-  virtual bool eventFilter(QObject*obj, QEvent *ev);
-
-  /**
    * Inserts the widget and the statusbar into the layout
    */
   void attachWidget(QWidget* widget);
--- branches/KDE/4.3/kdebase/apps/konqueror/src/konqframecontainer.h #1078191:1078192
@@ -81,7 +81,6 @@
 class KonqFrameContainer : public QSplitter, public KonqFrameContainerBase   // TODO \
rename to KonqFrameContainerSplitter?  {
   Q_OBJECT
-  friend class KonqFrame; //for emitting ctrlTabPressed() only, aleXXX
 public:
   KonqFrameContainer( Qt::Orientation o,
                       QWidget* parent,
@@ -122,7 +121,6 @@
     virtual void childEvent( QChildEvent * );
 
 Q_SIGNALS:
-  void ctrlTabPressed();
   void setRubberbandCalled();
 
 protected:
--- branches/KDE/4.3/kdebase/apps/konqueror/src/konqmainwindow.cpp #1078191:1078192
@@ -3197,7 +3197,7 @@
       m_combo->clearHistory();
 }
 
-bool KonqMainWindow::eventFilter(QObject*obj,QEvent *ev)
+bool KonqMainWindow::eventFilter(QObject*obj, QEvent *ev)
 {
   if ( ( ev->type()==QEvent::FocusIn || ev->type()==QEvent::FocusOut ) &&
        m_combo && m_combo->lineEdit() && m_combo == obj )
@@ -3283,6 +3283,11 @@
           m_paPaste->setEnabled( false );
       }
     }
+  } else if (ev->type()==QEvent::KeyPress) {
+      QKeyEvent * keyEv = static_cast<QKeyEvent*>(ev);
+      if ((keyEv->key() == Qt::Key_Tab) && (keyEv->modifiers() == \
Qt::ControlModifier)) { +          slotCtrlTabPressed();
+      }
   }
   return KParts::MainWindow::eventFilter( obj, ev );
 }
--- branches/KDE/4.3/kdebase/apps/konqueror/src/konqtabs.h #1078191:1078192
@@ -43,7 +43,6 @@
 class KonqFrameTabs : public KTabWidget, public KonqFrameContainerBase
 {
   Q_OBJECT
-  friend class KonqFrame; //for emitting ctrlTabPressed() only, aleXXX
 
 public:
   KonqFrameTabs(QWidget* parent, KonqFrameContainerBase* parentContainer,
@@ -94,7 +93,6 @@
   void setAlwaysTabbedMode( bool );
 
 Q_SIGNALS:
-  void ctrlTabPressed();
   void removeTabPopup();
     void openUrl(KonqView* view, const KUrl& url);
 
--- branches/KDE/4.3/kdebase/apps/konqueror/src/konqviewmanager.cpp #1078191:1078192
@@ -128,7 +128,6 @@
   }
 
   KonqFrameContainer* newContainer = parentContainer->splitChildFrame(splitFrame, \
                orientation);
-  connect(newContainer, SIGNAL(ctrlTabPressed()), m_pMainWindow, \
SLOT(slotCtrlTabPressed()));  
   //kDebug(1202) << "Create new child";
   KonqView *newView = setupView( newContainer, newViewFactory, service, \
partServiceOffers, appServiceOffers, serviceType, false ); @@ -188,7 +187,6 @@
     KonqFrameBase* mainFrame = m_pMainWindow->childFrame();
 
     KonqFrameContainer* newContainer = m_pMainWindow->splitChildFrame(mainFrame, \
                orientation);
-    connect(newContainer, SIGNAL(ctrlTabPressed()), m_pMainWindow, \
SLOT(slotCtrlTabPressed()));  
     KonqView* childView = setupView( newContainer, newViewFactory, service, \
partServiceOffers, appServiceOffers, serviceType, true );  
@@ -1270,7 +1268,6 @@
     else
     {
       KonqFrameContainer *newContainer = new KonqFrameContainer( o, \
                parent->asQWidget(), parent );
-      connect(newContainer,SIGNAL(ctrlTabPressed()),m_pMainWindow,SLOT(slotCtrlTabPressed()));
  
       int tabindex = pos;
       if(openAfterCurrentPage && parent->frameType() == KonqFrameBase::Tabs) // Need \
to honor it, if possible @@ -1578,7 +1575,6 @@
     kDebug() << "createTabContainer" << parent << parentContainer;
 #endif
     m_tabContainer = new KonqFrameTabs( parent, parentContainer, this );
-    connect( m_tabContainer, SIGNAL(ctrlTabPressed()), m_pMainWindow, \
SLOT(slotCtrlTabPressed()) );  // Delay the opening of the URL for #106641
     bool ok = connect( m_tabContainer, SIGNAL(openUrl(KonqView*, KUrl)), \
m_pMainWindow, SLOT(openUrl(KonqView*, KUrl)), Qt::QueuedConnection);  Q_ASSERT(ok);


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic