| 397 | } |
| 398 | |
| 399 | void RamSearchWindow::threadedSearch() |
| 400 | { |
| 401 | CompareType compare_type; |
| 402 | CompareOperator compare_operator; |
| 403 | MemValueType compare_value; |
| 404 | MemValueType different_value; |
| 405 | getCompareParameters(compare_type, compare_operator, compare_value, different_value); |
| 406 | |
| 407 | int err = ramSearchModel->searchWatches(compare_type, compare_operator, compare_value, different_value); |
| 408 | |
| 409 | if (err < 0) |
| 410 | searchProgress->reset(); |
| 411 | |
| 412 | switch (err) { |
| 413 | case MemScannerThread::ESTOPPED: |
| 414 | watchCount->setText(tr("The search was interupted by the user")); |
| 415 | break; |
| 416 | case MemScannerThread::EOUTPUT: |
| 417 | watchCount->setText(tr("The search results could not be written to disk")); |
| 418 | break; |
| 419 | case MemScannerThread::EINPUT: |
| 420 | watchCount->setText(tr("The previous search results could not be read correctly")); |
| 421 | break; |
| 422 | case MemScannerThread::EPROCESS: |
| 423 | watchCount->setText(tr("There was an error in the search process")); |
| 424 | break; |
| 425 | default: |
| 426 | /* Don't display values if too many results */ |
| 427 | if ((ramSearchModel->memscanner.display_scan_count() == 0) && (ramSearchModel->scanCount() != 0)) |
| 428 | watchCount->setText(QString("%1 addresses (results are not shown above %2)").arg(ramSearchModel->scanCount()).arg(ramSearchModel->memscanner.DISPLAY_THRESHOLD)); |
| 429 | else |
| 430 | watchCount->setText(QString("%1 addresses").arg(ramSearchModel->scanCount())); |
| 431 | break; |
| 432 | } |
| 433 | |
| 434 | /* Change the button to "New" if no results */ |
| 435 | if (ramSearchModel->scanCount() == 0 || err < 0) { |
| 436 | newButton->setText(tr("New")); |
| 437 | memGroupBox->setDisabled(false); |
| 438 | formatGroupBox->setDisabled(false); |
| 439 | searchButton->setDisabled(true); |
| 440 | } |
| 441 | |
| 442 | newButton->setDisabled(false); |
| 443 | searchButton->setDisabled(false); |
| 444 | stopButton->setDisabled(true); |
| 445 | |
| 446 | isSearching = false; |
| 447 | } |
| 448 | |
| 449 | void RamSearchWindow::slotAdd() |
| 450 | { |
nothing calls this directly
no test coverage detected