| 389 | } |
| 390 | |
| 391 | void Application::requestRescan(const ArgumentOccurrence &occurrence) |
| 392 | { |
| 393 | if (!m_argsRead) { |
| 394 | initDirCompletion(m_args.rescan, occurrence); |
| 395 | return; |
| 396 | } |
| 397 | if (!waitForConfig()) { |
| 398 | return; |
| 399 | } |
| 400 | |
| 401 | m_connection.applyRawConfig(); |
| 402 | m_expectedResponse = 0; |
| 403 | connect(&m_connection, &SyncthingConnection::rescanTriggered, this, &Application::handleResponse); |
| 404 | for (const char *value : occurrence.values) { |
| 405 | const QString dirIdentifier(argToQString(value)); |
| 406 | const RelevantDir relevantDir(findDirectory(dirIdentifier)); |
| 407 | if (!relevantDir.dirObj) { |
| 408 | continue; |
| 409 | } |
| 410 | relevantDir.notifyAboutRescan(); |
| 411 | m_connection.rescan(relevantDir.dirObj->id, relevantDir.subDir); |
| 412 | ++m_expectedResponse; |
| 413 | } |
| 414 | if (!m_expectedResponse) { |
| 415 | cerr << Phrases::Error << "No (valid) folders specified." << Phrases::End << flush; |
| 416 | exit(1); |
| 417 | } |
| 418 | cerr << flush; |
| 419 | } |
| 420 | |
| 421 | void Application::requestRescanAll(const ArgumentOccurrence &) |
| 422 | { |
nothing calls this directly
no test coverage detected