! * \brief Returns the "sync complete" notification message for the specified directories. */
| 80 | * \brief Returns the "sync complete" notification message for the specified directories. |
| 81 | */ |
| 82 | QString syncCompleteString(const std::vector<const SyncthingDir *> &completedDirs, const SyncthingDev *remoteDevice) |
| 83 | { |
| 84 | const auto devName(remoteDevice ? remoteDevice->displayName() : QString()); |
| 85 | switch (completedDirs.size()) { |
| 86 | case 0: |
| 87 | return QString(); |
| 88 | case 1: |
| 89 | if (devName.isEmpty()) { |
| 90 | return QCoreApplication::translate("Data::Utils", "Synchronization of local folder %1 complete") |
| 91 | .arg(completedDirs.front()->displayName()); |
| 92 | } |
| 93 | return QCoreApplication::translate("Data::Utils", "Synchronization of %1 on %2 complete").arg(completedDirs.front()->displayName(), devName); |
| 94 | default:; |
| 95 | } |
| 96 | const auto names(things(completedDirs, [](const auto *dir) { return dir->displayName(); })); |
| 97 | if (devName.isEmpty()) { |
| 98 | return QCoreApplication::translate("Data::Utils", "Synchronization of the following local folders complete:\n") |
| 99 | + names.join(QStringLiteral(", ")); |
| 100 | } |
| 101 | return QCoreApplication::translate("Data::Utils", "Synchronization of the following folders on %1 complete:\n").arg(devName) |
| 102 | + names.join(QStringLiteral(", ")); |
| 103 | } |
| 104 | |
| 105 | /*! |
| 106 | * \brief Returns the string representation of the specified \a rescanInterval. |
no test coverage detected