diff options
author | Mark Palange (Mani) <palange@lindenlab.com> | 2009-07-24 15:08:16 -0700 |
---|---|---|
committer | Mark Palange (Mani) <palange@lindenlab.com> | 2009-07-24 15:08:16 -0700 |
commit | 9538328d5f7cf0f0be5dd77b8e27032e09104fff (patch) | |
tree | 7592050ae6c8854284f5961558249985e3abec82 /indra/llui | |
parent | db7f15df68cda2850c3d8a7ffcc59fc136de6f95 (diff) |
Adding LLLoginInstance unit test.
- Added LLNotificationsInterface class.
- Removed LLLoginInstance use of LLNotifications EventAPI
Diffstat (limited to 'indra/llui')
-rw-r--r-- | indra/llui/llnotifications.h | 13 | ||||
-rw-r--r-- | indra/llui/llnotificationslistener.cpp | 8 | ||||
-rw-r--r-- | indra/llui/llnotificationslistener.h | 2 |
3 files changed, 17 insertions, 6 deletions
diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index 93cdcbeefd..c534267fca 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -799,8 +799,19 @@ private: LLNotificationComparator mComparator; }; +// An interface class to provide a clean linker seam to the LLNotifications class. +// Extend this interface as needed for your use of LLNotifications. +class LLNotificationsInterface +{ +public: + virtual LLNotificationPtr add(const std::string& name, + const LLSD& substitutions, + const LLSD& payload, + LLNotificationFunctorRegistry::ResponseFunctor functor) = 0; +}; class LLNotifications : + public LLNotificationsInterface, public LLSingleton<LLNotifications>, public LLNotificationChannelBase { @@ -824,7 +835,7 @@ public: const LLSD& substitutions, const LLSD& payload, const std::string& functor_name); - LLNotificationPtr add(const std::string& name, + /* virtual */ LLNotificationPtr add(const std::string& name, const LLSD& substitutions, const LLSD& payload, LLNotificationFunctorRegistry::ResponseFunctor functor); diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp index 6ebbee68ac..75f4d6177d 100644 --- a/indra/llui/llnotificationslistener.cpp +++ b/indra/llui/llnotificationslistener.cpp @@ -29,7 +29,7 @@ void LLNotificationsListener::requestAdd(const LLSD& event_data) const mNotifications.add(event_data["name"], event_data["substitutions"], event_data["payload"], - boost::bind(&LLNotificationListener::Responder, + boost::bind(&LLNotificationsListener::NotificationResponder, this, event_data["reply"].asString(), _1, _2 @@ -44,12 +44,12 @@ void LLNotificationsListener::requestAdd(const LLSD& event_data) const } } -void LLNotificationsListener::Responder(const std::string& reply_pump, +void LLNotificationsListener::NotificationResponder(const std::string& reply_pump, const LLSD& notification, - const LLSD& response) + const LLSD& response) const { LLSD reponse_event; reponse_event["notification"] = notification; reponse_event["response"] = response; - mEventPumps.obtain(reply_pump).post(reponse_event); + LLEventPumps::getInstance()->obtain(reply_pump).post(reponse_event); } diff --git a/indra/llui/llnotificationslistener.h b/indra/llui/llnotificationslistener.h index d11aed1b52..6f71a7c781 100644 --- a/indra/llui/llnotificationslistener.h +++ b/indra/llui/llnotificationslistener.h @@ -27,7 +27,7 @@ public: private: void NotificationResponder(const std::string& replypump, const LLSD& notification, - const LLSD& response); + const LLSD& response) const; LLNotifications & mNotifications; }; |