From ee43d68ffd4d296e91ecde67b1694a60b0732f74 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Mon, 2 Sep 2024 12:38:22 +0200 Subject: [PATCH] Utils: Silence watch() warnings if path does not exist Change-Id: I3764f16f96688a881391c2a026d34174a2ae039f Reviewed-by: Christian Stenger --- src/libs/utils/devicefileaccess.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index 495fb70417c..847862e5ebe 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -473,7 +473,7 @@ class DesktopFilePathWatcher final : public FilePathWatcher if (it == m_watchClients.end()) { QMetaObject::invokeMethod(&m_watcher, [this, path] { bool res = m_watcher.addPath(path.path()); - QTC_CHECK(res); + QTC_CHECK(res || !path.exists()); }); it = m_watchClients.emplace(path); } @@ -489,7 +489,7 @@ class DesktopFilePathWatcher final : public FilePathWatcher if (it->size() == 0) { QMetaObject::invokeMethod(&m_watcher, [this, path] { bool res = m_watcher.removePath(path.path()); - QTC_CHECK(res); + QTC_CHECK(res || !path.exists()); }); m_watchClients.erase(it);