File two_finger_emulation_bnc658800.diff of Package synaptiks

--- kcmodule/synaptikswidgets.cpp	2010/09/14 15:21:30	1175252
+++ kcmodule/synaptikswidgets.cpp	2010/09/14 15:21:32	1175253
@@ -153,11 +153,17 @@
     QDBusInterface touchpad("org.kde.synaptiks",  "/Touchpad",
                             "org.kde.Touchpad");
     QDBusReply<int> fingers = touchpad.call("fingerDetection");
-    if (fingers.isValid()) {
-        if (fingers.value() < 2) {
-            ui.kcfg_HorizontalTwoFingerScrolling->setEnabled(false);
-            ui.kcfg_VerticalTwoFingerScrolling->setEnabled(false);
-        }
+    QDBusReply<bool> emulationSupported = touchpad.call(
+        "twoFingerEmulationSupported");
+    if (fingers.isValid() && emulationSupported.isValid()) {
+        // two finger scrolling widgets can be enabled, if either at least
+        // two fingers are detected, or if emulation is supported.
+        bool twoFingerScrollingSupported =
+            fingers.value() >= 2 && emulationSupported.value();
+        ui.kcfg_HorizontalTwoFingerScrolling->setEnabled(
+            twoFingerScrollingSupported);
+        ui.kcfg_VerticalTwoFingerScrolling->setEnabled(
+            twoFingerScrollingSupported);
     }
     this->connect(ui.kcfg_HorizontalEdgeScrolling, SIGNAL(toggled(bool)),
                   SLOT(disableCoastingConfiguration()));
@@ -192,6 +198,8 @@
     }
     QDBusReply<int> fingers = touchpad.call("fingerDetection");
     if (fingers.isValid()) {
+        // disable finger tap widgets, which are not supported, because the
+        // touchpad does not support multiple fingers
         for (int i=fingers; i < 3; i++) {
             QWidget *widget = ui.fingerButtonsLayout->itemAt(
                 i, QFormLayout::FieldRole)->widget();
@@ -200,6 +208,14 @@
                 widget)->setEnabled(false);
         }
     }
+    // enable the two-finger tap widget, if emulation is supported.
+    QDBusReply<bool> emulationSupported = touchpad.call(
+        "twoFingerEmulationSupported");
+    if (emulationSupported.isValid() && emulationSupported.value()) {
+        ui.kcfg_TwoFingerButton->setEnabled(true);
+        ui.fingerButtonsLayout->labelForField(
+            ui.kcfg_TwoFingerButton)->setEnabled(true);
+    }
 }
 
 NotificationsPage::NotificationsPage(const QString &appname,