~michael-sheldon/ubuntu-keyboard/suggestion-override

« back to all changes in this revision

Viewing changes to plugins/pinyin/src/pinyinplugin.cpp

  • Committer: CI bot
  • Author(s): Michael Sheldon
  • Date: 2014-05-12 23:00:30 UTC
  • mfrom: (158.2.11 multithreaded-spell-checking)
  • Revision ID: ps-jenkins@lists.canonical.com-20140512230030-m87f15loxsazj96y
Refactor language plugins to provide word candidates via signals and move spell checking and predictive text into separate threads Fixes: 1299736

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#include <QDebug>
5
5
 
6
6
PinyinPlugin::PinyinPlugin(QObject *parent) :
7
 
    QObject(parent)
 
7
    AbstractLanguagePlugin(parent)
8
8
  , pinyinAdapter(new PinyinAdapter)
9
9
  , m_chineseLanguageFeatures(new ChineseLanguageFeatures)
10
10
{
14
14
{
15
15
}
16
16
 
17
 
void PinyinPlugin::parse(const QString& surroundingLeft, const QString& preedit)
 
17
void PinyinPlugin::predict(const QString& surroundingLeft, const QString& preedit)
18
18
{
19
19
    Q_UNUSED(surroundingLeft);
20
 
    return pinyinAdapter->parse(preedit);
21
 
}
22
 
 
23
 
QStringList PinyinPlugin::getWordCandidates()
24
 
{
25
 
    return pinyinAdapter->getWordCandidates();
 
20
    pinyinAdapter->parse(preedit);
 
21
    Q_EMIT newPredictionSuggestions(pinyinAdapter->getWordCandidates());
26
22
}
27
23
 
28
24
void PinyinPlugin::wordCandidateSelected(QString word)