int WMenu::nextAfterHide(int index) { if (current_ == index) { // Try to find visible item to the right of the current. for (int i = current_ + 1; i < count(); ++i) if (!isItemHidden(i) && itemAt(i)->isEnabled()) return i; // Try to find visible item to the left of the current. for (int i = current_ - 1; i >= 0; --i) if (!isItemHidden(i) && itemAt(i)->isEnabled()) return i; } return current_; }
/** * Provides the titles. * Only for the checked ones. */ MAUtil::Vector<MAUtil::String> MediaWiki::getAllCheckedTitles() { MAUtil::Vector<MAUtil::String> list; for (int i=0; i < mWiki->titleResults.size(); i++) { if ( !isItemHidden(i) ) { list.add(mWiki->titleResults[i]); } } return list; }
/** * Provides the snippets along with the title. * Only for the checked ones. */ MAUtil::Vector<MAUtil::String> MediaWiki::getAllSnippetsWithTitle() { MAUtil::Vector<MAUtil::String> list; for (int i=0; i < mWiki->titleResults.size(); i++) { if ( !isItemHidden(i) ) { // Each entry has title and the corresponding snippet. MAUtil::String line = mWiki->titleResults[i] + "\n" + mWiki->snippetResults[i] ; list.add(line); } } return list; }
bool WMenu::isItemHidden(int index) const { return isItemHidden(itemAt(index)); }