Skip to content

Commit

Permalink
fix(qml): Do not pass empty list to QFileSystemWatcher::removePaths()
Browse files Browse the repository at this point in the history
This fixes the following runtime warning:

    warning [Main] QFileSystemWatcher::removePaths: list is empty
  • Loading branch information
Holzhaus committed Feb 18, 2024
1 parent df05612 commit 5a792d8
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/qml/qmlautoreload.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,10 @@ void QmlAutoReload::slotFileChanged(const QString& changedFile) {
}

void QmlAutoReload::clear() {
m_fileWatcher.removePaths(m_fileWatcher.files());
const auto files = m_fileWatcher.files();
if (!files.isEmpty()) {
m_fileWatcher.removePaths(files);
}
}

} // namespace qml
Expand Down

0 comments on commit 5a792d8

Please sign in to comment.