* Called when the watch timer times out, i.e. when modifying the file or directory * presumably has finished. Also see LiveDataSource::setUpdateType(). */
| 455 | * presumably has finished. Also see LiveDataSource::setUpdateType(). |
| 456 | */ |
| 457 | void LiveDataSource::readOnUpdate() { |
| 458 | DEBUG(Q_FUNC_INFO) |
| 459 | if (!m_fileSystemWatcher->files().contains(m_fileName)) { |
| 460 | m_fileSystemWatcher->addPath(m_fileName); |
| 461 | QFileInfo file(m_fileName); |
| 462 | if (m_fileSystemWatcher->files().contains(m_fileName)) |
| 463 | m_fileSystemWatcher->removePath(file.absolutePath()); |
| 464 | else { |
| 465 | m_fileSystemWatcher->addPath(file.absolutePath()); |
| 466 | return; |
| 467 | } |
| 468 | } |
| 469 | if (m_paused) |
| 470 | // flag file for reading, once the user decides to continue reading |
| 471 | m_pending = true; |
| 472 | else |
| 473 | read(); |
| 474 | |
| 475 | Q_EMIT readOnUpdateCalled(); |
| 476 | } |
| 477 | |
| 478 | void LiveDataSource::initDevice() { |
| 479 | switch (m_sourceType) { |
nothing calls this directly
no test coverage detected