From 13be18b60b21d74d15b38ffdd8c139348c28a1ff Mon Sep 17 00:00:00 2001 From: Jean-Francois Dockes Date: Tue, 6 Aug 2019 18:40:08 +0200 Subject: [PATCH] restore restable highlight fix, lost in git maze --- src/qtgui/restable.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/qtgui/restable.cpp b/src/qtgui/restable.cpp index 22dc3ed8..99a84e05 100644 --- a/src/qtgui/restable.cpp +++ b/src/qtgui/restable.cpp @@ -290,11 +290,13 @@ void RecollModel::readDocSource() void RecollModel::setDocSource(std::shared_ptr nsource) { LOGDEB("RecollModel::setDocSource\n"); - m_source = nsource; - if (m_source) { - m_source->getTerms(m_hdata); + if (!nsource) { + m_source = std::shared_ptr(); } else { - m_hdata.clear(); + // We used to allocate a new DocSource here instead of sharing + // the input, but I can't see why. + m_source = nsource; + m_hdata.clear(); } } @@ -770,6 +772,7 @@ void ResTable::readDocSource(bool resetPos) if (resetPos) tableView->verticalScrollBar()->setSliderPosition(0); + m_model->m_source->getTerms(m_model->m_hdata); m_model->readDocSource(); m_detail->clear(); m_detaildocnum = -1;