/* BrowserCanvas::lookForSearchEntryFrom * Used by BrowserCanvas::onKeyChar, returns true if an item matching * [search] is found (starting from [from]), false otherwise *******************************************************************/ bool BrowserCanvas::searchItemFrom(int from) { int index = from; bool looped = false; bool gotmatch = false; while ((!looped && index < (int)items_filter.size()) || (looped && index < from)) { string name = items[items_filter[index]]->getName(); if (name.Upper().StartsWith(search)) { // Matches, update selection selectItem(index); showSelectedItem(); return true; } // No match, next item; look in the above entries // if no matches were found below. if (++index == items_filter.size() && !looped) { looped = true; index = 0; } } // Didn't get any match return false; }
void PlaylistModel::itemViewDoubleClicked(const QModelIndex &img_index) { Q_UNUSED(img_index); showSelectedItem(); }