summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rw-r--r--indra/llcommon/workqueue.cpp31
-rw-r--r--indra/llcommon/workqueue.h5
-rw-r--r--indra/llmath/v2math.h6
-rw-r--r--indra/llmath/v3math.h10
-rw-r--r--indra/llmath/v4math.h2
-rw-r--r--indra/newview/llfolderviewmodelinventory.cpp2
-rw-r--r--indra/newview/llfolderviewmodelinventory.h1
-rw-r--r--indra/newview/llinventorybridge.h1
-rw-r--r--indra/newview/skins/default/xui/en/floater_inventory_settings.xml2
9 files changed, 45 insertions, 15 deletions
diff --git a/indra/llcommon/workqueue.cpp b/indra/llcommon/workqueue.cpp
index 323903e59c..0eb20323ad 100644
--- a/indra/llcommon/workqueue.cpp
+++ b/indra/llcommon/workqueue.cpp
@@ -21,6 +21,7 @@
#include "llcoros.h"
#include LLCOROS_MUTEX_HEADER
#include "llerror.h"
+#include "llevents.h"
#include "llexception.h"
#include "stringize.h"
@@ -34,10 +35,34 @@ LL::WorkQueueBase::WorkQueueBase(const std::string& name, bool auto_shutdown)
: super(makeName(name))
{
if (auto_shutdown)
-{
- // TODO: register for "LLApp" events so we can implicitly close() on
- // viewer shutdown.
+ {
+ // Register for "LLApp" events so we can implicitly close() on viewer shutdown
+ std::string listener_name = "WorkQueue:" + getKey();
+ LLEventPumps::instance().obtain("LLApp").listen(
+ listener_name,
+ [this](const LLSD& stat)
+ {
+ std::string status(stat["status"]);
+ if (status != "running")
+ {
+ // Viewer is shutting down, close this queue
+ LL_DEBUGS("WorkQueue") << getKey() << " closing on app shutdown" << LL_ENDL;
+ close();
+ }
+ return false;
+ });
+
+ // Store the listener name so we can unregister in the destructor
+ mListenerName = listener_name;
+ }
}
+
+LL::WorkQueueBase::~WorkQueueBase()
+{
+ if (!mListenerName.empty() && !LLEventPumps::wasDeleted())
+ {
+ LLEventPumps::instance().obtain("LLApp").stopListening(mListenerName);
+ }
}
void LL::WorkQueueBase::runUntilClose()
diff --git a/indra/llcommon/workqueue.h b/indra/llcommon/workqueue.h
index d424ca6e1c..735ad38a26 100644
--- a/indra/llcommon/workqueue.h
+++ b/indra/llcommon/workqueue.h
@@ -53,6 +53,8 @@ namespace LL
*/
WorkQueueBase(const std::string& name, bool auto_shutdown);
+ virtual ~WorkQueueBase();
+
/**
* Since the point of WorkQueue is to pass work to some other worker
* thread(s) asynchronously, it's important that it continue to exist
@@ -197,6 +199,9 @@ namespace LL
private:
virtual Work pop_() = 0;
virtual bool tryPop_(Work&) = 0;
+
+ // Name used for the LLApp event listener (empty if not registered)
+ std::string mListenerName;
};
/*****************************************************************************
diff --git a/indra/llmath/v2math.h b/indra/llmath/v2math.h
index d9fb70e191..6b9d37535b 100644
--- a/indra/llmath/v2math.h
+++ b/indra/llmath/v2math.h
@@ -243,19 +243,19 @@ inline bool LLVector2::isFinite() const
}
// deprecated
-inline F32 LLVector2::magVec(void) const
+inline F32 LLVector2::magVec() const
{
return length();
}
// deprecated
-inline F32 LLVector2::magVecSquared(void) const
+inline F32 LLVector2::magVecSquared() const
{
return lengthSquared();
}
// deprecated
-inline F32 LLVector2::normVec(void)
+inline F32 LLVector2::normVec()
{
return normalize();
}
diff --git a/indra/llmath/v3math.h b/indra/llmath/v3math.h
index baf38e4a3a..098ca5218c 100644
--- a/indra/llmath/v3math.h
+++ b/indra/llmath/v3math.h
@@ -264,7 +264,7 @@ inline void LLVector3::set(const LLVector3& vec)
inline void LLVector3::set(const F32* vec)
{
- set(vec[0], vec[1], vec[2]);
+ set(vec[VX], vec[VY], vec[VZ]);
}
inline void LLVector3::set(const glm::vec4& vec)
@@ -343,7 +343,7 @@ inline F32 LLVector3::magVecSquared() const
return lengthSquared();
}
-inline bool LLVector3::inRange( F32 min, F32 max ) const
+inline bool LLVector3::inRange(F32 min, F32 max) const
{
return mV[VX] >= min && mV[VX] <= max &&
mV[VY] >= min && mV[VY] <= max &&
@@ -369,7 +369,7 @@ inline F32 operator*(const LLVector3& a, const LLVector3& b)
inline LLVector3 operator%(const LLVector3& a, const LLVector3& b)
{
- return LLVector3( a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY] );
+ return LLVector3(a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]);
}
inline LLVector3 operator/(const LLVector3& a, F32 k)
@@ -429,7 +429,7 @@ inline const LLVector3& operator-=(LLVector3& a, const LLVector3& b)
inline const LLVector3& operator%=(LLVector3& a, const LLVector3& b)
{
- LLVector3 ret( a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]);
+ LLVector3 ret(a.mV[VY]*b.mV[VZ] - b.mV[VY]*a.mV[VZ], a.mV[VZ]*b.mV[VX] - b.mV[VZ]*a.mV[VX], a.mV[VX]*b.mV[VY] - b.mV[VX]*a.mV[VY]);
a = ret;
return a;
}
@@ -477,7 +477,7 @@ inline F32 dist_vec(const LLVector3& a, const LLVector3& b)
F32 x = a.mV[VX] - b.mV[VX];
F32 y = a.mV[VY] - b.mV[VY];
F32 z = a.mV[VZ] - b.mV[VZ];
- return sqrt( x*x + y*y + z*z );
+ return sqrt(x*x + y*y + z*z);
}
inline F32 dist_vec_squared(const LLVector3& a, const LLVector3& b)
diff --git a/indra/llmath/v4math.h b/indra/llmath/v4math.h
index d49639bd35..1cbd0d9a78 100644
--- a/indra/llmath/v4math.h
+++ b/indra/llmath/v4math.h
@@ -118,8 +118,6 @@ public:
bool isExactlyClear() const { return (mV[VW] == 1.0f) && !mV[VX] && !mV[VY] && !mV[VZ]; }
bool isExactlyZero() const { return !mV[VW] && !mV[VX] && !mV[VY] && !mV[VZ]; }
- const LLVector4& rotVec(F32 angle, const LLVector4 &vec); // Rotates about vec by angle radians
- const LLVector4& rotVec(F32 angle, F32 x, F32 y, F32 z); // Rotates about x,y,z by angle radians
const LLVector4& rotVec(const LLMatrix4 &mat); // Rotates by MAT4 mat
const LLVector4& rotVec(const LLQuaternion &q); // Rotates by QUAT q
diff --git a/indra/newview/llfolderviewmodelinventory.cpp b/indra/newview/llfolderviewmodelinventory.cpp
index 9223c13ec1..a0621bb015 100644
--- a/indra/newview/llfolderviewmodelinventory.cpp
+++ b/indra/newview/llfolderviewmodelinventory.cpp
@@ -69,7 +69,7 @@ void LLFolderViewModelInventory::sort( LLFolderViewFolder* folder )
if (!folder->areChildrenInited() || !needsSort(folder->getViewModelItem())) return;
LLFolderViewModelItemInventory* sort_modelp = static_cast<LLFolderViewModelItemInventory*>(folder->getViewModelItem());
- if (sort_modelp->getUUID().isNull()) return;
+ if (!sort_modelp->canSortContent()) return;
bool has_favorites = false;
for (std::list<LLFolderViewFolder*>::iterator it = folder->getFoldersBegin(), end_it = folder->getFoldersEnd();
diff --git a/indra/newview/llfolderviewmodelinventory.h b/indra/newview/llfolderviewmodelinventory.h
index 04b0b6e8f4..74645a19e0 100644
--- a/indra/newview/llfolderviewmodelinventory.h
+++ b/indra/newview/llfolderviewmodelinventory.h
@@ -59,6 +59,7 @@ public:
virtual EInventorySortGroup getSortGroup() const = 0;
virtual LLInventoryObject* getInventoryObject() const = 0;
virtual void requestSort();
+ virtual bool canSortContent() const { return getUUID().notNull(); }
virtual void setPassedFilter(bool filtered, S32 filter_generation, std::string::size_type string_offset = std::string::npos, std::string::size_type string_size = 0);
virtual bool filter( LLFolderViewFilter& filter);
virtual bool filterChildItem( LLFolderViewModelItem* item, LLFolderViewFilter& filter);
diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h
index 1b80ac163c..6c3790d2ec 100644
--- a/indra/newview/llinventorybridge.h
+++ b/indra/newview/llinventorybridge.h
@@ -777,6 +777,7 @@ public:
mInvType = type;
}
/*virtual*/ void buildContextMenu(LLMenuGL& menu, U32 flags);
+ /*virtual*/ bool canSortContent() const { return true; }
};
// Bridge builder to create Inventory-Folder-View-Bridge for Recent Inventory Panel
diff --git a/indra/newview/skins/default/xui/en/floater_inventory_settings.xml b/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
index 08b7a7af05..a51e7a844a 100644
--- a/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
+++ b/indra/newview/skins/default/xui/en/floater_inventory_settings.xml
@@ -279,7 +279,7 @@
font="SansSerifMedium"
text_color="White"
width="300">
- Pressing return on an avatar attachment
+ Pressing enter on an avatar attachment
</text>
<combo_box
control_name="InventoryAddAttachmentBehavior"