]> cloud.milkyroute.net Git - dolphin.git/commitdiff
Forward port: Don't grab the focus if the view did not have the focus already.
authorPeter Penz <peter.penz19@gmail.com>
Sat, 1 Jan 2011 17:54:23 +0000 (17:54 +0000)
committerPeter Penz <peter.penz19@gmail.com>
Sat, 1 Jan 2011 17:54:23 +0000 (17:54 +0000)
CCBUG: 261147
FIXED-IN: 4.6.0

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

src/views/dolphindetailsview.cpp
src/views/dolphiniconsview.cpp
src/views/dolphinview.cpp

index dcde4b49676a631a99d229f6498f8237433a4cc5..12a2ba348f512d3c107e434639ad61e30171bb5a 100644 (file)
@@ -158,9 +158,6 @@ DolphinDetailsView::DolphinDetailsView(QWidget* parent,
 
     KDirLister *dirLister = qobject_cast<KDirModel*>(proxyModel->sourceModel())->dirLister();
     connect(dirLister, SIGNAL(newItems(KFileItemList)), this, SLOT(resizeColumns()));
-
-    // setFocus() must be called after m_extensionsFactory is initialised (see bug 240374).
-    setFocus();
 }
 
 DolphinDetailsView::~DolphinDetailsView()
index 522a9078779ba6b00d18ce5d209d00d5dbe9cca9..4abcad3db675b3de30a38667f7d14cdb4b87f1ee 100644 (file)
@@ -126,9 +126,6 @@ DolphinIconsView::DolphinIconsView(QWidget* parent,
 
     updateGridSize(view->showPreview(), 0);
     m_extensionsFactory = new ViewExtensionsFactory(this, dolphinViewController, viewModeController);
-
-    // setFocus() must be called after m_extensionsFactory is initialised (see bug 240374).
-    setFocus();
 }
 
 DolphinIconsView::~DolphinIconsView()
index 1e97d6864930adca8d65edd8249c776fdf9dc185..b02f794b313992cf2d837625ea2867e914664d74 100644 (file)
@@ -1231,12 +1231,14 @@ void DolphinView::deleteView()
     if (view != 0) {
         disconnectViewAccessor();
 
-        // It's important to set the keyboard focus to the parent
-        // 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();
+        if (hasFocus()) {
+            // It's important to set the keyboard focus to the parent
+            // 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_viewModeController->disconnect(view);