From c6b6adc407bf7488b67c0db3fd73f9dba80393e6 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Mon, 25 Apr 2022 20:51:41 -0400 Subject: [PATCH] Tracker: Replace custom LooperAutoLocker with AutoLocker. --- src/kits/tracker/Utilities.cpp | 2 +- src/kits/tracker/Utilities.h | 30 ------------------------------ 2 files changed, 1 insertion(+), 31 deletions(-) diff --git a/src/kits/tracker/Utilities.cpp b/src/kits/tracker/Utilities.cpp index 72824a06bb..9b3f27cc0f 100644 --- a/src/kits/tracker/Utilities.cpp +++ b/src/kits/tracker/Utilities.cpp @@ -2023,7 +2023,7 @@ PositionPassingMenuItem::Invoke(BMessage* message) // use the window position only, if the item was invoked from the menu // menu->Window() points to the window the item was invoked from if (dynamic_cast(menu->Window()) == NULL) { - LooperAutoLocker lock(menu); + AutoLocker lock(menu->Looper()); if (lock.IsLocked()) { BPoint invokeOrigin(menu->Window()->Frame().LeftTop()); clone.AddPoint("be:invoke_origin", invokeOrigin); diff --git a/src/kits/tracker/Utilities.h b/src/kits/tracker/Utilities.h index 02c015b889..a2ca696c3b 100644 --- a/src/kits/tracker/Utilities.h +++ b/src/kits/tracker/Utilities.h @@ -348,36 +348,6 @@ private: }; -class LooperAutoLocker { -public: - LooperAutoLocker(BHandler* handler) - : fHandler(handler), - fHasLock(handler->LockLooper()) - { - } - - ~LooperAutoLocker() - { - if (fHasLock) - fHandler->UnlockLooper(); - } - - bool operator!() const - { - return !fHasLock; - } - - bool IsLocked() const - { - return fHasLock; - } - -private: - BHandler* fHandler; - bool fHasLock; -}; - - class ShortcutFilter : public BMessageFilter { public: ShortcutFilter(uint32 shortcutKey, uint32 shortcutModifier,