| 596 | } |
| 597 | |
| 598 | void Application::printDir(const RelevantDir &relevantDir) const |
| 599 | { |
| 600 | const SyncthingDir *const dir = relevantDir.dirObj; |
| 601 | cout << " - " << TextAttribute::Bold; |
| 602 | if (dir->label.isEmpty()) { |
| 603 | cout << dir->id.toLocal8Bit().data() << '\n' << TextAttribute::Reset; |
| 604 | } else { |
| 605 | cout << dir->label.toLocal8Bit().data() << '\n' << TextAttribute::Reset; |
| 606 | if (dir->id != dir->label) { |
| 607 | printProperty("ID", dir->id); |
| 608 | } |
| 609 | } |
| 610 | printProperty("Path", dir->path); |
| 611 | printProperty("Status", dir->statusString()); |
| 612 | if (!dir->paused) { |
| 613 | printProperty("Global", directoryStatusString(dir->globalStats), nullptr, 6); |
| 614 | printProperty("Local", directoryStatusString(dir->localStats), nullptr, 6); |
| 615 | } |
| 616 | printProperty("Last scan time", dir->lastScanTime); |
| 617 | printProperty("Last file time", dir->lastFileTime); |
| 618 | printProperty("Last file name", dir->lastFileName); |
| 619 | printProperty("Shared with", dir->deviceNames.isEmpty() ? dir->deviceIds : dir->deviceNames); |
| 620 | printProperty("Download progress", dir->downloadLabel); |
| 621 | if (!dir->completionByDevice.empty()) { |
| 622 | printProperty("Remote progress", dir->areRemotesUpToDate() ? "all up to date" : "some need bytes"); |
| 623 | for (const auto &completionForDev : dir->completionByDevice) { |
| 624 | printProperty(m_connection.deviceNameOrId(completionForDev.first).toLocal8Bit().data(), |
| 625 | argsToString(dataSizeToString(completionForDev.second.globalBytes - completionForDev.second.needed.bytes), ' ', '/', ' ', |
| 626 | dataSizeToString(completionForDev.second.globalBytes), ' ', '(', static_cast<int>(completionForDev.second.percentage), " %)") |
| 627 | .data(), |
| 628 | nullptr, 6); |
| 629 | } |
| 630 | } |
| 631 | printProperty("Type", dir->dirTypeString()); |
| 632 | printProperty("Ignore permissions", dir->ignorePermissions); |
| 633 | printProperty("Auto-normalize", dir->autoNormalize); |
| 634 | printProperty("Rescan interval", rescanIntervalString(dir->rescanInterval, dir->fileSystemWatcherEnabled)); |
| 635 | if (dir->fileSystemWatcherEnabled) { |
| 636 | printProperty("File watcher delay", dir->fileSystemWatcherDelay, " seconds"); |
| 637 | } |
| 638 | printProperty("Min. free disk percentage", dir->minDiskFreePercentage); |
| 639 | printProperty("Error", dir->globalError); |
| 640 | if (!dir->itemErrors.empty()) { |
| 641 | cout << " Failed items\n"; |
| 642 | for (const SyncthingItemError &error : dir->itemErrors) { |
| 643 | printProperty(" - Message", error.message); |
| 644 | printProperty(" File", error.path); |
| 645 | } |
| 646 | } |
| 647 | cout << '\n'; |
| 648 | } |
| 649 | |
| 650 | void Application::printDev(const SyncthingDev *dev) const |
| 651 | { |
nothing calls this directly
no test coverage detected