From 353ac3969efc5bda81b34f4edb3756dd6ced0412 Mon Sep 17 00:00:00 2001 From: Rick Pasetto Date: Tue, 10 Nov 2009 17:24:02 -0800 Subject: FIX DEV-41991: do not allow media settings panel to come up if media data is in flight Review #33 This change marks the current selection "not editable" if any objects in the selection are currently "in flight" (i.e. their media data has not been fetched yet, or is in the process of being fetched). This involved adding API to LLMediaDataClient to query whether an object is in the process of being fetched (i.e. in the queue). I've added a unit test for this new API. --- indra/newview/llmediadataclient.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'indra/newview/llmediadataclient.cpp') diff --git a/indra/newview/llmediadataclient.cpp b/indra/newview/llmediadataclient.cpp index 512104a2f4..986c14acff 100755 --- a/indra/newview/llmediadataclient.cpp +++ b/indra/newview/llmediadataclient.cpp @@ -324,6 +324,22 @@ std::ostream& operator<<(std::ostream &s, const LLMediaDataClient::PriorityQueue return s; } +// find the given object in the queue. +bool LLMediaDataClient::PriorityQueue::find(const LLMediaDataClientObject::ptr_t &obj) const +{ + std::vector::const_iterator iter = c.begin(); + std::vector::const_iterator end = c.end(); + while (iter < end) + { + if (obj->getID() == (*iter)->getObject()->getID()) + { + return true; + } + iter++; + } + return false; +} + ////////////////////////////////////////////////////////////////////////////////////// // // LLMediaDataClient::QueueTimer @@ -491,6 +507,11 @@ bool LLMediaDataClient::isEmpty() const return (NULL == pRequestQueue) ? true : pRequestQueue->empty(); } +bool LLMediaDataClient::isInQueue(const LLMediaDataClientObject::ptr_t &object) const +{ + return (NULL == pRequestQueue) ? false : pRequestQueue->find(object); +} + ////////////////////////////////////////////////////////////////////////////////////// // // LLObjectMediaDataClient -- cgit v1.2.3