Version: 0.5.1 (using KDE 3.5.1, Debian Package 4:3.5.1-2 (testing/unstable)) Compiler: Target: i486-linux-gnu OS: Linux (i686) release 2.6.14-2-k7 How to reproduce: 1) start a search 2) select from the thumbnails of on the resulting search pages 3) clear the selection by clicking on the button 4) scroll down the thumbnail view and find the previous selected page That page is not selected anymore in the thumbnail view. Scrolling a bit the page in the page view is enough to make the page in the thumbnail view selected again.
SVN commit 545855 by pino: Keep (if possible) the selected page really selected in the thumbnail view when toggling a search. BUG: 122788 M +14 -1 thumbnaillist.cpp --- branches/KDE/3.5/kdegraphics/kpdf/ui/thumbnaillist.cpp #545854:545855 @@ -95,8 +95,16 @@ } //BEGIN DocumentObserver inherited methods -void ThumbnailList::notifySetup( const QValueVector< KPDFPage * > & pages, bool /*documentChanged*/ ) +void ThumbnailList::notifySetup( const QValueVector< KPDFPage * > & pages, bool documentChanged ) { + // if there was a widget selected, save its pagenumber to restore + // its selection (if available in the new set of pages) + int prevPage = -1; + if ( !documentChanged && m_selected ) + { + prevPage = m_selected->page()->number(); + } + // delete all the Thumbnails QValueVector<ThumbnailWidget *>::iterator tIt = m_thumbnails.begin(), tEnd = m_thumbnails.end(); for ( ; tIt != tEnd; ++tIt ) @@ -138,6 +146,11 @@ // update total height (asking widget its own height) t->resizeFitWidth( width ); totalHeight += t->heightHint() + 4; + if ( (*pIt)->number() == prevPage ) + { + m_selected = t; + m_selected->setSelected( true ); + } t->show(); }