X-Git-Url: http://code.vuplus.com/gitweb/?a=blobdiff_plain;f=lib%2Fgui%2Felistbox.cpp;h=5b05c028151a953d508bea32d642a6d37ff4afda;hb=4c2cba9ccb6f754aac9378e2fc2c7b546e6d589c;hp=6b2eace412f670e7d05d7a7c67b2b9dddfb1296f;hpb=994dad35e90a0023acd62c6b434b5728c0f15d1e;p=vuplus_dvbapp diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp index 6b2eace..5b05c02 100644 --- a/lib/gui/elistbox.cpp +++ b/lib/gui/elistbox.cpp @@ -54,16 +54,10 @@ void eListbox::setWrapAround(bool state) void eListbox::setContent(iListboxContent *content) { - int oldsel = m_selected; m_content = content; if (content) m_content->setListbox(this); entryReset(); - /* if oldsel != m_selected, selectionChanged was already - emitted in entryReset. we want it in any case, so otherwise, - emit it now. */ - if (oldsel == m_selected) - /* emit */ selectionChanged(); } bool eListbox::atBegin() @@ -457,6 +451,7 @@ void eListbox::entryReset(bool selectionHome) { m_content_changed = true; m_prev_scrollbar_page = -1; + int oldsel; if (selectionHome) { @@ -473,10 +468,15 @@ void eListbox::entryReset(bool selectionHome) else m_selected = 0; m_content->cursorSet(m_selected); - selectionChanged(); } + oldsel = m_selected; moveSelection(justCheck); + /* if oldsel != m_selected, selectionChanged was already + emitted in moveSelection. we want it in any case, so otherwise, + emit it now. */ + if (oldsel == m_selected) + /* emit */ selectionChanged(); invalidate(); }