From d87cc5a6f6164ed886cf285c04031fe7373c9994 Mon Sep 17 00:00:00 2001 From: Marcus Tillmanns Date: Wed, 18 Sep 2024 08:04:44 +0200 Subject: [PATCH] Utils: Fix watch return value Change-Id: If6c50e4e4b74a63dd9b669ce43af4ddeb3520767 Reviewed-by: Christian Stenger Reviewed-by: Eike Ziller --- src/libs/utils/devicefileaccess.cpp | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/libs/utils/devicefileaccess.cpp b/src/libs/utils/devicefileaccess.cpp index 9a61d0901fe..ab07c83dee4 100644 --- a/src/libs/utils/devicefileaccess.cpp +++ b/src/libs/utils/devicefileaccess.cpp @@ -437,15 +437,24 @@ class DesktopFilePathWatcher final : public FilePathWatcher void init() { QMetaObject::invokeMethod(this, &Private::_init, Qt::QueuedConnection); } bool watch(DesktopFilePathWatcher *watcher) { - return QMetaObject::invokeMethod( - this, [this, watcher] { return _watch(watcher); }, Qt::BlockingQueuedConnection); + bool result; + QMetaObject::invokeMethod( + this, + [this, watcher] { return _watch(watcher); }, + Qt::BlockingQueuedConnection, + &result); + + return result; } bool removeWatch(DesktopFilePathWatcher *watcher) { + bool result; return QMetaObject::invokeMethod( this, [this, watcher] { return _removeWatch(watcher); }, - Qt::BlockingQueuedConnection); + Qt::BlockingQueuedConnection, + &result); + return result; } protected: