]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Assure that the view gets focused when:
authorPeter Penz <peter.penz19@gmail.com>
Tue, 16 Dec 2008 18:37:02 +0000 (18:37 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Tue, 16 Dec 2008 18:37:02 +0000 (18:37 +0000)
* Enter or Ctrl+Enter is pressed in the URL navigator
* when the filter bar gets closed

BUG: 158232

svn path=/trunk/KDE/kdebase/apps/; revision=897739

src/dolphinview.cpp
src/dolphinviewcontainer.cpp

index 969da773dcd4e677444daa0f52851a16464df8b0..b1c0bf7437c750720ae9b2b1a5172fb1347772e3 100644 (file)
@@ -1253,6 +1253,7 @@ void DolphinView::createView()
     Q_ASSERT(view != 0);
     view->installEventFilter(this);
     view->viewport()->installEventFilter(this);
+    setFocusProxy(view);
 
     if (m_mode != ColumnView) {
         // Give the view the ability to auto-expand its directories on hovering
@@ -1315,6 +1316,7 @@ void DolphinView::deleteView()
         // before deleting the view: Otherwise when having a split
         // view the other view will get the focus and will request
         // an activation (see DolphinView::eventFilter()).
+        setFocusProxy(0);
         setFocus();
 
         m_topLayout->removeWidget(view);
index 794418eabec2df06bd8ded7cb5466a79fff88625..a70055b5ff3322242a51efb4b7bcc9d9382bbd46 100644 (file)
@@ -261,6 +261,10 @@ void DolphinViewContainer::slotDirListerCompleted()
         KonqFileItemCapabilities capabilities(KFileItemList() << item);
         createNew->setEnabled(capabilities.supportsWriting());
     }
+
+    if (isActive()) {
+        m_view->setFocus();
+    }
 }
 
 void DolphinViewContainer::showItemInfo(const KFileItem& item)
@@ -291,6 +295,7 @@ void DolphinViewContainer::closeFilterBar()
 {
     m_filterBar->hide();
     m_filterBar->clear();
+    m_view->setFocus();
     emit showFilterBarChanged(false);
 }