aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJarkko Koivikko <jarkko.koivikko@code-q.fi>2021-10-08 08:22:12 +0300
committerJarkko Koivikko <jarkko.koivikko@code-q.fi>2021-10-18 16:31:09 +0000
commita9da98162a60c65cc54716c6dacf01dbe96f3571 (patch)
treea4dfc725e07bcfa7f6330958f83f531bffc1ae36 /src
parent433fa8c83a4fadd5a78f8a2772ab997064a7082a (diff)
cerence-hwr: Fix compilation with the latest Cerence SDK (v9)
[ChangeLog][Cerence] Added support for the latest Cerence SDK (9.x). Pick-to: 6.2 Change-Id: I5f90aa06d552a984822e49df56e7c68f8d9c993d Reviewed-by: Jarkko Koivikko <jarkko.koivikko@code-q.fi> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp b/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
index 10f2c0dc..d9cbdf11 100644
--- a/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
+++ b/src/plugins/cerence/cerence-hwr/plugin/t9writeinputmethod.cpp
@@ -800,8 +800,12 @@ public:
#ifdef DECUMA_USE_MULTI_THREAD
// Note: This feature requires T9 Write v8.0.0 or later,
// and feature enabled in the SDK.
+#if CERENCEHANDWRITINGAPIMAJORVERNUM > 28
+ sessionSettings.bUseThreads = 1;
+#else
sessionSettings.nMaxThreads = qMax(QThread::idealThreadCount(), 0);
#endif
+#endif
qCDebug(lcT9Write) << " -> language categories:" << languageCategories;
qCDebug(lcT9Write) << " -> symbol categories:" << symbolCategories;
@@ -1336,9 +1340,7 @@ public:
const int dpi = traceCaptureDeviceInfo.value(QLatin1String("dpi"), 96).toInt();
static const int INSTANT_GESTURE_WIDTH_THRESHOLD_MM = 25;
- static const int INSTANT_GESTURE_HEIGHT_THRESHOLD_MM = 25;
- instantGestureSettings.widthThreshold = static_cast<DECUMA_UINT32>(INSTANT_GESTURE_WIDTH_THRESHOLD_MM / 25.4 * dpi);
- instantGestureSettings.heightThreshold = static_cast<DECUMA_UINT32>(INSTANT_GESTURE_HEIGHT_THRESHOLD_MM / 25.4 * dpi);
+ gestureWidthThreshold = static_cast<DECUMA_UINT32>(INSTANT_GESTURE_WIDTH_THRESHOLD_MM / 25.4 * dpi);
gestureRecognizer.setDpi(dpi);
@@ -1954,7 +1956,7 @@ public:
static const int SWIPE_ANGLE_THRESHOLD = 15; // degrees +-
qreal swipeLength = gesture[QLatin1String("length")].toReal();
- if (swipeLength >= instantGestureSettings.widthThreshold) {
+ if (swipeLength >= gestureWidthThreshold) {
Q_Q(T9WriteInputMethod);
QVirtualKeyboardInputContext *ic = q->inputContext();
@@ -2314,7 +2316,7 @@ public:
T9WriteInputMethod::EngineMode engineMode;
QByteArray currentContext;
DECUMA_SESSION_SETTINGS sessionSettings;
- DECUMA_INSTANT_GESTURE_SETTINGS instantGestureSettings;
+ DECUMA_UINT32 gestureWidthThreshold;
QStringList defaultHwrDbPaths;
QFile hwrDbFile;
QList<DECUMA_UINT32> languageCategories;