From 54d3379b1290253a48deaa8a3f4c476098f668e1 Mon Sep 17 00:00:00 2001 From: Peter Hartmann Date: Wed, 19 Jan 2022 14:55:01 +0100 Subject: [PATCH] text prediction: Move predictors to input panel --- inputcontext/inputcontext.pro | 3 -- .../inputpanel}/QskHunspellTextPredictor.cpp | 0 .../inputpanel}/QskHunspellTextPredictor.h | 3 +- .../inputpanel}/QskPinyinTextPredictor.cpp | 0 .../inputpanel}/QskPinyinTextPredictor.h | 0 src/src.pro | 33 +++++++++++++++++++ 6 files changed, 34 insertions(+), 5 deletions(-) rename {inputcontext => src/inputpanel}/QskHunspellTextPredictor.cpp (100%) rename {inputcontext => src/inputpanel}/QskHunspellTextPredictor.h (87%) rename {inputcontext => src/inputpanel}/QskPinyinTextPredictor.cpp (100%) rename {inputcontext => src/inputpanel}/QskPinyinTextPredictor.h (100%) diff --git a/inputcontext/inputcontext.pro b/inputcontext/inputcontext.pro index 29b210a8..9d4e7af0 100644 --- a/inputcontext/inputcontext.pro +++ b/inputcontext/inputcontext.pro @@ -3,9 +3,6 @@ TARGET = $$qskPluginTarget(qskinputcontext) QT += gui-private -# CONFIG += pinyin -# CONFIG += hunspell - CONFIG += plugin CONFIG += qskinny diff --git a/inputcontext/QskHunspellTextPredictor.cpp b/src/inputpanel/QskHunspellTextPredictor.cpp similarity index 100% rename from inputcontext/QskHunspellTextPredictor.cpp rename to src/inputpanel/QskHunspellTextPredictor.cpp diff --git a/inputcontext/QskHunspellTextPredictor.h b/src/inputpanel/QskHunspellTextPredictor.h similarity index 87% rename from inputcontext/QskHunspellTextPredictor.h rename to src/inputpanel/QskHunspellTextPredictor.h index c56a9288..121c4aad 100644 --- a/inputcontext/QskHunspellTextPredictor.h +++ b/src/inputpanel/QskHunspellTextPredictor.h @@ -6,11 +6,10 @@ #ifndef QSK_HUNSPELL_TEXT_PREDICTOR_H #define QSK_HUNSPELL_TEXT_PREDICTOR_H -#include "QskInputContextGlobal.h" #include #include -class QSK_INPUTCONTEXT_EXPORT QskHunspellTextPredictor : public QskTextPredictor +class QSK_EXPORT QskHunspellTextPredictor : public QskTextPredictor { using Inherited = QskTextPredictor; diff --git a/inputcontext/QskPinyinTextPredictor.cpp b/src/inputpanel/QskPinyinTextPredictor.cpp similarity index 100% rename from inputcontext/QskPinyinTextPredictor.cpp rename to src/inputpanel/QskPinyinTextPredictor.cpp diff --git a/inputcontext/QskPinyinTextPredictor.h b/src/inputpanel/QskPinyinTextPredictor.h similarity index 100% rename from inputcontext/QskPinyinTextPredictor.h rename to src/inputpanel/QskPinyinTextPredictor.h diff --git a/src/src.pro b/src/src.pro index 0cd2722b..d9e9f9f8 100644 --- a/src/src.pro +++ b/src/src.pro @@ -9,6 +9,9 @@ QSK_SUBDIRS = common graphic nodes controls layouts dialogs inputpanel INCLUDEPATH *= $${QSK_SUBDIRS} DEPENDPATH *= $${QSK_SUBDIRS} +# CONFIG += pinyin +CONFIG += hunspell + # DEFINES += QSK_LAYOUT_COMPAT HEADERS += \ @@ -352,6 +355,36 @@ SOURCES += \ inputpanel/QskInputPredictionBar.cpp \ inputpanel/QskVirtualKeyboard.cpp +pinyin { + + unix { + + CONFIG += link_pkgconfig + PKGCONFIG += pinyin + + HEADERS += \ + inputpanel/QskPinyinTextPredictor.h + + SOURCES += \ + inputpanel/QskPinyinTextPredictor.cpp + } +} + +hunspell { + + unix { + + CONFIG += link_pkgconfig + PKGCONFIG += hunspell + + HEADERS += \ + inputpanel/QskHunspellTextPredictor.h + + SOURCES += \ + inputpanel/QskHunspellTextPredictor.cpp + } +} + target.path = $${QSK_INSTALL_LIBS} INSTALLS = target