From 99e6a22b1f7b02a309740c135df9b4e383e756f3 Mon Sep 17 00:00:00 2001 From: Jamiras Date: Sat, 17 Aug 2024 13:03:13 -0600 Subject: [PATCH] prevent multiple log messages if badge file not available --- src/ui/viewmodels/OverlayManager.cpp | 6 +++++- src/ui/viewmodels/OverlayManager.hh | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/ui/viewmodels/OverlayManager.cpp b/src/ui/viewmodels/OverlayManager.cpp index 60c3d150..c78ae6d2 100644 --- a/src/ui/viewmodels/OverlayManager.cpp +++ b/src/ui/viewmodels/OverlayManager.cpp @@ -873,7 +873,11 @@ void OverlayManager::ProcessScreenshots() } else { - RA_LOG_INFO("Image no longer available for %s", iter->second); + if (!pScreenshot.bDelayed) + { + pScreenshot.bDelayed = true; + RA_LOG_INFO("Image %s not available for %s", pImageReference.Name(), iter->second); + } ++iter; } } diff --git a/src/ui/viewmodels/OverlayManager.hh b/src/ui/viewmodels/OverlayManager.hh index b1323069..a571e40a 100644 --- a/src/ui/viewmodels/OverlayManager.hh +++ b/src/ui/viewmodels/OverlayManager.hh @@ -389,6 +389,7 @@ private: int nFrameId = 0; std::unique_ptr pScreen; std::map vMessages; + bool bDelayed = false; }; std::vector m_vScreenshotQueue; std::mutex m_pScreenshotQueueMutex;