Commit dce5b2a3 authored by Jocelyn Turcotte's avatar Jocelyn Turcotte
Browse files

Enable JavaScript touch events


They are disabled by default at the moment, enable them conditionally
to a touch screen being available.

Change-Id: I5827fe2326b7bc019fa5613121d1cfa666608e52
Reviewed-by: default avatarAndras Becsi <andras.becsi@digia.com>
Showing with 17 additions and 0 deletions
......@@ -42,6 +42,7 @@
#include <QFont>
#include <QTimer>
#include <QTouchDevice>
static const int batchTimerTimeout = 100;
......@@ -68,6 +69,21 @@ private:
#include "web_engine_settings.moc"
static inline bool isTouchScreenAvailable() {
static bool initialized = false;
static bool touchScreenAvailable = false;
if (!initialized) {
Q_FOREACH (const QTouchDevice *d, QTouchDevice::devices()) {
if (d->type() == QTouchDevice::TouchScreen) {
touchScreenAvailable = true;
break;
}
}
initialized = true;
}
return touchScreenAvailable;
}
WebEngineSettings::WebEngineSettings(WebEngineSettingsDelegate *delegate)
: m_adapter(0)
......@@ -245,6 +261,7 @@ void WebEngineSettings::applySettingsToWebPreferences(WebPreferences *prefs)
{
// Override for now
prefs->java_enabled = false;
prefs->touch_enabled = isTouchScreenAvailable();
// Attributes mapping.
prefs->loads_images_automatically = testAttribute(AutoLoadImages);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment