search engine: fix error occuring while trying to select first album in results

This commit is contained in:
Andrzej Rybczak
2011-01-09 10:21:25 +01:00
parent e42c1c1729
commit 07c540e67e
2 changed files with 13 additions and 1 deletions

View File

@@ -279,6 +279,12 @@ namespace NCurses
///
bool isStatic(int pos = -1) const;
/// Checks whether given position is separator
/// @param pos position to be checked, -1 checks currently highlighted position
/// @return true if position is separator, false otherwise
///
bool isSeparator(int pos = -1) const;
/// Selects/deselects given position
/// @param pos position in list
/// @param state state of selection
@@ -956,6 +962,12 @@ template <typename T> bool NCurses::Menu<T>::isStatic(int pos) const
return (*itsOptionsPtr)[pos]->isStatic;
}
template <typename T> bool NCurses::Menu<T>::isSeparator(int pos) const
{
pos = pos == -1 ? itsHighlight : pos;
return !itsOptionsPtr->at(pos);
}
template <typename T> bool NCurses::Menu<T>::hasSelected() const
{
for (option_const_iterator it = itsOptionsPtr->begin(); it != itsOptionsPtr->end(); ++it)