void ICQSearchResult::clear() { setRequestId(SEARCH_DONE, SEARCH_DONE); m_nFound = 0; tblUser->clear(); QWizard *wizard = static_cast<QWizard*>(topLevelWidget()); wizard->setFinishEnabled(this, false); }
Packet_v1::Packet_v1(field_t componentId, field_t requestId) :Packet() { setProtoVersion(PROTOV1); setLen(PROTOV1_START_OF_DATA); setComponentId(componentId); setRequestId(requestId); }
static Ref<Inspector::Protocol::Page::SearchResult> buildObjectForSearchResult(const String& requestId, const String& frameId, const String& url, int matchesCount) { auto searchResult = Inspector::Protocol::Page::SearchResult::create() .setUrl(url) .setFrameId(frameId) .setMatchesCount(matchesCount) .release(); searchResult->setRequestId(requestId); return searchResult; }
void *ICQSearchResult::processEvent(Event *e) { if ((e->type() > EventUser) && ((m_id1 != SEARCH_DONE) || (m_id2 != SEARCH_DONE))){ if (e->type() == EventSearch){ SearchResult *result = (SearchResult*)(e->param()); if ((result->client == m_client) && ( (result->id == m_id1) || (result->id == m_id2))){ new UserTblItem(tblUser, m_client, &result->data); m_nFound++; setStatus(); } } if (e->type() == EventSearchDone){ SearchResult *result = (SearchResult*)(e->param()); if (result->client == m_client){ if (result->id == m_id1) setRequestId(SEARCH_DONE, m_id2); if (result->id == m_id2) setRequestId(m_id1, SEARCH_DONE); } } } if (e->type() == EventCommandExec){ CommandDef *cmd = (CommandDef*)(e->param()); if (cmd->menu_id == MenuSearchResult){ Contact *contact; if (cmd->id == CmdIcqSendMessage){ contact = createContact(CONTACT_TEMP); if (!contact) return NULL; Message *msg = new Message(MessageGeneric); msg->setContact(contact->id()); Event e(EventOpenMessage, &msg); e.process(); delete msg; } if (cmd->id == CmdInfo){ contact = createContact(CONTACT_TEMP); if (!contact) return NULL; m_client->addFullInfoRequest(atol(tblUser->currentItem()->text(0).latin1()), true); Command cmd; cmd->id = CmdInfo; cmd->menu_id = MenuContact; cmd->param = (void*)contact->id(); Event e(EventCommandExec, cmd); e.process(); } return e->param(); } if (cmd->menu_id == MenuIcqGroups){ Contact *contact = createContact(0); if (!contact) return NULL; contact->setGroup(cmd->id - 1); Event eContact(EventContactChanged, contact); eContact.process(); return e->param(); } } if (e->type() == EventCheckState){ CommandDef *cmd = (CommandDef*)(e->param()); if ((cmd->menu_id == MenuIcqGroups) && (cmd->id == CmdGroups)){ unsigned n = 1; ContactList::GroupIterator it; while (++it) n++; CommandDef *cmds = new CommandDef[n]; memset(cmds, 0, sizeof(CommandDef) * n); n = 0; it.reset(); Group *grp; while ((grp = ++it) != NULL){ cmds[n].id = grp->id() + 1; cmds[n].text = "_"; QString name = grp->getName(); if (grp->id() == 0) name = i18n("Not in list"); cmds[n].text_wrk = strdup(name.utf8()); n++; } cmd->param = cmds; cmd->flags |= COMMAND_RECURSIVE; return e->param(); } } return NULL; }
void ICQSearchResult::clear() { setRequestId(SEARCH_DONE); m_nFound = 0; tblUser->clear(); }
void ICQSearchResult::clear() { setRequestId(0); m_nFound = 0; tblUser->clear(); }