Esempio n. 1
0
    MultiPlanStage::~MultiPlanStage() {
        if (bestPlanChosen()) {
            delete _candidates[_bestPlanIdx].root;

            // for now, the runner that executes this multi-plan-stage wants to own
            // the query solution for the best plan.  So we won't delete it here.
            // eventually, plan stages may own their query solutions.
            // 
            // delete _candidates[_bestPlanIdx].solution; // (owned by containing runner)

            if (hasBackupPlan()) {
                delete _candidates[_backupPlanIdx].solution;
                delete _candidates[_backupPlanIdx].root;
            }

            // Clean up the losing candidates.
            clearCandidates();
        }
        else {
            for (size_t ix = 0; ix < _candidates.size(); ++ix) {
                delete _candidates[ix].solution;
                delete _candidates[ix].root;
            }
        }

        for (vector<PlanStageStats*>::iterator it = _candidateStats.begin();
             it != _candidateStats.end();
             ++it) {
            delete *it;
        }
    }
Esempio n. 2
0
void CandidateWindowProxy::setCandidates(int dl,
        const QList<uim_candidate> &candidates)
{
#ifdef ENABLE_DEBUG
    qDebug("setCandidates");
#endif

    // remove old data
    if (!stores.isEmpty())
        clearCandidates();

    // set defalt value
    candidateIndex = -1;
    nrCandidates = candidates.count();
    displayLimit = dl;

    if (candidates.isEmpty())
        return;

    // set candidates
    stores = candidates;

    // shift to default page
    setPage(0);
}
Esempio n. 3
0
void WordRibbon::onWordCandidatesChanged(const WordCandidateList &candidates)
{
    clearCandidates();

    for (int index = 0; index < candidates.count(); ++index) {
        WordCandidate word_candidate(candidates.at(index));
        appendCandidate(word_candidate);
    }
}
Esempio n. 4
0
void CandidateWindowProxy::deactivateCandwin()
{
#ifdef UIM_QT_USE_DELAY
    m_delayTimer->stop();
#endif /* !UIM_QT_USE_DELAY */

    execute("hide");
    clearCandidates();
}
//! \brief Set whether the engine should be enabled.
//! \param enabled Setting to true will be ignored if there's no word
//!                prediction or error correction backend available.
//! \sa AbstractWordEngine::enabled
void AbstractWordEngine::setEnabled(bool enabled)
{
    Q_D(AbstractWordEngine);

    if (d->enabled != enabled) {
        clearCandidates();
        d->enabled = enabled;
        Q_EMIT enabledChanged(isEnabled());
    }
}
Esempio n. 6
0
void CandidateBar::commit(const QString & text)
{
    if (m_enabled)
    {
        if (text.size() > 0)
            m_IMEDataInterface->setComposingText(text.toUtf8().data());
        m_IMEDataInterface->commitComposingText();
        m_taps.clear();
        m_firstKey = Qt::Key(0);
    }
    clearCandidates();
}
Esempio n. 7
0
void CandidateWindowProxy::setNrCandidates(int nrCands, int dLimit)
{
#ifdef ENABLE_DEBUG
    qDebug("setNrCandidates");
#endif

    // remove old data
    if (!stores.isEmpty())
        clearCandidates();

    candidateIndex = -1;
    displayLimit = dLimit;
    nrCandidates = nrCands;
    pageIndex = 0;

    // setup dummy candidate
    for (int i = 0; i < nrCandidates; i++)
        stores.append(0);

    execute("setup_sub_window");
}
Esempio n. 8
0
void WordRibbon::setWordRibbonVisible(bool visible)
{
    Q_UNUSED(visible);
    clearCandidates();
}
Esempio n. 9
0
void CandidateBar::setEditorState(const PalmIME::EditorState & editorState)
{
    clearCandidates();
    m_traceAllowed = (editorState.type == PalmIME::FieldType_Text);
}