| 4209 | } |
| 4210 | |
| 4211 | void EventBrowser::FindNext(bool forward) |
| 4212 | { |
| 4213 | if(!m_Ctx.IsCaptureLoaded()) |
| 4214 | return; |
| 4215 | |
| 4216 | m_Model->SetFindText(ui->findEvent->text()); |
| 4217 | |
| 4218 | // get the first result in this direction |
| 4219 | QModelIndex firstResult = m_Model->Find(forward, m_Model->GetCurrentEID()); |
| 4220 | |
| 4221 | bool forceNone = false; |
| 4222 | |
| 4223 | // we got a result but it might be filtered out. This also means that for EID selects we'll jump |
| 4224 | // to the next visible EID |
| 4225 | if(firstResult.isValid()) |
| 4226 | { |
| 4227 | QModelIndex result = firstResult; |
| 4228 | QModelIndex mappedResult = m_FilterModel->mapFromSource(result); |
| 4229 | |
| 4230 | // loop if we have a valid result but it's invalid when mapped (i.e. filtered out) |
| 4231 | while(result.isValid() && !mappedResult.isValid()) |
| 4232 | { |
| 4233 | // get the next result in this direction. If we're doing an EID search, step EID-wise |
| 4234 | if(m_Model->FindEIDSearch()) |
| 4235 | result = m_Model->GetIndexForEID(result.data(ROLE_SELECTED_EID).toUInt() + 1); |
| 4236 | else |
| 4237 | result = m_Model->Find(forward, result); |
| 4238 | |
| 4239 | // if we've looped around or somehow get an invalid result, break |
| 4240 | if(!result.isValid() || result == firstResult) |
| 4241 | break; |
| 4242 | |
| 4243 | // map it |
| 4244 | mappedResult = m_FilterModel->mapFromSource(result); |
| 4245 | |
| 4246 | // the loop condition will break if we got a mapped result |
| 4247 | } |
| 4248 | |
| 4249 | // if we got a valid visible result, select it |
| 4250 | if(mappedResult.isValid()) |
| 4251 | { |
| 4252 | SelectEvent(m_FilterModel->mapFromSource(result)); |
| 4253 | } |
| 4254 | else |
| 4255 | { |
| 4256 | // otherwise tell the results below that there are no visible results, even though there might |
| 4257 | // be some that are filtered out |
| 4258 | forceNone = true; |
| 4259 | } |
| 4260 | } |
| 4261 | |
| 4262 | updateFindResultsAvailable(forceNone); |
| 4263 | } |
| 4264 | |
| 4265 | void EventBrowser::CreateFilterDialog() |
| 4266 | { |
nothing calls this directly
no test coverage detected