| 187 | } // namespace |
| 188 | |
| 189 | std::tuple<QDateTime, QString, QString, QString, QString> read_lock_File(const QString& path) |
| 190 | { |
| 191 | auto contents = QString(FS::read(path)); |
| 192 | auto lines = contents.split('\n'); |
| 193 | |
| 194 | QDateTime timestamp; |
| 195 | QString from, to, target, data_path; |
| 196 | for (auto line : lines) { |
| 197 | auto index = line.indexOf("="); |
| 198 | if (index < 0) |
| 199 | continue; |
| 200 | auto left = line.left(index); |
| 201 | auto right = line.mid(index + 1); |
| 202 | if (left.toLower() == "timestamp") { |
| 203 | timestamp = QDateTime::fromString(right, Qt::ISODate); |
| 204 | } else if (left.toLower() == "from") { |
| 205 | from = right; |
| 206 | } else if (left.toLower() == "to") { |
| 207 | to = right; |
| 208 | } else if (left.toLower() == "target") { |
| 209 | target = right; |
| 210 | } else if (left.toLower() == "data_path") { |
| 211 | data_path = right; |
| 212 | } |
| 213 | } |
| 214 | return std::make_tuple(timestamp, from, to, target, data_path); |
| 215 | } |
| 216 | |
| 217 | Application::Application(int& argc, char** argv) : QApplication(argc, argv) |
| 218 | { |
no test coverage detected