MCPcopy Create free account
hub / github.com/Martchus/syncthingtray / requestRescan

Method requestRescan

cli/application.cpp:391–419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

389}
390
391void 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
421void Application::requestRescanAll(const ArgumentOccurrence &)
422{

Callers

nothing calls this directly

Calls 4

argToQStringFunction · 0.85
applyRawConfigMethod · 0.80
notifyAboutRescanMethod · 0.80
rescanMethod · 0.80

Tested by

no test coverage detected