| 271 | } |
| 272 | |
| 273 | void RamSearchWindow::slotNew() |
| 274 | { |
| 275 | if (isSearching) |
| 276 | return; |
| 277 | |
| 278 | if (context->status != Context::ACTIVE) |
| 279 | return; |
| 280 | |
| 281 | /* If there are results, then clear the current scan and enable all boxes */ |
| 282 | if (ramSearchModel->scanSize() > 0) { |
| 283 | newButton->setText(tr("New")); |
| 284 | memGroupBox->setDisabled(false); |
| 285 | formatGroupBox->setDisabled(false); |
| 286 | ramSearchModel->clear(); |
| 287 | watchCount->setText(""); |
| 288 | searchProgress->reset(); |
| 289 | searchButton->setDisabled(true); |
| 290 | return; |
| 291 | } |
| 292 | |
| 293 | isSearching = true; |
| 294 | |
| 295 | /* Disable buttons during the process */ |
| 296 | newButton->setDisabled(true); |
| 297 | searchButton->setDisabled(true); |
| 298 | stopButton->setDisabled(false); |
| 299 | |
| 300 | /* Build the memory region flag variable */ |
| 301 | int memflags = 0; |
| 302 | if (memSpecialBox->isChecked()) |
| 303 | memflags |= MemSection::MemNoSpecial; |
| 304 | if (memROBox->isChecked()) |
| 305 | memflags |= MemSection::MemNoRO; |
| 306 | if (memExecBox->isChecked()) |
| 307 | memflags |= MemSection::MemNoExec; |
| 308 | |
| 309 | searchProgress->reset(); |
| 310 | searchProgress->setMaximum(ramSearchModel->predictScanCount(memflags)); |
| 311 | |
| 312 | /* Start the actual scan search on a thread */ |
| 313 | std::thread t(&RamSearchWindow::threadedNew, this, memflags); |
| 314 | t.detach(); |
| 315 | } |
| 316 | |
| 317 | void RamSearchWindow::threadedNew(int memflags) |
| 318 | { |
nothing calls this directly
no test coverage detected