summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/settings.xml30
-rw-r--r--indra/newview/llappcorehttp.cpp34
-rw-r--r--indra/newview/llappearancemgr.cpp82
-rw-r--r--indra/newview/llappearancemgr.h2
-rw-r--r--indra/newview/llappviewer.cpp41
-rw-r--r--indra/newview/llappviewerwin32.cpp18
-rw-r--r--indra/newview/llenvironment.cpp20
-rw-r--r--indra/newview/llexperiencelog.cpp4
-rw-r--r--indra/newview/llfavoritesbar.cpp2
-rw-r--r--indra/newview/llfloaterbuyland.cpp3
-rw-r--r--indra/newview/llfloaterregioninfo.cpp4
-rw-r--r--indra/newview/llfloaterwindowsize.cpp6
-rw-r--r--indra/newview/llgesturemgr.cpp2
-rw-r--r--indra/newview/llimprocessing.cpp4
-rw-r--r--indra/newview/llinventoryfilter.cpp5
-rw-r--r--indra/newview/llinventorymodel.cpp321
-rw-r--r--indra/newview/llinventorymodel.h4
-rw-r--r--indra/newview/llinventorypanel.cpp3
-rw-r--r--indra/newview/lllogchat.cpp12
-rw-r--r--indra/newview/llmachineid.cpp15
-rw-r--r--indra/newview/llpanelexperiencepicker.cpp4
-rw-r--r--indra/newview/llpanelmaininventory.cpp39
-rw-r--r--indra/newview/llpanelmaininventory.h2
-rw-r--r--indra/newview/llpanelobject.cpp2
-rw-r--r--indra/newview/llpanelsnapshotpostcard.cpp3
-rw-r--r--indra/newview/llsecapi.h4
-rw-r--r--indra/newview/llsechandler_basic.h5
-rw-r--r--indra/newview/llselectmgr.cpp5
-rw-r--r--indra/newview/llstartup.cpp5
-rw-r--r--indra/newview/lltoast.h2
-rw-r--r--indra/newview/lltoolpie.cpp37
-rw-r--r--indra/newview/lltranslate.cpp22
-rw-r--r--indra/newview/llversioninfo.cpp10
-rw-r--r--indra/newview/llviewerassetupload.cpp2
-rw-r--r--indra/newview/llvieweraudio.cpp2
-rw-r--r--indra/newview/llvieweraudio.h5
-rw-r--r--indra/newview/llviewermenu.cpp10
-rw-r--r--indra/newview/llviewerparcelmgr.cpp42
-rw-r--r--indra/newview/llviewerparcelmgr.h2
-rw-r--r--indra/newview/llviewerregion.cpp23
-rw-r--r--indra/newview/llvovolume.cpp24
-rw-r--r--indra/newview/llwatchdog.cpp4
-rw-r--r--indra/newview/llweb.cpp7
43 files changed, 568 insertions, 305 deletions
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index 5bbf1a7b44..eeb7e6f0aa 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -1584,10 +1584,11 @@
<key>Value</key>
<real>1.0</real>
</map>
- <key>CameraPreset</key> <!-- deprecated (see SL-12429) -->
+ <key>CameraPreset</key>
+ <!-- deprecated (see SL-12429) -->
<map>
<key>Comment</key>
- <string>Preset camera position - view (0 - rear, 1 - front, 2 - group)</string>
+ <string>(Deprecated) Preset camera position - view (0 - rear, 1 - front, 2 - group)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -2494,10 +2495,11 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>DEPRECATED: DebugShowPrivateMem</key> <!-- deprecated (see MAINT-8091) -->
+ <key>DebugShowPrivateMem</key>
+ <!-- deprecated (see MAINT-8091) -->
<map>
<key>Comment</key>
- <string>Show Private Mem Info</string>
+ <string>(Deprecated) Show Private Mem Info</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -5808,7 +5810,7 @@
<key>LoginSRVPump</key>
<map>
<key>Comment</key>
- <string>Name of the message pump that handles SRV request (deprecated)</string>
+ <string>(Deprecated) Name of the message pump that handles SRV request)</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
@@ -6619,10 +6621,11 @@
<key>Value</key>
<real>600.0</real>
</map>
- <key>MemoryPrivatePoolEnabled</key> <!-- deprecated (see MAINT-8091) -->
+ <key>MemoryPrivatePoolEnabled</key>
+ <!-- deprecated (see MAINT-8091) -->
<map>
<key>Comment</key>
- <string>DEPRECATED: Enable the private memory pool management</string>
+ <string>(Deprecated) Enable the private memory pool management</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -6630,10 +6633,11 @@
<key>Value</key>
<integer>0</integer>
</map>
- <key>MemoryPrivatePoolSize</key> <!-- deprecated (see MAINT-8091) -->
+ <key>MemoryPrivatePoolSize</key>
+ <!-- deprecated (see MAINT-8091) -->
<map>
<key>Comment</key>
- <string>DEPRECATED: Size of the private memory pool in MB (min. value is 256)</string>
+ <string>(Deprecated) Size of the private memory pool in MB (min. value is 256)</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -8326,7 +8330,7 @@
<key>QAModeEventHostPort</key>
<map>
<key>Comment</key>
- <string>DEPRECATED: Port on which lleventhost should listen</string>
+ <string>(Deprecated) Port on which lleventhost should listen</string>
<key>Persist</key>
<integer>0</integer>
<key>Type</key>
@@ -14071,10 +14075,11 @@
<key>Value</key>
<string>Default</string>
</map>
- <key>UseExternalBrowser</key> <!-- deprecated (see MAINT-4127) -->
+ <key>UseExternalBrowser</key>
+ <!-- deprecated (see MAINT-4127) -->
<map>
<key>Comment</key>
- <string>Use default browser when opening web pages instead of in-world browser.</string>
+ <string>(Deprecated) Use default browser when opening web pages instead of in-world browser.</string>
<key>Persist</key>
<integer>1</integer>
<key>Type</key>
@@ -14480,6 +14485,7 @@
<integer>0</integer>
</map>
<key>VoiceCallsFriendsOnly</key>
+ <!-- deprecated (see SL-12871) -->
<map>
<key>Comment</key>
<string>(Deprecated) Only accept voice calls from residents on your friends list</string>
diff --git a/indra/newview/llappcorehttp.cpp b/indra/newview/llappcorehttp.cpp
index 3da87e657c..ef56478106 100644
--- a/indra/newview/llappcorehttp.cpp
+++ b/indra/newview/llappcorehttp.cpp
@@ -271,20 +271,13 @@ void LLAppCoreHttp::init()
<< LL_ENDL;
}
- // Signal for global pipelining preference from settings
+ // Global pipelining setting
static const std::string http_pipelining("HttpPipelining");
if (gSavedSettings.controlExists(http_pipelining))
{
- LLPointer<LLControlVariable> cntrl_ptr = gSavedSettings.getControl(http_pipelining);
- if (cntrl_ptr.isNull())
- {
- LL_WARNS("Init") << "Unable to set signal on global setting '" << http_pipelining
- << "'" << LL_ENDL;
- }
- else
- {
- mPipelinedSignal = cntrl_ptr->getCommitSignal()->connect(boost::bind(&setting_changed));
- }
+ // Default to true (in ctor) if absent.
+ mPipelined = gSavedSettings.getBOOL(http_pipelining);
+ LL_INFOS("Init") << "HTTP Pipelining " << (mPipelined ? "enabled" : "disabled") << "!" << LL_ENDL;
}
// Register signals for settings and state changes
@@ -398,21 +391,6 @@ void LLAppCoreHttp::refreshSettings(bool initial)
{
LLCore::HttpStatus status;
- // Global pipelining setting
- bool pipeline_changed(false);
- static const std::string http_pipelining("HttpPipelining");
- if (gSavedSettings.controlExists(http_pipelining))
- {
- // Default to true (in ctor) if absent.
- bool pipelined(gSavedSettings.getBOOL(http_pipelining));
- if (pipelined != mPipelined)
- {
- mPipelined = pipelined;
- pipeline_changed = true;
- }
- LL_INFOS("Init") << "HTTP Pipelining " << (mPipelined ? "enabled" : "disabled") << "!" << LL_ENDL;
- }
-
for (int i(0); i < LL_ARRAY_SIZE(init_data); ++i)
{
const EAppPolicy app_policy(static_cast<EAppPolicy>(i));
@@ -441,7 +419,7 @@ void LLAppCoreHttp::refreshSettings(bool initial)
// Init- or run-time settings. Must use the queued request API.
// Pipelining changes
- if (initial || pipeline_changed)
+ if (initial)
{
const bool to_pipeline(mPipelined && init_data[i].mPipelined);
if (to_pipeline != mHttpClasses[app_policy].mPipelined)
@@ -484,7 +462,7 @@ void LLAppCoreHttp::refreshSettings(bool initial)
}
}
- if (initial || setting != mHttpClasses[app_policy].mConnLimit || pipeline_changed)
+ if (initial || setting != mHttpClasses[app_policy].mConnLimit)
{
// Set it and report. Strategies depend on pipelining:
//
diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp
index fd712ea5d0..39c9fa1bca 100644
--- a/indra/newview/llappearancemgr.cpp
+++ b/indra/newview/llappearancemgr.cpp
@@ -2347,6 +2347,52 @@ void LLAppearanceMgr::enforceCOFItemRestrictions(LLPointer<LLInventoryCallback>
}
}
+bool sort_by_linked_uuid(const LLViewerInventoryItem* item1, const LLViewerInventoryItem* item2)
+{
+ if (!item1 || !item2)
+ {
+ LL_WARNS() << "item1, item2 cannot be null, something is very wrong" << LL_ENDL;
+ return true;
+ }
+
+ return item1->getLinkedUUID() < item2->getLinkedUUID();
+}
+
+void get_sorted_base_and_cof_items(LLInventoryModel::item_array_t& cof_item_array, LLInventoryModel::item_array_t& outfit_item_array)
+{
+ LLUUID base_outfit_id = LLAppearanceMgr::instance().getBaseOutfitUUID();
+
+ if (base_outfit_id.notNull())
+ {
+ LLIsValidItemLink collector;
+ LLInventoryModel::cat_array_t sub_cat_array;
+
+ gInventory.collectDescendents(base_outfit_id,
+ sub_cat_array,
+ outfit_item_array,
+ LLInventoryModel::EXCLUDE_TRASH);
+
+ LLInventoryModel::cat_array_t cof_cats;
+
+ gInventory.collectDescendentsIf(LLAppearanceMgr::instance().getCOF(), cof_cats, cof_item_array,
+ LLInventoryModel::EXCLUDE_TRASH, collector);
+
+ for (U32 i = 0; i < outfit_item_array.size(); ++i)
+ {
+ LLViewerInventoryItem* linked_item = outfit_item_array.at(i)->getLinkedItem();
+ if (linked_item != NULL && linked_item->getActualType() == LLAssetType::AT_TEXTURE)
+ {
+ outfit_item_array.erase(outfit_item_array.begin() + i);
+ break;
+ }
+ }
+
+ std::sort(cof_item_array.begin(), cof_item_array.end(), sort_by_linked_uuid);
+ std::sort(outfit_item_array.begin(), outfit_item_array.end(), sort_by_linked_uuid);
+ }
+}
+
+
void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
bool enforce_ordering,
nullary_func_t post_update_func)
@@ -2388,7 +2434,30 @@ void LLAppearanceMgr::updateAppearanceFromCOF(bool enforce_item_restrictions,
if (!validateClothingOrderingInfo())
{
- LL_WARNS() << "Clothing ordering error" << LL_ENDL;
+
+ LLInventoryModel::item_array_t outfit_item_array;
+ LLInventoryModel::item_array_t cof_item_array;
+ get_sorted_base_and_cof_items(cof_item_array, outfit_item_array);
+
+ if (outfit_item_array.size() == cof_item_array.size())
+ {
+ for (U32 i = 0; i < cof_item_array.size(); ++i)
+ {
+ LLViewerInventoryItem *cof_it = cof_item_array.at(i);
+ LLViewerInventoryItem *base_it = outfit_item_array.at(i);
+
+ if (cof_it->getActualDescription() != base_it->getActualDescription())
+ {
+ if (cof_it->getLinkedUUID() == base_it->getLinkedUUID())
+ {
+ cof_it->setDescription(base_it->getActualDescription());
+ gInventory.updateItem(cof_it);
+ }
+ }
+ }
+ LLAppearanceMgr::getInstance()->updateIsDirty();
+ }
+
}
BoolSetter setIsInUpdateAppearanceFromCOF(mIsInUpdateAppearanceFromCOF);
@@ -3017,17 +3086,6 @@ void LLAppearanceMgr::removeCOFLinksOfType(LLWearableType::EType type, LLPointer
}
}
-bool sort_by_linked_uuid(const LLViewerInventoryItem* item1, const LLViewerInventoryItem* item2)
-{
- if (!item1 || !item2)
- {
- LL_WARNS() << "item1, item2 cannot be null, something is very wrong" << LL_ENDL;
- return true;
- }
-
- return item1->getLinkedUUID() < item2->getLinkedUUID();
-}
-
void LLAppearanceMgr::updateIsDirty()
{
LLUUID cof = getCOF();
diff --git a/indra/newview/llappearancemgr.h b/indra/newview/llappearancemgr.h
index 8a55a848db..a5265a392f 100644
--- a/indra/newview/llappearancemgr.h
+++ b/indra/newview/llappearancemgr.h
@@ -276,7 +276,7 @@ private:
LLUUID mCOFImageID;
- std::auto_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
+ std::unique_ptr<LLOutfitUnLockTimer> mUnlockOutfitTimer;
// Set of temp attachment UUIDs that should be removed
typedef std::set<LLUUID> doomed_temp_attachments_t;
diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp
index 2cc8375541..1c67cc9705 100644
--- a/indra/newview/llappviewer.cpp
+++ b/indra/newview/llappviewer.cpp
@@ -1108,19 +1108,27 @@ bool LLAppViewer::init()
if (count > 0 && v1 <= 10)
{
LL_INFOS("AppInit") << "Detected obsolete intel driver: " << driver << LL_ENDL;
- LLUIString details = LLNotifications::instance().getGlobalString("UnsupportedIntelDriver");
- std::string gpu_name = ll_safe_string((const char *)glGetString(GL_RENDERER));
- details.setArg("[VERSION]", driver);
- details.setArg("[GPUNAME]", gpu_name);
- S32 button = OSMessageBox(details.getString(),
- LLStringUtil::null,
- OSMB_YESNO);
- if (OSBTN_YES == button && gViewerWindow)
+
+ if (!gViewerWindow->getInitAlert().empty() // graphic initialization crashed on last run
+ || LLVersionInfo::getInstance()->getChannelAndVersion() != gLastRunVersion // viewer was updated
+ || mNumSessions % 20 == 0 //periodically remind user to update driver
+ )
{
- std::string url = LLWeb::escapeURL(LLTrans::getString("IntelDriverPage"));
- if (gViewerWindow->getWindow())
+ LLUIString details = LLNotifications::instance().getGlobalString("UnsupportedIntelDriver");
+ std::string gpu_name = ll_safe_string((const char *)glGetString(GL_RENDERER));
+ LL_INFOS("AppInit") << "Notifying user about obsolete intel driver for " << gpu_name << LL_ENDL;
+ details.setArg("[VERSION]", driver);
+ details.setArg("[GPUNAME]", gpu_name);
+ S32 button = OSMessageBox(details.getString(),
+ LLStringUtil::null,
+ OSMB_YESNO);
+ if (OSBTN_YES == button && gViewerWindow)
{
- gViewerWindow->getWindow()->spawnWebBrowser(url, false);
+ std::string url = LLWeb::escapeURL(LLTrans::getString("IntelDriverPage"));
+ if (gViewerWindow->getWindow())
+ {
+ gViewerWindow->getWindow()->spawnWebBrowser(url, false);
+ }
}
}
}
@@ -3114,6 +3122,15 @@ bool LLAppViewer::initWindow()
void LLAppViewer::writeDebugInfo(bool isStatic)
{
+#if LL_WINDOWS && LL_BUGSPLAT
+ // bugsplat does not create dump folder and debug logs are written directly
+ // to logs folder, so it conflicts with main instance
+ if (mSecondInstance)
+ {
+ return;
+ }
+#endif
+
//Try to do the minimum when writing data during a crash.
std::string* debug_filename;
debug_filename = ( isStatic
@@ -3442,7 +3459,7 @@ void LLAppViewer::writeSystemInfo()
if (! gDebugInfo.has("Dynamic") )
gDebugInfo["Dynamic"] = LLSD::emptyMap();
-#if LL_WINDOWS
+#if LL_WINDOWS && !LL_BUGSPLAT
gDebugInfo["SLLog"] = gDirUtilp->getExpandedFilename(LL_PATH_DUMP,"SecondLife.log");
#else
//Not ideal but sufficient for good reporting.
diff --git a/indra/newview/llappviewerwin32.cpp b/indra/newview/llappviewerwin32.cpp
index d4b3a4a732..1896248502 100644
--- a/indra/newview/llappviewerwin32.cpp
+++ b/indra/newview/llappviewerwin32.cpp
@@ -118,16 +118,20 @@ namespace
{
if (nCode == MDSCB_EXCEPTIONCODE)
{
- // send the main viewer log file
- // widen to wstring, convert to __wchar_t, then pass c_str()
- sBugSplatSender->sendAdditionalFile(
- WCSTR(LLError::logFileName()));
+ // second instance does not have own log files
+ if (!LLAppViewer::instance()->isSecondInstance())
+ {
+ // send the main viewer log file
+ // widen to wstring, convert to __wchar_t, then pass c_str()
+ sBugSplatSender->sendAdditionalFile(
+ WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_LOGS, "SecondLife.log")));
- sBugSplatSender->sendAdditionalFile(
- WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml")));
+ sBugSplatSender->sendAdditionalFile(
+ WCSTR(*LLAppViewer::instance()->getStaticDebugFile()));
+ }
sBugSplatSender->sendAdditionalFile(
- WCSTR(*LLAppViewer::instance()->getStaticDebugFile()));
+ WCSTR(gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "settings.xml")));
// We don't have an email address for any user. Hijack this
// metadata field for the platform identifier.
diff --git a/indra/newview/llenvironment.cpp b/indra/newview/llenvironment.cpp
index 8881d11802..cc2b1cc42c 100644
--- a/indra/newview/llenvironment.cpp
+++ b/indra/newview/llenvironment.cpp
@@ -2079,7 +2079,15 @@ void LLEnvironment::coroUpdateEnvironment(S32 parcel_id, S32 track_no, UpdateInf
LL_WARNS("ENVIRONMENT") << "Couldn't update Windlight settings for " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL;
notify = LLSD::emptyMap();
- notify["FAIL_REASON"] = result["message"].asString();
+ std::string reason = result["message"].asString();
+ if (reason.empty())
+ {
+ notify["FAIL_REASON"] = status.toString();
+ }
+ else
+ {
+ notify["FAIL_REASON"] = reason;
+ }
}
else if (LLApp::isExiting())
{
@@ -2145,7 +2153,15 @@ void LLEnvironment::coroResetEnvironment(S32 parcel_id, S32 track_no, environmen
LL_WARNS("ENVIRONMENT") << "Couldn't reset Windlight settings in " << ((parcel_id == INVALID_PARCEL_ID) ? ("region!") : ("parcel!")) << LL_ENDL;
notify = LLSD::emptyMap();
- notify["FAIL_REASON"] = result["message"].asString();
+ std::string reason = result["message"].asString();
+ if (reason.empty())
+ {
+ notify["FAIL_REASON"] = status.toString();
+ }
+ else
+ {
+ notify["FAIL_REASON"] = reason;
+ }
}
else if (LLApp::isExiting())
{
diff --git a/indra/newview/llexperiencelog.cpp b/indra/newview/llexperiencelog.cpp
index ee5d561927..c441fbc09f 100644
--- a/indra/newview/llexperiencelog.cpp
+++ b/indra/newview/llexperiencelog.cpp
@@ -149,10 +149,6 @@ std::string LLExperienceLog::getPermissionString( const LLSD& message, const std
{
buf.str(entry);
}
- else
- {
- buf.str();
- }
}
if(buf.str().empty())
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index cca6b9ce32..a7147c3f04 100644
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -841,7 +841,7 @@ void LLFavoritesBarCtrl::updateButtons(bool force_update)
{
//find last visible child to get the rightest button offset
child_list_const_reverse_iter_t last_visible_it = std::find_if(childs->rbegin(), childs->rend(),
- std::mem_fun(&LLView::getVisible));
+ [](child_list_t::value_type child){ return child->getVisible(); });
if(last_visible_it != childs->rend())
{
last_right_edge = (*last_visible_it)->getRect().mRight;
diff --git a/indra/newview/llfloaterbuyland.cpp b/indra/newview/llfloaterbuyland.cpp
index 0a0e5ffc06..464e7ff4a2 100644
--- a/indra/newview/llfloaterbuyland.cpp
+++ b/indra/newview/llfloaterbuyland.cpp
@@ -996,7 +996,8 @@ void LLFloaterBuyLandUI::draw()
// virtual
BOOL LLFloaterBuyLandUI::canClose()
{
- bool can_close = (mTransaction ? FALSE : TRUE) && mCurrency.canCancel();
+ // mTransactionType check for pre-buy estimation stage and mCurrency to allow exit after transaction
+ bool can_close = !mTransaction && (mTransactionType != TransactionBuy || mCurrency.canCancel());
if (!can_close)
{
// explain to user why they can't do this, see DEV-9605
diff --git a/indra/newview/llfloaterregioninfo.cpp b/indra/newview/llfloaterregioninfo.cpp
index 17e55b5f2c..a10ba7a39d 100644
--- a/indra/newview/llfloaterregioninfo.cpp
+++ b/indra/newview/llfloaterregioninfo.cpp
@@ -659,9 +659,7 @@ void LLFloaterRegionInfo::refreshFromRegion(LLViewerRegion* region)
std::for_each(
mInfoPanels.begin(),
mInfoPanels.end(),
- llbind2nd(
- std::mem_fun(&LLPanelRegionInfo::refreshFromRegion),
- region));
+ [region](info_panels_t::value_type panel){ panel->refreshFromRegion(region); });
mEnvironmentPanel->refreshFromRegion(region);
}
diff --git a/indra/newview/llfloaterwindowsize.cpp b/indra/newview/llfloaterwindowsize.cpp
index ec161018b8..863b7cbb12 100644
--- a/indra/newview/llfloaterwindowsize.cpp
+++ b/indra/newview/llfloaterwindowsize.cpp
@@ -34,18 +34,16 @@
#include "llcombobox.h"
#include "llfloater.h"
#include "llfloaterreg.h"
+#include "llregex.h"
#include "lluictrl.h"
-// System libraries
-#include <boost/regex.hpp>
-
// Extract from strings of the form "<width> x <height>", e.g. "640 x 480".
bool extractWindowSizeFromString(const std::string& instr, U32 *width, U32 *height)
{
boost::cmatch what;
// matches (any number)(any non-number)(any number)
const boost::regex expression("([0-9]+)[^0-9]+([0-9]+)");
- if (boost::regex_match(instr.c_str(), what, expression))
+ if (ll_regex_match(instr.c_str(), what, expression))
{
*width = atoi(what[1].first);
*height = atoi(what[2].first);
diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp
index 950a6cfaef..eb0e77311b 100644
--- a/indra/newview/llgesturemgr.cpp
+++ b/indra/newview/llgesturemgr.cpp
@@ -752,7 +752,7 @@ S32 LLGestureMgr::getPlayingCount() const
}
-struct IsGesturePlaying : public std::unary_function<LLMultiGesture*, bool>
+struct IsGesturePlaying
{
bool operator()(const LLMultiGesture* gesture) const
{
diff --git a/indra/newview/llimprocessing.cpp b/indra/newview/llimprocessing.cpp
index 1e43e4ea3a..0524313a5c 100644
--- a/indra/newview/llimprocessing.cpp
+++ b/indra/newview/llimprocessing.cpp
@@ -42,6 +42,7 @@
#include "llnotificationsutil.h"
#include "llnotificationmanager.h"
#include "llpanelgroup.h"
+#include "llregex.h"
#include "llregionhandle.h"
#include "llsdserialize.h"
#include "llslurl.h"
@@ -55,7 +56,6 @@
#include "llviewerregion.h"
#include "llvoavatarself.h"
-#include <boost/regex.hpp>
#include "boost/lexical_cast.hpp"
#if LL_MSVC
// disable boost::lexical_cast warning
@@ -122,7 +122,7 @@ static std::string clean_name_from_task_im(const std::string& msg,
boost::smatch match;
static const boost::regex returned_exp(
"(.*been returned to your inventory lost and found folder by )(.+)( (from|near).*)");
- if (boost::regex_match(msg, match, returned_exp))
+ if (ll_regex_match(msg, match, returned_exp))
{
// match objects are 1-based for groups
std::string final = match[1].str();
diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp
index 411311bbea..3b5ba24b9f 100644
--- a/indra/newview/llinventoryfilter.cpp
+++ b/indra/newview/llinventoryfilter.cpp
@@ -36,13 +36,14 @@
#include "llinventorymodelbackgroundfetch.h"
#include "llinventoryfunctions.h"
#include "llmarketplacefunctions.h"
+#include "llregex.h"
#include "llviewercontrol.h"
#include "llfolderview.h"
#include "llinventorybridge.h"
#include "llviewerfoldertype.h"
#include "llradiogroup.h"
#include "llstartup.h"
-#include <boost/regex.hpp>
+
// linden library includes
#include "llclipboard.h"
#include "lltrans.h"
@@ -879,7 +880,7 @@ void LLInventoryFilter::setFilterSubString(const std::string& string)
boost::regex mPattern = boost::regex("\"\\s*([^<]*)?\\s*\"",
boost::regex::perl | boost::regex::icase);
boost::match_results<std::string::const_iterator> matches;
- mExactToken = (boost::regex_match(filter_sub_string_new, matches, mPattern) && matches[1].matched)
+ mExactToken = (ll_regex_match(filter_sub_string_new, matches, mPattern) && matches[1].matched)
? matches[1]
: LLStringUtil::null;
if ((old_token.empty() && !mExactToken.empty())
diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp
index 28db6a5808..ba453471c6 100644
--- a/indra/newview/llinventorymodel.cpp
+++ b/indra/newview/llinventorymodel.cpp
@@ -487,7 +487,8 @@ const LLUUID LLInventoryModel::findCategoryUUIDForTypeInRoot(
S32 count = cats->size();
for(S32 i = 0; i < count; ++i)
{
- if(cats->at(i)->getPreferredType() == preferred_type)
+ LLViewerInventoryCategory* p_cat = cats->at(i);
+ if(p_cat && p_cat->getPreferredType() == preferred_type)
{
const LLUUID& folder_id = cats->at(i)->getUUID();
if (rv.isNull() || folder_id < rv)
@@ -1659,9 +1660,18 @@ void LLInventoryModel::notifyObservers()
iter = mObservers.upper_bound(observer);
}
- mModifyMask = LLInventoryObserver::NONE;
+ // If there were any changes that arrived during notifyObservers,
+ // shedule them for next loop
+ mModifyMask = mModifyMaskBacklog;
mChangedItemIDs.clear();
+ mChangedItemIDs.insert(mChangedItemIDsBacklog.begin(), mChangedItemIDsBacklog.end());
mAddedItemIDs.clear();
+ mAddedItemIDs.insert(mAddedItemIDsBacklog.begin(), mAddedItemIDsBacklog.end());
+
+ mModifyMaskBacklog = LLInventoryObserver::NONE;
+ mChangedItemIDsBacklog.clear();
+ mAddedItemIDsBacklog.clear();
+
mIsNotifyObservers = FALSE;
}
@@ -1673,8 +1683,10 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent)
{
// Something marked an item for change within a call to notifyObservers
// (which is in the process of processing the list of items marked for change).
- // This means the change may fail to be processed.
- LL_WARNS(LOG_INV) << "Adding changed mask within notify observers! Change will likely be lost." << LL_ENDL;
+ // This means the change will have to be processed later.
+ // It's preferable for this not to happen, but it's not an issue unless code
+ // specifically wants to notifyObservers immediately (changes won't happen untill later)
+ LL_WARNS(LOG_INV) << "Adding changed mask within notify observers! Change's processing will be performed on idle." << LL_ENDL;
LLViewerInventoryItem *item = getItem(referent);
if (item)
{
@@ -1689,17 +1701,40 @@ void LLInventoryModel::addChangedMask(U32 mask, const LLUUID& referent)
}
}
}
-
- mModifyMask |= mask;
+
+ if (mIsNotifyObservers)
+ {
+ mModifyMaskBacklog |= mask;
+ }
+ else
+ {
+ mModifyMask |= mask;
+ }
+
if (referent.notNull() && (mChangedItemIDs.find(referent) == mChangedItemIDs.end()))
{
- mChangedItemIDs.insert(referent);
+ if (mIsNotifyObservers)
+ {
+ mChangedItemIDsBacklog.insert(referent);
+ }
+ else
+ {
+ mChangedItemIDs.insert(referent);
+ }
+
update_marketplace_category(referent, false);
- if (mask & LLInventoryObserver::ADD)
- {
- mAddedItemIDs.insert(referent);
- }
+ if (mask & LLInventoryObserver::ADD)
+ {
+ if (mIsNotifyObservers)
+ {
+ mAddedItemIDsBacklog.insert(referent);
+ }
+ else
+ {
+ mAddedItemIDs.insert(referent);
+ }
+ }
// Update all linked items. Starting with just LABEL because I'm
// not sure what else might need to be accounted for this.
@@ -2660,7 +2695,10 @@ void LLInventoryModel::createCommonSystemCategories()
gInventory.findCategoryUUIDForType(LLFolderType::FT_FAVORITE,true);
gInventory.findCategoryUUIDForType(LLFolderType::FT_CALLINGCARD,true);
gInventory.findCategoryUUIDForType(LLFolderType::FT_MY_OUTFITS,true);
+ gInventory.findCategoryUUIDForType(LLFolderType::FT_CURRENT_OUTFIT, true);
+ gInventory.findCategoryUUIDForType(LLFolderType::FT_LANDMARK, true); // folder should exist before user tries to 'landmark this'
gInventory.findCategoryUUIDForType(LLFolderType::FT_SETTINGS, true);
+ gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX, true);
}
struct LLUUIDAndName
@@ -3705,17 +3743,18 @@ void LLInventoryModel::dumpInventory() const
// returning an overall good/bad flag.
bool LLInventoryModel::validate() const
{
- bool valid = true;
+ const S32 MAX_VERBOSE_ERRORS = 40; // too many errors can cause disconect or freeze
+ S32 error_count = 0;
if (getRootFolderID().isNull())
{
LL_WARNS() << "no root folder id" << LL_ENDL;
- valid = false;
+ error_count++;
}
if (getLibraryRootFolderID().isNull())
{
LL_WARNS() << "no root folder id" << LL_ENDL;
- valid = false;
+ error_count++;
}
if (mCategoryMap.size() + 1 != mParentChildCategoryTree.size())
@@ -3723,7 +3762,7 @@ bool LLInventoryModel::validate() const
// ParentChild should be one larger because of the special entry for null uuid.
LL_INFOS() << "unexpected sizes: cat map size " << mCategoryMap.size()
<< " parent/child " << mParentChildCategoryTree.size() << LL_ENDL;
- valid = false;
+ error_count++;
}
S32 cat_lock = 0;
S32 item_lock = 0;
@@ -3735,23 +3774,32 @@ bool LLInventoryModel::validate() const
const LLViewerInventoryCategory *cat = cit->second;
if (!cat)
{
- LL_WARNS() << "invalid cat" << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "invalid cat" << LL_ENDL;
+ }
+ error_count++;
continue;
}
if (cat_id != cat->getUUID())
{
- LL_WARNS() << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "cat id/index mismatch " << cat_id << " " << cat->getUUID() << LL_ENDL;
+ }
+ error_count++;
}
if (cat->getParentUUID().isNull())
{
if (cat_id != getRootFolderID() && cat_id != getLibraryRootFolderID())
{
- LL_WARNS() << "cat " << cat_id << " has no parent, but is not root ("
- << getRootFolderID() << ") or library root ("
- << getLibraryRootFolderID() << ")" << LL_ENDL;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "cat " << cat_id << " has no parent, but is not root ("
+ << getRootFolderID() << ") or library root ("
+ << getLibraryRootFolderID() << ")" << LL_ENDL;
+ }
}
}
cat_array_t* cats;
@@ -3759,8 +3807,11 @@ bool LLInventoryModel::validate() const
getDirectDescendentsOf(cat_id,cats,items);
if (!cats || !items)
{
- LL_WARNS() << "invalid direct descendents for " << cat_id << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "invalid direct descendents for " << cat_id << LL_ENDL;
+ }
+ error_count++;
continue;
}
if (cat->getDescendentCount() == LLViewerInventoryCategory::DESCENDENT_COUNT_UNKNOWN)
@@ -3769,12 +3820,15 @@ bool LLInventoryModel::validate() const
}
else if (cats->size() + items->size() != cat->getDescendentCount())
{
- LL_WARNS() << "invalid desc count for " << cat_id << " name [" << cat->getName()
- << "] parent " << cat->getParentUUID()
- << " cached " << cat->getDescendentCount()
- << " expected " << cats->size() << "+" << items->size()
- << "=" << cats->size() +items->size() << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "invalid desc count for " << cat_id << " name [" << cat->getName()
+ << "] parent " << cat->getParentUUID()
+ << " cached " << cat->getDescendentCount()
+ << " expected " << cats->size() << "+" << items->size()
+ << "=" << cats->size() + items->size() << LL_ENDL;
+ }
+ error_count++;
}
if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)
{
@@ -3794,8 +3848,11 @@ bool LLInventoryModel::validate() const
if (!item)
{
- LL_WARNS() << "null item at index " << i << " for cat " << cat_id << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "null item at index " << i << " for cat " << cat_id << LL_ENDL;
+ }
+ error_count++;
continue;
}
@@ -3803,10 +3860,13 @@ bool LLInventoryModel::validate() const
if (item->getParentUUID() != cat_id)
{
- LL_WARNS() << "wrong parent for " << item_id << " found "
- << item->getParentUUID() << " expected " << cat_id
- << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "wrong parent for " << item_id << " found "
+ << item->getParentUUID() << " expected " << cat_id
+ << LL_ENDL;
+ }
+ error_count++;
}
@@ -3814,17 +3874,24 @@ bool LLInventoryModel::validate() const
item_map_t::const_iterator it = mItemMap.find(item_id);
if (it == mItemMap.end())
{
- LL_WARNS() << "item " << item_id << " found as child of "
- << cat_id << " but not in top level mItemMap" << LL_ENDL;
- valid = false;
+
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "item " << item_id << " found as child of "
+ << cat_id << " but not in top level mItemMap" << LL_ENDL;
+ }
+ error_count++;
}
else
{
LLViewerInventoryItem *top_item = it->second;
if (top_item != item)
{
- LL_WARNS() << "item mismatch, item_id " << item_id
- << " top level entry is different, uuid " << top_item->getUUID() << LL_ENDL;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "item mismatch, item_id " << item_id
+ << " top level entry is different, uuid " << top_item->getUUID() << LL_ENDL;
+ }
}
}
@@ -3833,19 +3900,25 @@ bool LLInventoryModel::validate() const
bool found = getObjectTopmostAncestor(item_id, topmost_ancestor_id);
if (!found)
{
- LL_WARNS() << "unable to find topmost ancestor for " << item_id << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "unable to find topmost ancestor for " << item_id << LL_ENDL;
+ }
+ error_count++;
}
else
{
if (topmost_ancestor_id != getRootFolderID() &&
topmost_ancestor_id != getLibraryRootFolderID())
{
- LL_WARNS() << "unrecognized top level ancestor for " << item_id
- << " got " << topmost_ancestor_id
- << " expected " << getRootFolderID()
- << " or " << getLibraryRootFolderID() << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "unrecognized top level ancestor for " << item_id
+ << " got " << topmost_ancestor_id
+ << " expected " << getRootFolderID()
+ << " or " << getLibraryRootFolderID() << LL_ENDL;
+ }
+ error_count++;
}
}
}
@@ -3859,9 +3932,12 @@ bool LLInventoryModel::validate() const
getDirectDescendentsOf(parent_id,cats,items);
if (!cats)
{
- LL_WARNS() << "cat " << cat_id << " name [" << cat->getName()
- << "] orphaned - no child cat array for alleged parent " << parent_id << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "cat " << cat_id << " name [" << cat->getName()
+ << "] orphaned - no child cat array for alleged parent " << parent_id << LL_ENDL;
+ }
+ error_count++;
}
else
{
@@ -3877,8 +3953,11 @@ bool LLInventoryModel::validate() const
}
if (!found)
{
- LL_WARNS() << "cat " << cat_id << " name [" << cat->getName()
- << "] orphaned - not found in child cat array of alleged parent " << parent_id << LL_ENDL;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "cat " << cat_id << " name [" << cat->getName()
+ << "] orphaned - not found in child cat array of alleged parent " << parent_id << LL_ENDL;
+ }
}
}
}
@@ -3890,24 +3969,33 @@ bool LLInventoryModel::validate() const
LLViewerInventoryItem *item = iit->second;
if (item->getUUID() != item_id)
{
- LL_WARNS() << "item_id " << item_id << " does not match " << item->getUUID() << LL_ENDL;
- valid = false;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "item_id " << item_id << " does not match " << item->getUUID() << LL_ENDL;
+ }
+ error_count++;
}
const LLUUID& parent_id = item->getParentUUID();
if (parent_id.isNull())
{
- LL_WARNS() << "item " << item_id << " name [" << item->getName() << "] has null parent id!" << LL_ENDL;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "item " << item_id << " name [" << item->getName() << "] has null parent id!" << LL_ENDL;
+ }
}
- else
+ else if (error_count < MAX_VERBOSE_ERRORS)
{
cat_array_t* cats;
item_array_t* items;
getDirectDescendentsOf(parent_id,cats,items);
if (!items)
{
- LL_WARNS() << "item " << item_id << " name [" << item->getName()
- << "] orphaned - alleged parent has no child items list " << parent_id << LL_ENDL;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "item " << item_id << " name [" << item->getName()
+ << "] orphaned - alleged parent has no child items list " << parent_id << LL_ENDL;
+ }
}
else
{
@@ -3922,63 +4010,70 @@ bool LLInventoryModel::validate() const
}
if (!found)
{
- LL_WARNS() << "item " << item_id << " name [" << item->getName()
- << "] orphaned - not found as child of alleged parent " << parent_id << LL_ENDL;
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ LL_WARNS() << "item " << item_id << " name [" << item->getName()
+ << "] orphaned - not found as child of alleged parent " << parent_id << LL_ENDL;
+ }
}
}
}
- // Link checking
- if (item->getIsLinkType())
- {
- const LLUUID& link_id = item->getUUID();
- const LLUUID& target_id = item->getLinkedUUID();
- LLViewerInventoryItem *target_item = getItem(target_id);
- LLViewerInventoryCategory *target_cat = getCategory(target_id);
- // Linked-to UUID should have back reference to this link.
- if (!hasBacklinkInfo(link_id, target_id))
- {
- LL_WARNS() << "link " << item->getUUID() << " type " << item->getActualType()
- << " missing backlink info at target_id " << target_id
- << LL_ENDL;
- }
- // Links should have referents.
- if (item->getActualType() == LLAssetType::AT_LINK && !target_item)
- {
- LL_WARNS() << "broken item link " << item->getName() << " id " << item->getUUID() << LL_ENDL;
- }
- else if (item->getActualType() == LLAssetType::AT_LINK_FOLDER && !target_cat)
- {
- LL_WARNS() << "broken folder link " << item->getName() << " id " << item->getUUID() << LL_ENDL;
- }
- if (target_item && target_item->getIsLinkType())
- {
- LL_WARNS() << "link " << item->getName() << " references a link item "
- << target_item->getName() << " " << target_item->getUUID() << LL_ENDL;
- }
- // Links should not have backlinks.
- std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(link_id);
- if (range.first != range.second)
- {
- LL_WARNS() << "Link item " << item->getName() << " has backlinks!" << LL_ENDL;
- }
- }
- else
- {
- // Check the backlinks of a non-link item.
- const LLUUID& target_id = item->getUUID();
- std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(target_id);
- for (backlink_mmap_t::const_iterator it = range.first; it != range.second; ++it)
- {
- const LLUUID& link_id = it->second;
- LLViewerInventoryItem *link_item = getItem(link_id);
- if (!link_item || !link_item->getIsLinkType())
- {
- LL_WARNS() << "invalid backlink from target " << item->getName() << " to " << link_id << LL_ENDL;
- }
- }
- }
+ // Link checking
+ if (error_count < MAX_VERBOSE_ERRORS)
+ {
+ if (item->getIsLinkType())
+ {
+ const LLUUID& link_id = item->getUUID();
+ const LLUUID& target_id = item->getLinkedUUID();
+ LLViewerInventoryItem *target_item = getItem(target_id);
+ LLViewerInventoryCategory *target_cat = getCategory(target_id);
+ // Linked-to UUID should have back reference to this link.
+ if (!hasBacklinkInfo(link_id, target_id))
+ {
+ LL_WARNS() << "link " << item->getUUID() << " type " << item->getActualType()
+ << " missing backlink info at target_id " << target_id
+ << LL_ENDL;
+ }
+ // Links should have referents.
+ if (item->getActualType() == LLAssetType::AT_LINK && !target_item)
+ {
+ LL_WARNS() << "broken item link " << item->getName() << " id " << item->getUUID() << LL_ENDL;
+ }
+ else if (item->getActualType() == LLAssetType::AT_LINK_FOLDER && !target_cat)
+ {
+ LL_WARNS() << "broken folder link " << item->getName() << " id " << item->getUUID() << LL_ENDL;
+ }
+ if (target_item && target_item->getIsLinkType())
+ {
+ LL_WARNS() << "link " << item->getName() << " references a link item "
+ << target_item->getName() << " " << target_item->getUUID() << LL_ENDL;
+ }
+
+ // Links should not have backlinks.
+ std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(link_id);
+ if (range.first != range.second)
+ {
+ LL_WARNS() << "Link item " << item->getName() << " has backlinks!" << LL_ENDL;
+ }
+ }
+ else
+ {
+ // Check the backlinks of a non-link item.
+ const LLUUID& target_id = item->getUUID();
+ std::pair<backlink_mmap_t::const_iterator, backlink_mmap_t::const_iterator> range = mBacklinkMMap.equal_range(target_id);
+ for (backlink_mmap_t::const_iterator it = range.first; it != range.second; ++it)
+ {
+ const LLUUID& link_id = it->second;
+ LLViewerInventoryItem *link_item = getItem(link_id);
+ if (!link_item || !link_item->getIsLinkType())
+ {
+ LL_WARNS() << "invalid backlink from target " << item->getName() << " to " << link_id << LL_ENDL;
+ }
+ }
+ }
+ }
}
if (cat_lock > 0 || item_lock > 0)
@@ -3995,9 +4090,9 @@ bool LLInventoryModel::validate() const
LL_INFOS() << "Found " << version_unknown_count << " cats with unknown version" << LL_ENDL;
}
- LL_INFOS() << "Validate done, valid = " << (U32) valid << LL_ENDL;
+ LL_INFOS() << "Validate done, found " << error_count << " errors" << LL_ENDL;
- return valid;
+ return error_count == 0;
}
///----------------------------------------------------------------------------
diff --git a/indra/newview/llinventorymodel.h b/indra/newview/llinventorymodel.h
index a4326aaeed..4dcd9332be 100644
--- a/indra/newview/llinventorymodel.h
+++ b/indra/newview/llinventorymodel.h
@@ -538,6 +538,10 @@ private:
U32 mModifyMask;
changed_items_t mChangedItemIDs;
changed_items_t mAddedItemIDs;
+ // Fallback when notifyObservers is in progress
+ U32 mModifyMaskBacklog;
+ changed_items_t mChangedItemIDsBacklog;
+ changed_items_t mAddedItemIDsBacklog;
//--------------------------------------------------------------------
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 3608f9e23f..05d9fec701 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -44,6 +44,7 @@
#include "llinventoryfunctions.h"
#include "llinventorymodelbackgroundfetch.h"
#include "llnotificationsutil.h"
+#include "llpanelmaininventory.h"
#include "llpreview.h"
#include "llsidepanelinventory.h"
#include "llstartup.h"
@@ -1614,7 +1615,7 @@ void LLInventoryPanel::openInventoryPanelAndSetSelection(BOOL auto_open, const L
bool in_inbox = (gInventory.isObjectDescendentOf(obj_id, gInventory.findCategoryUUIDForType(LLFolderType::FT_INBOX)));
- if (main_panel && !in_inbox)
+ if (!in_inbox && (main_panel || !sidepanel_inventory->getMainInventoryPanel()->isRecentItemsPanelSelected()))
{
sidepanel_inventory->selectAllItemsPanel();
}
diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp
index eebc2486a2..fb9885b454 100644
--- a/indra/newview/lllogchat.cpp
+++ b/indra/newview/lllogchat.cpp
@@ -30,6 +30,7 @@
#include "llagentui.h"
#include "llavatarnamecache.h"
#include "lllogchat.h"
+#include "llregex.h"
#include "lltrans.h"
#include "llviewercontrol.h"
@@ -40,7 +41,6 @@
#include <boost/algorithm/string/trim.hpp>
#include <boost/algorithm/string/replace.hpp>
-#include <boost/regex.hpp>
#include <boost/regex/v4/match_results.hpp>
#include <boost/foreach.hpp>
@@ -250,8 +250,8 @@ std::string LLLogChat::makeLogFileName(std::string filename)
**/
boost::match_results<std::string::const_iterator> matches;
- bool inboundConf = boost::regex_match(filename, matches, INBOUND_CONFERENCE);
- bool outboundConf = boost::regex_match(filename, matches, OUTBOUND_CONFERENCE);
+ bool inboundConf = ll_regex_match(filename, matches, INBOUND_CONFERENCE);
+ bool outboundConf = ll_regex_match(filename, matches, OUTBOUND_CONFERENCE);
if (!(inboundConf || outboundConf))
{
if( gSavedPerAccountSettings.getBOOL("LogFileNamewithDate") )
@@ -837,7 +837,7 @@ bool LLLogChat::isTranscriptFileFound(std::string fullname)
{
//matching a timestamp
boost::match_results<std::string::const_iterator> matches;
- if (boost::regex_match(remove_utf8_bom(buffer), matches, TIMESTAMP))
+ if (ll_regex_match(remove_utf8_bom(buffer), matches, TIMESTAMP))
{
result = true;
}
@@ -917,7 +917,7 @@ bool LLChatLogParser::parse(std::string& raw, LLSD& im, const LLSD& parse_params
//matching a timestamp
boost::match_results<std::string::const_iterator> matches;
- if (!boost::regex_match(raw, matches, TIMESTAMP_AND_STUFF)) return false;
+ if (!ll_regex_match(raw, matches, TIMESTAMP_AND_STUFF)) return false;
bool has_timestamp = matches[IDX_TIMESTAMP].matched;
if (has_timestamp)
@@ -950,7 +950,7 @@ bool LLChatLogParser::parse(std::string& raw, LLSD& im, const LLSD& parse_params
//matching a name and a text
std::string stuff = matches[IDX_STUFF];
boost::match_results<std::string::const_iterator> name_and_text;
- if (!boost::regex_match(stuff, name_and_text, NAME_AND_TEXT)) return false;
+ if (!ll_regex_match(stuff, name_and_text, NAME_AND_TEXT)) return false;
bool has_name = name_and_text[IDX_NAME].matched;
std::string name = LLURI::unescape(name_and_text[IDX_NAME]);
diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp
index c7a0665630..89eb941106 100644
--- a/indra/newview/llmachineid.cpp
+++ b/indra/newview/llmachineid.cpp
@@ -30,7 +30,6 @@
#if LL_WINDOWS
#define _WIN32_DCOM
#include <iostream>
-using namespace std;
#include <comdef.h>
#include <Wbemidl.h>
#elif LL_DARWIN
@@ -89,7 +88,7 @@ void LLWMIMethods::initCOMObjects()
mHR = CoInitializeEx(0, COINIT_MULTITHREADED);
if (FAILED(mHR))
{
- LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << hex << mHR << LL_ENDL;
+ LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << std::hex << mHR << LL_ENDL;
return;
}
@@ -114,7 +113,7 @@ void LLWMIMethods::initCOMObjects()
if (FAILED(mHR))
{
- LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x" << hex << mHR << LL_ENDL;
+ LL_WARNS("AppInit") << "Failed to initialize security. Error code = 0x" << std::hex << mHR << LL_ENDL;
CoUninitialize();
return; // Program has failed.
}
@@ -130,7 +129,7 @@ void LLWMIMethods::initCOMObjects()
if (FAILED(mHR))
{
- LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << hex << mHR << LL_ENDL;
+ LL_WARNS("AppInit") << "Failed to create IWbemLocator object." << " Err code = 0x" << std::hex << mHR << LL_ENDL;
CoUninitialize();
return; // Program has failed.
}
@@ -154,7 +153,7 @@ void LLWMIMethods::initCOMObjects()
if (FAILED(mHR))
{
- LL_WARNS("AppInit") << "Could not connect. Error code = 0x" << hex << mHR << LL_ENDL;
+ LL_WARNS("AppInit") << "Could not connect. Error code = 0x" << std::hex << mHR << LL_ENDL;
pLoc->Release();
CoUninitialize();
return; // Program has failed.
@@ -178,7 +177,7 @@ void LLWMIMethods::initCOMObjects()
if (FAILED(mHR))
{
- LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x" << hex << mHR << LL_ENDL;
+ LL_WARNS("AppInit") << "Could not set proxy blanket. Error code = 0x" << std::hex << mHR << LL_ENDL;
cleanCOMObjects();
return; // Program has failed.
}
@@ -247,7 +246,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var
if (FAILED(hres))
{
- LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << hex << hres << LL_ENDL;
+ LL_WARNS("AppInit") << "Query for operating system name failed." << " Error code = 0x" << std::hex << hres << LL_ENDL;
return false; // Program has failed.
}
@@ -274,7 +273,7 @@ bool LLWMIMethods::getGenericSerialNumber(const BSTR &select, const LPCWSTR &var
hr = pclsObj->Get(variable, 0, &vtProp, 0, 0);
if (FAILED(hr))
{
- LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << hex << hres << LL_ENDL;
+ LL_WARNS() << "Failed to get SerialNumber. Error code = 0x" << std::hex << hres << LL_ENDL;
pclsObj->Release();
pclsObj = NULL;
continue;
diff --git a/indra/newview/llpanelexperiencepicker.cpp b/indra/newview/llpanelexperiencepicker.cpp
index 80aeee6da1..6dfdbaf63f 100644
--- a/indra/newview/llpanelexperiencepicker.cpp
+++ b/indra/newview/llpanelexperiencepicker.cpp
@@ -41,8 +41,8 @@
#include "llcombobox.h"
#include "llviewercontrol.h"
#include "llfloater.h"
+#include "llregex.h"
#include "lltrans.h"
-#include <boost/regex.hpp>
#define BTN_FIND "find"
#define BTN_OK "ok_btn"
@@ -116,7 +116,7 @@ void LLPanelExperiencePicker::onBtnFind()
boost::cmatch what;
std::string text = getChild<LLUICtrl>(TEXT_EDIT)->getValue().asString();
const boost::regex expression("secondlife:///app/experience/[\\da-f-]+/profile");
- if (boost::regex_match(text.c_str(), what, expression))
+ if (ll_regex_match(text.c_str(), what, expression))
{
LLURI uri(text);
LLSD path_array = uri.pathArray();
diff --git a/indra/newview/llpanelmaininventory.cpp b/indra/newview/llpanelmaininventory.cpp
index e9c9c451a2..1a1792fb60 100644
--- a/indra/newview/llpanelmaininventory.cpp
+++ b/indra/newview/llpanelmaininventory.cpp
@@ -62,15 +62,11 @@
const std::string FILTERS_FILENAME("filters.xml");
-static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory");
+const std::string ALL_ITEMS("All Items");
+const std::string RECENT_ITEMS("Recent Items");
+const std::string WORN_ITEMS("Worn Items");
-void on_file_loaded_for_save(BOOL success,
- LLViewerFetchedTexture *src_vi,
- LLImageRaw* src,
- LLImageRaw* aux_src,
- S32 discard_level,
- BOOL final,
- void* userdata);
+static LLPanelInjector<LLPanelMainInventory> t_inventory("panel_main_inventory");
///----------------------------------------------------------------------------
/// LLFloaterInventoryFinder
@@ -149,7 +145,7 @@ BOOL LLPanelMainInventory::postBuild()
//panel->getFilter().markDefault();
// Set up the default inv. panel/filter settings.
- mActivePanel = getChild<LLInventoryPanel>("All Items");
+ mActivePanel = getChild<LLInventoryPanel>(ALL_ITEMS);
if (mActivePanel)
{
// "All Items" is the previous only view, so it gets the InventorySortOrder
@@ -159,7 +155,7 @@ BOOL LLPanelMainInventory::postBuild()
mActivePanel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, mActivePanel, _1, _2));
mResortActivePanel = true;
}
- LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>("Recent Items");
+ LLInventoryPanel* recent_items_panel = getChild<LLInventoryPanel>(RECENT_ITEMS);
if (recent_items_panel)
{
// assign default values until we will be sure that we have setting to restore
@@ -174,7 +170,7 @@ BOOL LLPanelMainInventory::postBuild()
recent_items_panel->setSelectCallback(boost::bind(&LLPanelMainInventory::onSelectionChange, this, recent_items_panel, _1, _2));
}
- mWornItemsPanel = getChild<LLInventoryPanel>("Worn Items");
+ mWornItemsPanel = getChild<LLInventoryPanel>(WORN_ITEMS);
if (mWornItemsPanel)
{
U32 filter_types = 0x0;
@@ -271,7 +267,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
// for example, LLParamSDParser doesn't know about U64,
// so some FilterOps params should be revised.
LLSD filterRoot;
- LLInventoryPanel* all_items_panel = getChild<LLInventoryPanel>("All Items");
+ LLInventoryPanel* all_items_panel = getChild<LLInventoryPanel>(ALL_ITEMS);
if (all_items_panel)
{
LLSD filterState;
@@ -285,7 +281,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
}
}
- LLInventoryPanel* panel = findChild<LLInventoryPanel>("Recent Items");
+ LLInventoryPanel* panel = findChild<LLInventoryPanel>(RECENT_ITEMS);
if (panel)
{
LLSD filterState;
@@ -316,7 +312,7 @@ LLPanelMainInventory::~LLPanelMainInventory( void )
LLInventoryPanel* LLPanelMainInventory::getAllItemsPanel()
{
- return getChild<LLInventoryPanel>("All Items");
+ return getChild<LLInventoryPanel>(ALL_ITEMS);
}
void LLPanelMainInventory::selectAllItemsPanel()
@@ -324,6 +320,11 @@ void LLPanelMainInventory::selectAllItemsPanel()
mFilterTabs->selectFirstTab();
}
+bool LLPanelMainInventory::isRecentItemsPanelSelected()
+{
+ return (RECENT_ITEMS == getActivePanel()->getName());
+}
+
void LLPanelMainInventory::startSearch()
{
// this forces focus to line editor portion of search editor
@@ -439,7 +440,7 @@ void LLPanelMainInventory::setSortBy(const LLSD& userdata)
}
getActivePanel()->setSortOrder(sort_order_mask);
- if ("Recent Items" == getActivePanel()->getName())
+ if (isRecentItemsPanelSelected())
{
gSavedSettings.setU32("RecentItemsSortOrder", sort_order_mask);
}
@@ -801,8 +802,8 @@ void LLPanelMainInventory::toggleFindOptions()
void LLPanelMainInventory::setSelectCallback(const LLFolderView::signal_t::slot_type& cb)
{
- getChild<LLInventoryPanel>("All Items")->setSelectCallback(cb);
- getChild<LLInventoryPanel>("Recent Items")->setSelectCallback(cb);
+ getChild<LLInventoryPanel>(ALL_ITEMS)->setSelectCallback(cb);
+ getChild<LLInventoryPanel>(RECENT_ITEMS)->setSelectCallback(cb);
}
void LLPanelMainInventory::onSelectionChange(LLInventoryPanel *panel, const std::deque<LLFolderViewItem*>& items, BOOL user_action)
@@ -1200,11 +1201,11 @@ void LLPanelMainInventory::onAddButtonClick()
{
// Gray out the "New Folder" option when the Recent tab is active as new folders will not be displayed
// unless "Always show folders" is checked in the filter options.
- bool recent_active = ("Recent Items" == mActivePanel->getName());
+
LLMenuGL* menu = (LLMenuGL*)mMenuAddHandle.get();
if (menu)
{
- menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(!recent_active);
+ menu->getChild<LLMenuItemGL>("New Folder")->setEnabled(!isRecentItemsPanelSelected());
setUploadCostIfNeeded();
diff --git a/indra/newview/llpanelmaininventory.h b/indra/newview/llpanelmaininventory.h
index dfb8db9d12..257bce930c 100644
--- a/indra/newview/llpanelmaininventory.h
+++ b/indra/newview/llpanelmaininventory.h
@@ -81,6 +81,8 @@ public:
void selectAllItemsPanel();
const LLInventoryPanel* getActivePanel() const { return mActivePanel; }
+ bool isRecentItemsPanelSelected();
+
const std::string& getFilterText() const { return mFilterText; }
void setSelectCallback(const LLFolderView::signal_t::slot_type& cb);
diff --git a/indra/newview/llpanelobject.cpp b/indra/newview/llpanelobject.cpp
index 6bff95ab36..831c89b005 100644
--- a/indra/newview/llpanelobject.cpp
+++ b/indra/newview/llpanelobject.cpp
@@ -896,7 +896,7 @@ void LLPanelObject::getState( )
mSpinScaleY->setMaxValue(OBJECT_MAX_HOLE_SIZE_Y);
break;
default:
- if (editable)
+ if (editable && single_volume)
{
mSpinScaleX->set( 1.f - scale_x );
mSpinScaleY->set( 1.f - scale_y );
diff --git a/indra/newview/llpanelsnapshotpostcard.cpp b/indra/newview/llpanelsnapshotpostcard.cpp
index b8aa976657..05fa2b58b1 100644
--- a/indra/newview/llpanelsnapshotpostcard.cpp
+++ b/indra/newview/llpanelsnapshotpostcard.cpp
@@ -38,6 +38,7 @@
#include "llfloatersnapshot.h" // FIXME: replace with a snapshot storage model
#include "llpanelsnapshot.h"
#include "llpostcard.h"
+#include "llregex.h"
#include "llsnapshotlivepreview.h"
#include "llviewercontrol.h" // gSavedSettings
#include "llviewerwindow.h"
@@ -229,7 +230,7 @@ void LLPanelSnapshotPostcard::onSend()
boost::regex email_format("[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,}(,[ \t]*[A-Za-z0-9.%+-_]+@[A-Za-z0-9.-]+\\.[A-Za-z]{2,})*");
- if (to.empty() || !boost::regex_match(to, email_format))
+ if (to.empty() || !ll_regex_match(to, email_format))
{
LLNotificationsUtil::add("PromptRecipientEmail");
return;
diff --git a/indra/newview/llsecapi.h b/indra/newview/llsecapi.h
index 14059f828a..3a7b06c55a 100644
--- a/indra/newview/llsecapi.h
+++ b/indra/newview/llsecapi.h
@@ -264,7 +264,9 @@ public:
virtual void validate(int validation_policy,
LLPointer<LLCertificateChain> cert_chain,
const LLSD& validation_params) =0;
-
+
+ // Clear cache if any
+ virtual void clearSertCache()=0;
};
diff --git a/indra/newview/llsechandler_basic.h b/indra/newview/llsechandler_basic.h
index b21a5d08f9..0ff5e30c9b 100644
--- a/indra/newview/llsechandler_basic.h
+++ b/indra/newview/llsechandler_basic.h
@@ -177,7 +177,10 @@ public:
virtual void validate(int validation_policy,
LLPointer<LLCertificateChain> ca_chain,
const LLSD& validation_params);
-
+
+ // Clears cache of certs validated agains store
+ virtual void clearSertCache() { mTrustedCertCache.clear(); }
+
protected:
std::vector<LLPointer<LLCertificate> > mCerts;
diff --git a/indra/newview/llselectmgr.cpp b/indra/newview/llselectmgr.cpp
index 50884762a8..5bbdeb1f98 100644
--- a/indra/newview/llselectmgr.cpp
+++ b/indra/newview/llselectmgr.cpp
@@ -1368,11 +1368,8 @@ void LLSelectMgr::getGrid(LLVector3& origin, LLQuaternion &rotation, LLVector3 &
}
break;
case SELECT_TYPE_HUD:
- // use HUD-scaled grid
- mGridScale = LLVector3(0.25f, 0.25f, 0.25f);
- break;
case SELECT_TYPE_WORLD:
- mGridScale = LLVector3(1.f, 1.f, 1.f) * gSavedSettings.getF32("GridResolution");
+ mGridScale = LLVector3(1.f, 1.f, 1.f) * llmin(gSavedSettings.getF32("GridResolution"), 0.5f);
break;
}
}
diff --git a/indra/newview/llstartup.cpp b/indra/newview/llstartup.cpp
index 1242131534..f22be6481a 100644
--- a/indra/newview/llstartup.cpp
+++ b/indra/newview/llstartup.cpp
@@ -2817,6 +2817,11 @@ void reset_login()
// Hide any other stuff
LLFloaterReg::hideVisibleInstances();
LLStartUp::setStartupState( STATE_BROWSER_INIT );
+
+ // Clear any verified certs and verify them again on next login
+ // to ensure cert matches server instead of just getting reused
+ LLPointer<LLCertificateStore> store = gSecAPIHandler->getCertificateStore("");
+ store->clearSertCache();
}
//---------------------------------------------------------------------------
diff --git a/indra/newview/lltoast.h b/indra/newview/lltoast.h
index 69074b1670..2b1fedf74d 100644
--- a/indra/newview/lltoast.h
+++ b/indra/newview/lltoast.h
@@ -222,7 +222,7 @@ private:
LLPanel* mWrapperPanel;
// timer counts a lifetime of a toast
- std::auto_ptr<LLToastLifeTimer> mTimer;
+ std::unique_ptr<LLToastLifeTimer> mTimer;
F32 mToastLifetime; // in seconds
F32 mToastFadingTime; // in seconds
diff --git a/indra/newview/lltoolpie.cpp b/indra/newview/lltoolpie.cpp
index 585988f4bf..54ff7d295e 100644
--- a/indra/newview/lltoolpie.cpp
+++ b/indra/newview/lltoolpie.cpp
@@ -460,8 +460,9 @@ BOOL LLToolPie::useClickAction(MASK mask,
&& object
&& !object->isAttachment()
&& LLPrimitive::isPrimitive(object->getPCode())
- && (object->getClickAction()
- || parent->getClickAction());
+ // useClickAction does not handle Touch (0) or Disabled action
+ && ((object->getClickAction() && object->getClickAction() != CLICK_ACTION_DISABLED)
+ || (parent && parent->getClickAction() && parent->getClickAction() != CLICK_ACTION_DISABLED));
}
@@ -472,18 +473,18 @@ U8 final_click_action(LLViewerObject* obj)
U8 click_action = CLICK_ACTION_TOUCH;
LLViewerObject* parent = obj->getRootEdit();
- if (obj->getClickAction()
- || (parent && parent->getClickAction()))
- {
- if (obj->getClickAction())
- {
- click_action = obj->getClickAction();
- }
- else if (parent && parent->getClickAction())
- {
- click_action = parent->getClickAction();
- }
- }
+ U8 object_action = obj->getClickAction();
+ U8 parent_action = parent ? parent->getClickAction() : CLICK_ACTION_TOUCH;
+ if (parent_action == CLICK_ACTION_DISABLED || object_action)
+ {
+ // CLICK_ACTION_DISABLED ("None" in UI) is intended for child action to
+ // override parent's action when assigned to parent or to child
+ click_action = object_action;
+ }
+ else if (parent_action)
+ {
+ click_action = parent_action;
+ }
return click_action;
}
@@ -657,9 +658,10 @@ bool LLToolPie::teleportToClickedLocation()
bool is_land = mHoverPick.mPickType == LLPickInfo::PICK_LAND;
bool pos_non_zero = !mHoverPick.mPosGlobal.isExactlyZero();
bool has_touch_handler = (objp && objp->flagHandleTouch()) || (parentp && parentp->flagHandleTouch());
- bool has_click_action = final_click_action(objp);
+ U8 click_action = final_click_action(objp); // default action: 0 - touch
+ bool has_click_action = (click_action || has_touch_handler) && click_action != CLICK_ACTION_DISABLED;
- if (pos_non_zero && (is_land || (is_in_world && !has_touch_handler && !has_click_action)))
+ if (pos_non_zero && (is_land || (is_in_world && !has_click_action)))
{
LLVector3d pos = mHoverPick.mPosGlobal;
pos.mdV[VZ] += gAgentAvatarp->getPelvisToFoot();
@@ -790,7 +792,8 @@ BOOL LLToolPie::handleHover(S32 x, S32 y, MASK mask)
LL_DEBUGS("UserInput") << "hover handled by LLToolPie (inactive)" << LL_ENDL;
}
else if ((!object || !object->isAttachment() || object->getClickAction() != CLICK_ACTION_DISABLED)
- && ((object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch())))
+ && ((object && object->flagHandleTouch()) || (parent && parent->flagHandleTouch()))
+ && (!object || !object->isAvatar()))
{
show_highlight = true;
gViewerWindow->setCursor(UI_CURSOR_HAND);
diff --git a/indra/newview/lltranslate.cpp b/indra/newview/lltranslate.cpp
index 553a3cd086..a2c696c762 100644
--- a/indra/newview/lltranslate.cpp
+++ b/indra/newview/lltranslate.cpp
@@ -197,6 +197,11 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s
LLSD result = httpAdapter->getRawAndSuspend(httpRequest, url, httpOpts, httpHeaders);
+ if (LLApp::isQuitting())
+ {
+ return;
+ }
+
LLSD httpResults = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS];
LLCore::HttpStatus status = LLCoreHttpUtil::HttpCoroutineAdapter::getStatusFromLLSD(httpResults);
@@ -207,7 +212,22 @@ void LLTranslationAPIHandler::translateMessageCoro(LanguagePair_t fromTo, std::s
const LLSD::Binary &rawBody = result[LLCoreHttpUtil::HttpCoroutineAdapter::HTTP_RESULTS_RAW].asBinary();
std::string body(rawBody.begin(), rawBody.end());
- if (this->parseResponse(parseResult, body, translation, detected_lang, err_msg))
+ bool res = false;
+
+ try
+ {
+ res = this->parseResponse(parseResult, body, translation, detected_lang, err_msg);
+ }
+ catch (std::out_of_range&)
+ {
+ LL_WARNS() << "Out of range exception on string " << body << LL_ENDL;
+ }
+ catch (...)
+ {
+ LOG_UNHANDLED_EXCEPTION( "Exception on string " + body );
+ }
+
+ if (res)
{
// Fix up the response
LLStringUtil::replaceString(translation, "&lt;", "<");
diff --git a/indra/newview/llversioninfo.cpp b/indra/newview/llversioninfo.cpp
index 4720a989b0..376a7fce76 100644
--- a/indra/newview/llversioninfo.cpp
+++ b/indra/newview/llversioninfo.cpp
@@ -28,9 +28,9 @@
#include "llviewerprecompiledheaders.h"
#include "llevents.h"
#include "lleventfilter.h"
+#include "llregex.h"
#include "llversioninfo.h"
#include "stringize.h"
-#include <boost/regex.hpp>
#if ! defined(LL_VIEWER_CHANNEL) \
|| ! defined(LL_VIEWER_VERSION_MAJOR) \
@@ -139,19 +139,19 @@ LLVersionInfo::ViewerMaturity LLVersionInfo::getViewerMaturity()
static const boost::regex is_project_channel("\\bProject\\b");
static const boost::regex is_release_channel("\\bRelease\\b");
- if (boost::regex_search(channel, is_release_channel))
+ if (ll_regex_search(channel, is_release_channel))
{
maturity = RELEASE_VIEWER;
}
- else if (boost::regex_search(channel, is_beta_channel))
+ else if (ll_regex_search(channel, is_beta_channel))
{
maturity = BETA_VIEWER;
}
- else if (boost::regex_search(channel, is_project_channel))
+ else if (ll_regex_search(channel, is_project_channel))
{
maturity = PROJECT_VIEWER;
}
- else if (boost::regex_search(channel, is_test_channel))
+ else if (ll_regex_search(channel, is_test_channel))
{
maturity = TEST_VIEWER;
}
diff --git a/indra/newview/llviewerassetupload.cpp b/indra/newview/llviewerassetupload.cpp
index bc07821ccd..0df6811f6a 100644
--- a/indra/newview/llviewerassetupload.cpp
+++ b/indra/newview/llviewerassetupload.cpp
@@ -793,7 +793,7 @@ void LLViewerAssetUpload::AssetInventoryUploadCoproc(LLCoreHttpUtil::HttpCorouti
// Show the preview panel for textures and sounds to let
// user know that the image (or snapshot) arrived intact.
LLInventoryPanel* panel = LLInventoryPanel::getActiveInventoryPanel(FALSE);
- LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, TRUE, TAKE_FOCUS_NO, (panel == NULL));
+ LLInventoryPanel::openInventoryPanelAndSetSelection(TRUE, serverInventoryItem, FALSE, TAKE_FOCUS_NO, (panel == NULL));
// restore keyboard focus
gFocusMgr.setKeyboardFocus(focus);
diff --git a/indra/newview/llvieweraudio.cpp b/indra/newview/llvieweraudio.cpp
index cb20801756..f97ba0930e 100644
--- a/indra/newview/llvieweraudio.cpp
+++ b/indra/newview/llvieweraudio.cpp
@@ -81,7 +81,7 @@ void LLViewerAudio::registerIdleListener()
}
}
-void LLViewerAudio::startInternetStreamWithAutoFade(std::string streamURI)
+void LLViewerAudio::startInternetStreamWithAutoFade(const std::string &streamURI)
{
// Old and new stream are identical
if (mNextStreamURI == streamURI)
diff --git a/indra/newview/llvieweraudio.h b/indra/newview/llvieweraudio.h
index 16f9b63113..782285ce36 100644
--- a/indra/newview/llvieweraudio.h
+++ b/indra/newview/llvieweraudio.h
@@ -55,7 +55,7 @@ public:
FADE_OUT,
};
- void startInternetStreamWithAutoFade(std::string streamURI);
+ void startInternetStreamWithAutoFade(const std::string &streamURI);
void stopInternetStreamWithAutoFade();
bool onIdleUpdate();
@@ -65,7 +65,8 @@ public:
F32 getFadeVolume();
bool getForcedTeleportFade() { return mForcedTeleportFade; };
void setForcedTeleportFade(bool fade) { mForcedTeleportFade = fade;} ;
- void setNextStreamURI(std::string stream) { mNextStreamURI = stream; } ;
+ std::string getNextStreamURI() { return mNextStreamURI; };
+ void setNextStreamURI(const std::string &stream) { mNextStreamURI = stream; } ;
void setWasPlaying(bool playing) { mWasPlaying = playing;} ;
private:
diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp
index 8837bda63d..635b731193 100644
--- a/indra/newview/llviewermenu.cpp
+++ b/indra/newview/llviewermenu.cpp
@@ -7290,7 +7290,7 @@ namespace
};
}
-void queue_actions(LLFloaterScriptQueue* q, const std::string& msg)
+bool queue_actions(LLFloaterScriptQueue* q, const std::string& msg)
{
QueueObjects func(q);
LLSelectMgr *mgr = LLSelectMgr::getInstance();
@@ -7312,6 +7312,7 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& msg)
{
LL_ERRS() << "Bad logic." << LL_ENDL;
}
+ q->closeFloater();
}
else
{
@@ -7320,6 +7321,7 @@ void queue_actions(LLFloaterScriptQueue* q, const std::string& msg)
LL_WARNS() << "Unexpected script compile failure." << LL_ENDL;
}
}
+ return !fail;
}
class LLToolsSelectedScriptAction : public view_listener_t
@@ -7367,8 +7369,10 @@ class LLToolsSelectedScriptAction : public view_listener_t
if (queue)
{
queue->setMono(mono);
- queue_actions(queue, msg);
- queue->setTitle(title);
+ if (queue_actions(queue, msg))
+ {
+ queue->setTitle(title);
+ }
}
else
{
diff --git a/indra/newview/llviewerparcelmgr.cpp b/indra/newview/llviewerparcelmgr.cpp
index 06172e366d..56370df751 100644
--- a/indra/newview/llviewerparcelmgr.cpp
+++ b/indra/newview/llviewerparcelmgr.cpp
@@ -1888,7 +1888,8 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
if (parcel)
{
// Only update stream if parcel changed (recreated) or music is playing (enabled)
- if (!agent_parcel_update || gSavedSettings.getBOOL("MediaTentativeAutoPlay"))
+ static LLCachedControl<bool> already_playing(gSavedSettings, "MediaTentativeAutoPlay", true);
+ if (!agent_parcel_update || already_playing)
{
LLViewerParcelAskPlay::getInstance()->cancelNotification();
std::string music_url_raw = parcel->getMusicURL();
@@ -1906,7 +1907,7 @@ void LLViewerParcelMgr::processParcelProperties(LLMessageSystem *msg, void **use
LLViewerRegion *region = LLWorld::getInstance()->getRegion(msg->getSender());
if (region)
{
- optionally_start_music(music_url, parcel->mLocalID, region->getRegionID());
+ optionallyStartMusic(music_url, parcel->mLocalID, region->getRegionID(), !agent_parcel_update);
}
}
else
@@ -1943,9 +1944,13 @@ void LLViewerParcelMgr::onStartMusicResponse(const LLUUID &region_id, const S32
LL_INFOS("ParcelMgr") << "Starting parcel music " << url << LL_ENDL;
LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(url);
}
+ else
+ {
+ LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
+ }
}
-void LLViewerParcelMgr::optionally_start_music(const std::string &music_url, const S32 &local_id, const LLUUID &region_id)
+void LLViewerParcelMgr::optionallyStartMusic(const std::string &music_url, const S32 &local_id, const LLUUID &region_id, bool switched_parcel)
{
static LLCachedControl<bool> streaming_music(gSavedSettings, "AudioStreamingMusic", true);
if (streaming_music)
@@ -1955,25 +1960,35 @@ void LLViewerParcelMgr::optionally_start_music(const std::string &music_url, con
// only play music when you enter a new parcel if the UI control for this
// was not *explicitly* stopped by the user. (part of SL-4878)
LLPanelNearByMedia* nearby_media_panel = gStatusBar->getNearbyMediaPanel();
+ LLViewerAudio* viewer_audio = LLViewerAudio::getInstance();
// ask mode //todo constants
if (autoplay_mode == 2)
{
- // stop previous stream
- LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
-
// if user set media to play - ask
if ((nearby_media_panel && nearby_media_panel->getParcelAudioAutoStart())
|| (!nearby_media_panel && tentative_autoplay))
{
- LLViewerParcelAskPlay::getInstance()->askToPlay(region_id,
- local_id,
- music_url,
- onStartMusicResponse);
+ // user did not stop audio
+ if (switched_parcel || music_url != viewer_audio->getNextStreamURI())
+ {
+ viewer_audio->startInternetStreamWithAutoFade(LLStringUtil::null);
+
+ LLViewerParcelAskPlay::getInstance()->askToPlay(region_id,
+ local_id,
+ music_url,
+ onStartMusicResponse);
+ }
+ // else do nothing:
+ // Parcel properties changed, but not url.
+ // We are already playing this url and asked about it when agent entered parcel
+ // or user started audio manually at some point
}
else
{
+ // stopped by the user, do not autoplay
LLViewerParcelAskPlay::getInstance()->cancelNotification();
+ viewer_audio->startInternetStreamWithAutoFade(LLStringUtil::null);
}
}
// autoplay
@@ -1985,11 +2000,12 @@ void LLViewerParcelMgr::optionally_start_music(const std::string &music_url, con
&& tentative_autoplay))
{
LL_INFOS("ParcelMgr") << "Starting parcel music " << music_url << LL_ENDL;
- LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(music_url);
+ viewer_audio->startInternetStreamWithAutoFade(music_url);
}
- else
+ // autoplay off
+ else if(switched_parcel || music_url != viewer_audio->getNextStreamURI())
{
- LLViewerAudio::getInstance()->startInternetStreamWithAutoFade(LLStringUtil::null);
+ viewer_audio->startInternetStreamWithAutoFade(LLStringUtil::null);
}
}
}
diff --git a/indra/newview/llviewerparcelmgr.h b/indra/newview/llviewerparcelmgr.h
index 508a63c398..6ce389ab88 100644
--- a/indra/newview/llviewerparcelmgr.h
+++ b/indra/newview/llviewerparcelmgr.h
@@ -271,7 +271,7 @@ public:
//void makeLandmarkAtSelection();
static void onStartMusicResponse(const LLUUID &region_id, const S32 &parcel_id, const std::string &url, const bool &play);
- static void optionally_start_music(const std::string &music_url, const S32 &local_id, const LLUUID &region_id);
+ static void optionallyStartMusic(const std::string &music_url, const S32 &local_id, const LLUUID &region_id, bool switched_parcel);
static void processParcelOverlay(LLMessageSystem *msg, void **user_data);
static void processParcelProperties(LLMessageSystem *msg, void **user_data);
diff --git a/indra/newview/llviewerregion.cpp b/indra/newview/llviewerregion.cpp
index 738a2e95c7..198fe1563c 100644
--- a/indra/newview/llviewerregion.cpp
+++ b/indra/newview/llviewerregion.cpp
@@ -187,7 +187,7 @@ public:
mLandp(NULL)
{}
- void buildCapabilityNames(LLSD& capabilityNames);
+ static void buildCapabilityNames(LLSD& capabilityNames);
// The surfaces and other layers
LLSurface* mLandp;
@@ -260,6 +260,12 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
// This loop is used for retrying a capabilities request.
do
{
+ if (STATE_WORLD_INIT > LLStartUp::getStartupState())
+ {
+ LL_INFOS("AppInit", "Capabilities") << "Aborting capabilities request, reason: returned to login screen" << LL_ENDL;
+ return;
+ }
+
regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
@@ -308,13 +314,19 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCoro(U64 regionHandle)
regionp = NULL;
result = httpAdapter->postAndSuspend(httpRequest, url, capabilityNames);
- ++mSeedCapAttempts;
+ if (STATE_WORLD_INIT > LLStartUp::getStartupState())
+ {
+ LL_INFOS("AppInit", "Capabilities") << "Aborting capabilities request, reason: returned to login screen" << LL_ENDL;
+ return;
+ }
- if (LLApp::isExiting())
+ if (LLApp::isExiting() || gDisconnected)
{
return;
}
+ ++mSeedCapAttempts;
+
regionp = LLWorld::getInstance()->getRegionFromHandle(regionHandle);
if (!regionp) //region was removed
{
@@ -429,7 +441,7 @@ void LLViewerRegionImpl::requestBaseCapabilitiesCompleteCoro(U64 regionHandle)
break; // no retry
}
- if (LLApp::isExiting())
+ if (LLApp::isExiting() || gDisconnected)
{
break;
}
@@ -537,7 +549,7 @@ void LLViewerRegionImpl::requestSimulatorFeatureCoro(std::string url, U64 region
continue;
}
- if (LLApp::isExiting())
+ if (LLApp::isExiting() || gDisconnected)
{
break;
}
@@ -2924,6 +2936,7 @@ void LLViewerRegion::unpackRegionHandshake()
mRegionTimer.reset(); //reset region timer.
}
+// static
void LLViewerRegionImpl::buildCapabilityNames(LLSD& capabilityNames)
{
capabilityNames.append("AbuseCategories");
diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp
index f063800587..ca5305b169 100644
--- a/indra/newview/llvovolume.cpp
+++ b/indra/newview/llvovolume.cpp
@@ -377,6 +377,18 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
{
delete mTextureAnimp;
mTextureAnimp = NULL;
+
+ for (S32 i = 0; i < getNumTEs(); i++)
+ {
+ LLFace* facep = mDrawable->getFace(i);
+ if (facep && facep->mTextureMatrix)
+ {
+ // delete or reset
+ delete facep->mTextureMatrix;
+ facep->mTextureMatrix = NULL;
+ }
+ }
+
gPipeline.markTextured(mDrawable);
mFaceMappingChanged = TRUE;
mTexAnimMode = 0;
@@ -476,6 +488,18 @@ U32 LLVOVolume::processUpdateMessage(LLMessageSystem *mesgsys,
{
delete mTextureAnimp;
mTextureAnimp = NULL;
+
+ for (S32 i = 0; i < getNumTEs(); i++)
+ {
+ LLFace* facep = mDrawable->getFace(i);
+ if (facep && facep->mTextureMatrix)
+ {
+ // delete or reset
+ delete facep->mTextureMatrix;
+ facep->mTextureMatrix = NULL;
+ }
+ }
+
gPipeline.markTextured(mDrawable);
mFaceMappingChanged = TRUE;
mTexAnimMode = 0;
diff --git a/indra/newview/llwatchdog.cpp b/indra/newview/llwatchdog.cpp
index 0aa0280b25..a3036ff6d0 100644
--- a/indra/newview/llwatchdog.cpp
+++ b/indra/newview/llwatchdog.cpp
@@ -224,7 +224,7 @@ void LLWatchdog::run()
LL_INFOS() << "Watchdog thread delayed: resetting entries." << LL_ENDL;
std::for_each(mSuspects.begin(),
mSuspects.end(),
- std::mem_fun(&LLWatchdogEntry::reset)
+ [](SuspectsRegistry::value_type suspect){ suspect->reset(); }
);
}
else
@@ -232,7 +232,7 @@ void LLWatchdog::run()
SuspectsRegistry::iterator result =
std::find_if(mSuspects.begin(),
mSuspects.end(),
- std::not1(std::mem_fun(&LLWatchdogEntry::isAlive))
+ [](SuspectsRegistry::value_type suspect){ return ! suspect->isAlive(); }
);
if(result != mSuspects.end())
{
diff --git a/indra/newview/llweb.cpp b/indra/newview/llweb.cpp
index d019b400e8..b8f1ec35f6 100644
--- a/indra/newview/llweb.cpp
+++ b/indra/newview/llweb.cpp
@@ -38,6 +38,7 @@
#include "llfloaterreg.h"
#include "lllogininstance.h"
#include "llparcel.h"
+#include "llregex.h"
#include "llsd.h"
#include "llui.h"
#include "lluri.h"
@@ -51,8 +52,6 @@
#include "lluriparser.h"
#include "uriparser/Uri.h"
-#include <boost/regex.hpp>
-
bool on_load_url_external_response(const LLSD& notification, const LLSD& response, bool async );
@@ -239,13 +238,13 @@ bool LLWeb::useExternalBrowser(const std::string &url)
boost::regex pattern = boost::regex("\\b(lindenlab.com|secondlife.com|secondlife.io)$", boost::regex::perl|boost::regex::icase);
boost::match_results<std::string::const_iterator> matches;
- return !(boost::regex_search(uri_string, matches, pattern));
+ return !(ll_regex_search(uri_string, matches, pattern));
}
else
{
boost::regex pattern = boost::regex("^mailto:", boost::regex::perl | boost::regex::icase);
boost::match_results<std::string::const_iterator> matches;
- return boost::regex_search(url, matches, pattern);
+ return ll_regex_search(url, matches, pattern);
}
#endif
}