~beernarrd/ubuntu-keyboard/slovenian-layout

« back to all changes in this revision

Viewing changes to plugins/westernsupport/westernlanguagesplugin.cpp

  • Committer: Package Import Robot
  • Author(s): CI Train Bot, CI Train Bot, Michael Sheldon
  • Date: 2015-02-13 04:09:03 UTC
  • mfrom: (1.1.74)
  • Revision ID: package-import@ubuntu.com-20150213040903-6epqh2nh1drftibe
Tags: 0.99.trunk.phablet2+15.04.20150213-0ubuntu1
[ CI Train Bot ]
* Resync trunk
* New rebuild forced.

[ Michael Sheldon ]
* Fix memory leak when unloading word engines (LP: #1420891)

Show diffs side-by-side

added added

removed removed

Lines of Context:
10
10
  , m_spellCheckEnabled(false)
11
11
{
12
12
    m_spellPredictThread = new QThread();
13
 
    SpellPredictWorker *spellPredictWorker = new SpellPredictWorker();
14
 
    spellPredictWorker->moveToThread(m_spellPredictThread);
 
13
    m_spellPredictWorker = new SpellPredictWorker();
 
14
    m_spellPredictWorker->moveToThread(m_spellPredictThread);
15
15
 
16
 
    connect(spellPredictWorker, SIGNAL(newSpellingSuggestions(QString, QStringList)), this, SIGNAL(newSpellingSuggestions(QString, QStringList)));
17
 
    connect(spellPredictWorker, SIGNAL(newPredictionSuggestions(QString, QStringList)), this, SIGNAL(newPredictionSuggestions(QString, QStringList)));
18
 
    connect(this, SIGNAL(newSpellCheckWord(QString)), spellPredictWorker, SLOT(newSpellCheckWord(QString)));
19
 
    connect(this, SIGNAL(setSpellPredictLanguage(QString)), spellPredictWorker, SLOT(setLanguage(QString)));
20
 
    connect(this, SIGNAL(setSpellCheckLimit(int)), spellPredictWorker, SLOT(setSpellCheckLimit(int)));
21
 
    connect(this, SIGNAL(parsePredictionText(QString, QString)), spellPredictWorker, SLOT(parsePredictionText(QString, QString)));
22
 
    connect(this, SIGNAL(addToUserWordList(QString)), spellPredictWorker, SLOT(addToUserWordList(QString)));
23
 
    connect(this, SIGNAL(addOverride(QString, QString)), spellPredictWorker, SLOT(addOverride(QString, QString)));
 
16
    connect(m_spellPredictWorker, SIGNAL(newSpellingSuggestions(QString, QStringList)), this, SIGNAL(newSpellingSuggestions(QString, QStringList)));
 
17
    connect(m_spellPredictWorker, SIGNAL(newPredictionSuggestions(QString, QStringList)), this, SIGNAL(newPredictionSuggestions(QString, QStringList)));
 
18
    connect(this, SIGNAL(newSpellCheckWord(QString)), m_spellPredictWorker, SLOT(newSpellCheckWord(QString)));
 
19
    connect(this, SIGNAL(setSpellPredictLanguage(QString)), m_spellPredictWorker, SLOT(setLanguage(QString)));
 
20
    connect(this, SIGNAL(setSpellCheckLimit(int)), m_spellPredictWorker, SLOT(setSpellCheckLimit(int)));
 
21
    connect(this, SIGNAL(parsePredictionText(QString, QString)), m_spellPredictWorker, SLOT(parsePredictionText(QString, QString)));
 
22
    connect(this, SIGNAL(addToUserWordList(QString)), m_spellPredictWorker, SLOT(addToUserWordList(QString)));
 
23
    connect(this, SIGNAL(addOverride(QString, QString)), m_spellPredictWorker, SLOT(addOverride(QString, QString)));
24
24
    m_spellPredictThread->start();
25
25
}
26
26
 
27
27
WesternLanguagesPlugin::~WesternLanguagesPlugin()
28
28
{
 
29
    m_spellPredictWorker->deleteLater();
29
30
    m_spellPredictThread->quit();
 
31
    m_spellPredictThread->wait();
30
32
}
31
33
 
32
34
void WesternLanguagesPlugin::predict(const QString& surroundingLeft, const QString& preedit)