| 261 | } // namespace |
| 262 | |
| 263 | std::tuple<QDateTime, QString, QString, QString, QString> read_lock_File(const QString& path) |
| 264 | { |
| 265 | auto contents = QString(FS::read(path)); |
| 266 | auto lines = contents.split('\n'); |
| 267 | |
| 268 | QDateTime timestamp; |
| 269 | QString from, to, target, data_path; |
| 270 | for (auto line : lines) { |
| 271 | auto index = line.indexOf("="); |
| 272 | if (index < 0) |
| 273 | continue; |
| 274 | auto left = line.left(index); |
| 275 | auto right = line.mid(index + 1); |
| 276 | if (left.toLower() == "timestamp") { |
| 277 | timestamp = QDateTime::fromString(right, Qt::ISODate); |
| 278 | } else if (left.toLower() == "from") { |
| 279 | from = right; |
| 280 | } else if (left.toLower() == "to") { |
| 281 | to = right; |
| 282 | } else if (left.toLower() == "target") { |
| 283 | target = right; |
| 284 | } else if (left.toLower() == "data_path") { |
| 285 | data_path = right; |
| 286 | } |
| 287 | } |
| 288 | return std::make_tuple(timestamp, from, to, target, data_path); |
| 289 | } |
| 290 | |
| 291 | Application::Application(int& argc, char** argv) : QApplication(argc, argv) |
| 292 | { |
no test coverage detected