const wchar_t* LanguageManager::getString(const wchar_t* name) { gcString n(name); LanguageString* temp = findItem(n.c_str()); if (temp) return temp->ustr.c_str(); return name; }
void QMenuData::setItemChecked( int id, bool check ) { QMenuData *parent; QMenuItem *mi = findItem( id, &parent ); if ( mi && (bool)mi->is_checked != check ) { mi->is_checked = check; if ( parent->isPopupMenu && !((QPopupMenu *)parent)->isCheckable() ) ((QPopupMenu *)parent)->setCheckable( TRUE ); parent->menuStateChanged(); } }
QListViewItem *JabberBrowser::findItem(unsigned col, const char *id, QListViewItem *item) { if (item->text(col) == id) return item; for (item = item->firstChild(); item; item = item->nextSibling()){ QListViewItem *res = findItem(col, id, item); if (res) return res; } return NULL; }
void browsers::TDTbrowser::OnTELLremovecell(wxString cellname, wxString parentname, bool orphan) { wxTreeItemId newparent; if (orphan) { wxTreeItemId item; findItem(cellname, item, GetRootItem()); copyItem(item,GetRootItem()); item = wxTreeItemId(); assert(findItem(parentname, newparent, GetRootItem())); assert(findItem(cellname, item, newparent)); DeleteChildren(item); Delete(item); } else while (findItem(parentname, newparent, GetRootItem())) { wxTreeItemId item; assert(findItem(cellname, item, newparent)); DeleteChildren(item); Delete(item); } }
void gcThemeManager::newImgHandle(uint32 hash) { m_WaitMutex.lock(); gcImageInfo* h = findItem(hash); if (h) h->incRef(); m_WaitMutex.unlock(); }
HTREEITEM TreePropertySheet::findItem(int page, HTREEITEM start) { while(start != NULL) { if(((int)ctrlTree.GetItemData(start)) == page) return start; HTREEITEM ret = findItem(page, ctrlTree.GetChildItem(start)); if(ret != NULL) return ret; start = ctrlTree.GetNextSiblingItem(start); } return NULL; }
/*! Sets the parameter of the activation signal of item \a id to \a param. If any receiver takes an integer parameter, this value is passed. \sa connectItem(), disconnectItem(), itemParameter() */ bool QMenuData::setItemParameter( int id, int param ) { QMenuItem *mi = findItem( id ); if ( !mi ) // no such identifier return FALSE; if ( !mi->signal_data ) { // create new signal mi->signal_data = new QSignal; CHECK_PTR( mi->signal_data ); } mi->signal_data->setParameter( param ); return TRUE; }
void ConfigPage::resourceDeleted( Resource *resource ) { kDebug() << resource->resourceName(); ConfigViewItem *item = findItem( resource ); if ( !item ) { return; } delete item; }
void IngredientCheckListView::load( int limit, int offset ) { IngredientListView::load(limit,offset); for ( QList<Element>::const_iterator ing_it = m_selections.constBegin(); ing_it != m_selections.constEnd(); ++ing_it ) { Q3CheckListItem * item = ( Q3CheckListItem* ) findItem( QString::number( (*ing_it).id ), 1 ); if ( item ) { item->setOn(true); } } }
void DPReproter::getName(uint32 id, char* buff, uint32 size) { std::lock_guard<std::mutex> guard(m_MapLock); DPProvider* item = findItem(id); if (item) { const char* name = item->getName(); Safe::strncpy(buff, size, name, size); } }
void browsers::TDTbrowser::OnTELLopencell(wxString open_cell) { wxTreeItemId item; assert(findItem(open_cell, item, GetRootItem())); highlightChlidren(GetRootItem(), *wxLIGHT_GREY); // if (top_structure.IsOk()) // SetItemFont(active_structure,_llfont_normal); top_structure = active_structure = item; highlightChlidren(top_structure, *wxBLACK); SetItemTextColour(active_structure,*wxBLUE); // SetItemFont(active_structure,_llfont_bold); }
int UIServer::open_SkipDlg(int id, int /*bool*/ multi, const QString &error_text) { // Hide existing dialog box if any ProgressItem *item = findItem(id); if(item) setItemVisible(item, false); kdDebug(7024) << "Calling KIO::open_SkipDlg" << endl; KIO::SkipDlg_Result result = KIO::open_SkipDlg((bool)multi, error_text); if(item && result != KIO::S_CANCEL) setItemVisible(item, true); return (KIO::SkipDlg_Result)result; }
esp_err_t Storage::findItem(uint8_t nsIndex, ItemType datatype, const char* key, Page* &page, Item& item) { for (auto it = std::begin(mPageManager); it != std::end(mPageManager); ++it) { size_t itemIndex = 0; auto err = it->findItem(nsIndex, datatype, key, itemIndex, item); if (err == ESP_OK) { page = it; return ESP_OK; } } return ESP_ERR_NVS_NOT_FOUND; }
void KPopupMenu::changeTitle(int id, const QPixmap &icon, const QString &text) { QMenuItem *item = findItem(id); if(item){ if(item->widget()) ((KPopupTitle *)item->widget())->setTitle(text, &icon); else qWarning("KPopupMenu: changeTitle() called with non-title id %d.", id); } else qWarning("KPopupMenu: changeTitle() called with invalid id %d.", id); }
void KSim::MonitorPrefs::saveConfig(KSim::Config *config) { TQCheckListItem *item; TQStringList::ConstIterator it; for (it = m_locatedFiles.begin(); it != m_locatedFiles.end(); ++it) { KSim::PluginInfo info = KSim::PluginLoader::self().findPluginInfo((*it)); item = static_cast<TQCheckListItem *>(findItem(info.name(), 0)); config->setEnabledMonitor(info.libName(), item->isOn()); config->setMonitorCommand(info.libName(), item->text(2)); config->setMonitorLocation(info.libName(), itemIndex(item)); } }
bool ToolManager::areAllToolsInstalled(std::vector<DesuraId> &list) { for (size_t x=0; x<list.size(); x++) { ToolInfo* info = findItem(list[x].toInt64()); if (!info || !info->isInstalled()) return false; } return true; }
void IndexBox::removeIndexItem(IndexItemProto *item) { QString text = item->text(); items[text].remove(item); if (items[text].count() == 0) { items.remove(text); QListBoxItem *item = findItem(text, Qt::CaseSensitive | Qt::ExactMatch); if (item) delete item; } }
void ToolbarEditor::setActiveActions(QList<QAction *> actions_list) { populateList(active_actions_list, actions_list, true); // Delete actions from the "all list" which are in the active list for (int n = 0; n < active_actions_list->count(); n++) { int row = findItem( active_actions_list->item(n)->data(Qt::UserRole).toString(), all_actions_list ); if (row > -1) { qDebug("found: %s", active_actions_list->item(n)->data(Qt::UserRole).toString().toUtf8().constData()); all_actions_list->takeItem(row); } } }
void ConfigPage::resourceModified( Resource *resource ) { kDebug() << resource->resourceName(); ConfigViewItem *item = findItem( resource ); if ( !item ) { return; } // TODO: Reread resource config. Otherwise we won't see the modification. item->updateItem(); }
void Navigator::upDirectory () { QString s = currentDir.dirName(); if (s == "data" || s == "group") return; currentDir.cdUp(); updateList(); setCurrentItem(findItem(s, Q3ListBox::ExactMatch)); ensureCurrentVisible(); emit noSelection(); selectedFlag = FALSE; }
// поиск узла с ключем key Leaf* findItem(Leaf* cur, int key) { if (cur) // узел существует { if (int(*cur) == key) // узел найден { return cur; } else if (int(*cur) < key) // узел должен быть в правой ветви { return findItem(cur->right, key); } else // иначе он в левой { return findItem(cur->left, key); } } else { return NULL; // узел не был найден } }
// static void LLSidepanelItemInfo::onClickOwner() { LLViewerInventoryItem* item = findItem(); if(!item) return; if(item->getPermissions().isGroupOwned()) { LLGroupActions::show(item->getPermissions().getGroup()); } else { LLAvatarActions::showProfile(item->getPermissions().getOwner()); } }
QVector<TagModelItem *> TagFilterModel::findItems(const QSet<QString> &tags) { QVector<TagModelItem *> items; items.reserve(tags.size()); for (const QString &tag : tags) { TagModelItem *item = findItem(tag); if (item) items.push_back(item); else qWarning() << QString("Requested tag '%1' missing from the model.").arg(tag); } return items; }
void PopUpDialog::handleMouseMoved(int x, int y, int button) { // Compute over which item the mouse is... int item = findItem(x, y); if (item >= 0 && _popUpBoss->_entries[item].name.size() == 0) item = -1; if (item == -1 && !isMouseDown()) return; // ...and update the selection accordingly setSelection(item); }
void CVarManager::loadFromDb(sqlite3x::sqlite3_reader &reader) { while (reader.read()) { std::string name = reader.getstring(0); std::string value = reader.getstring(1); CVar* temp = findItem(name.c_str()); if (temp) temp->setValueOveride(value.c_str()); } }
// static void LLFloaterProperties::onClickOwner() { LLInventoryItem* item = findItem(); if(!item) return; if(item->getPermissions().isGroupOwned()) { LLGroupActions::show(item->getPermissions().getGroup()); } else { LLAvatarActions::showProfile(item->getPermissions().getOwner()); } }
void QMenuData::setItemEnabled( int id, bool enable ) { QMenuData *parent; QMenuItem *mi = findItem( id, &parent ); if ( mi && (bool)mi->is_enabled != enable ) { mi->is_enabled = enable; #ifndef QT_NO_ACCEL if ( mi->popup() ) mi->popup()->enableAccel( enable ); #endif parent->menuStateChanged(); } }
bool QMenuData::connectItem( int id, const QObject *receiver, const char* member ) { QMenuItem *mi = findItem( id ); if ( !mi ) // no such identifier return FALSE; if ( !mi->signal_data ) { // create new signal mi->signal_data = new QSignal; CHECK_PTR( mi->signal_data ); mi->signal_data->setParameter( id ); } return mi->signal_data->connect( receiver, member ); }
void Workspace::activeFormChanged( FormWindow *fw ) { WorkspaceItem *i = findItem( fw->formFile() ); if ( i ) { setCurrentItem( i ); setSelected( i, TRUE ); if ( !i->isOpen() ) i->setAutoOpen( TRUE ); } closeAutoOpenItems(); }
int KexiRelationsTableFieldList::globalY(const QString &item) { Q3ListViewItem *i = findItem(item, 0); if (!i) return -1; int y = itemRect(i).y() + (itemRect(i).height() / 2); if (contentsY() > itemPos(i)) y = 0; else if (y == 0) y = height(); return mapToGlobal(QPoint(0, y)).y(); }