Esempio n. 1
0
void LocationCompleter::refreshJobFinished()
{
    LocationCompleterRefreshJob* job = qobject_cast<LocationCompleterRefreshJob*>(sender());
    Q_ASSERT(job);

    // Don't show results of older jobs
    // Also don't open the popup again when it was already closed
    if (!job->isCanceled() && job->timestamp() > m_lastRefreshTimestamp && !m_popupClosed) {
        s_model->setCompletions(job->completions());
        m_lastRefreshTimestamp = job->timestamp();

        showPopup();
        addSuggestions(m_oldSuggestions);

        if (!s_view->currentIndex().isValid() && s_model->index(0, 0).data(LocationCompleterModel::VisitSearchItemRole).toBool()) {
            m_ignoreCurrentChanged = true;
            s_view->setCurrentIndex(s_model->index(0, 0));
            m_ignoreCurrentChanged = false;
        }

        if (qzSettings->useInlineCompletion) {
            emit showDomainCompletion(job->domainCompletion());
        }

        m_originalText = m_locationBar->text();
        s_view->setOriginalText(m_originalText);
    }

    job->deleteLater();
}
Esempio n. 2
0
void LocationCompleter::refreshJobFinished()
{
    LocationCompleterRefreshJob* job = qobject_cast<LocationCompleterRefreshJob*>(sender());
    Q_ASSERT(job);

    // Don't show result of older jobs
    // Also don't open the popup again when it was already closed
    if (job->timestamp() > m_lastRefreshTimestamp && !m_popupClosed) {
        s_model->setCompletions(job->completions());
        m_lastRefreshTimestamp = job->timestamp();

        showPopup();

        if (qzSettings->useInlineCompletion) {
            emit showDomainCompletion(job->domainCompletion());
        }
    }

    job->deleteLater();
}