File kfile-select.diff of Package kdelibs4

Index: kfile/kdiroperator.cpp
===================================================================
--- kfile/kdiroperator.cpp	(revision 886149)
+++ kfile/kdiroperator.cpp	(working copy)
@@ -272,7 +272,7 @@
     previewWidth(0),
     leftButtonPressed(false),
     dirHighlighting(false),
-    onlyDoubleClickSelectsFiles(false),
+    onlyDoubleClickSelectsFiles(true),
     progressDelayTimer(0),
     dropOptions(0),
     actionMenu(0),
@@ -2007,31 +2007,19 @@
 
     if (!parent->onlyDoubleClickSelectsFiles())
         _k_slotDoubleClicked(index);
-    else
-        _k_slotActivated(index);
 }
 
 void KDirOperator::Private::_k_slotActivated(const QModelIndex& index)
 {
     const QModelIndex dirIndex = proxyModel->mapToSource(index);
     KFileItem item = dirModel->itemForIndex(dirIndex);
-    bool selectDir = false;
 
     const Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
     if (item.isNull() || (modifiers & Qt::ShiftModifier) || (modifiers & Qt::ControlModifier))
         return;
 
     if (item.isDir()) {
-        const Qt::KeyboardModifiers modifiers = QApplication::keyboardModifiers();
-        selectDir = KGlobalSettings::singleClick() &&
-                    !(modifiers & Qt::ShiftModifier) &&
-                    !(modifiers & Qt::ControlModifier);
-    }
-
-    if (selectDir) {
         parent->selectDir(item);
-    } else {
-        parent->selectFile(item);
     }
 }
 
Index: kfile/kdiroperator.h
===================================================================
--- kfile/kdiroperator.h	(revision 886149)
+++ kfile/kdiroperator.h	(working copy)
@@ -420,14 +420,11 @@
     virtual void writeConfig(KConfigGroup& configGroup);
 
     /**
-     * This is a KFileDialog specific hack: we want to select directories with
-     * single click, but not files. But as a generic class, we have to be able
-     * to select files on single click as well.
+     * This toggles between double/single click file and directory selection mode.
+     * When argument is true, files and directories are highlighted with single click and
+     * selected (executed) with double click.
      *
-     * This gives us the opportunity to do both.
-     *
-     * The default is false, set it to true if you don't want files selected
-     * with single click.
+     * The default follows the signle/double click system setting.
      */
     void setOnlyDoubleClickSelectsFiles(bool enable);
 
openSUSE Build Service is sponsored by