diff options
198 files changed, 2225 insertions, 867 deletions
diff --git a/autobuild.xml b/autobuild.xml index 7d1fa4b258..5920e4d9e5 100644 --- a/autobuild.xml +++ b/autobuild.xml @@ -384,11 +384,11 @@ <key>archive</key> <map> <key>hash</key> - <string>f6835c4d7745cd1cadfbce47b40331d08affb532</string> + <string>e03eb77224290c875ff84f75b7fe3d0e7c162c94</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-dictionaries/releases/download/v1.0.1-dev2.gf887629-f887629/dictionaries-common-None.tar.zst</string> + <string>https://github.com/secondlife/3p-dictionaries/releases/download/v1-a01bb6c/dictionaries-1.a01bb6c-common-a01bb6c.tar.zst</string> </map> <key>name</key> <string>common</string> @@ -401,7 +401,7 @@ <key>copyright</key> <string>Copyright 2014 Apache OpenOffice software</string> <key>version</key> - <string>None</string> + <string>1.a01bb6c</string> <key>name</key> <string>dictionaries</string> <key>description</key> @@ -572,11 +572,11 @@ <key>creds</key> <string>github</string> <key>hash</key> - <string>fb6797ff93b6e881b060d2a8b396d8d7477834ee</string> + <string>a2074b67de7ad4c04b5ca8f8f161506add9697b2</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/108908444</string> + <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/149207589</string> </map> <key>name</key> <string>darwin64</string> @@ -588,11 +588,11 @@ <key>creds</key> <string>github</string> <key>hash</key> - <string>a378bd1604aa97ca763140911f9f4e463ced85c0</string> + <string>8c1b701648c077220dbc576c3d9aefbef47f8324</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/108908446</string> + <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/149207592</string> </map> <key>name</key> <string>linux64</string> @@ -604,11 +604,11 @@ <key>creds</key> <string>github</string> <key>hash</key> - <string>72304491d86bd797b840999b255358f195b06609</string> + <string>7e0c3d50e8b99d8735c6c9596a72ded9ee2bc1c8</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/108908456</string> + <string>https://api.github.com/repos/secondlife/3p-fmodstudio/releases/assets/149207594</string> </map> <key>name</key> <string>windows64</string> @@ -621,7 +621,7 @@ <key>copyright</key> <string>FMOD Studio by Firelight Technologies Pty Ltd.</string> <key>version</key> - <string>2.02.13.578928</string> + <string>2.02.20.c78ef55</string> <key>name</key> <string>fmodstudio</string> <key>description</key> @@ -772,11 +772,11 @@ <key>archive</key> <map> <key>hash</key> - <string>6604c1cca515d287e697997a8d5593d1cae172a9</string> + <string>066625e7aa7f697a4b6cd461aad960c57181011f</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev2.g3253ed7-3253ed7/glh_linear-common-None.tar.zst</string> + <string>https://github.com/secondlife/3p-glh_linear/releases/download/v1.0.1-dev4-984c397/glh_linear-1.0.1-dev4-common-984c397.tar.zst</string> </map> <key>name</key> <string>common</string> @@ -789,7 +789,7 @@ <key>copyright</key> <string>Copyright (c) 2000 Cass Everitt</string> <key>version</key> - <string>None</string> + <string>1.0.1-dev4</string> <key>name</key> <string>glh_linear</string> <key>description</key> @@ -908,11 +908,11 @@ <key>creds</key> <string>github</string> <key>hash</key> - <string>a193ff65d6db48626d65d96c6124c6efca85e8ec</string> + <string>ae2c2a215b1bc2e3f37a67e301926dc405902d1a</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/108912596</string> + <string>https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/136778143</string> </map> <key>name</key> <string>darwin64</string> @@ -936,11 +936,11 @@ <key>creds</key> <string>github</string> <key>hash</key> - <string>ebfb82b6143874e7938b9d1e8a70d0a2e28aa818</string> + <string>0393dd75c58f7046bed47e62a8884a78cb02a5c3</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/108912599</string> + <string>https://api.github.com/repos/secondlife/3p-havok-source/releases/assets/136778145</string> </map> <key>name</key> <string>windows64</string> @@ -1146,11 +1146,11 @@ <key>creds</key> <string>github</string> <key>hash</key> - <string>bcc7e2c34896fc9cbc41828dee8a4ddf54f10453</string> + <string>ad72fa1d103df777906f0d98f3e882b9916aeada</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/108298968</string> + <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774118</string> </map> <key>name</key> <string>darwin64</string> @@ -1162,11 +1162,11 @@ <key>creds</key> <string>github</string> <key>hash</key> - <string>9de772df2ed12e9c742df6c90670c7cbbb9c93a6</string> + <string>e46e4ac93a237b5c4a14183766f76ba5d58935a2</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/108298969</string> + <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774125</string> </map> <key>name</key> <string>linux64</string> @@ -1178,15 +1178,31 @@ <key>creds</key> <string>github</string> <key>hash</key> - <string>92533ff0f8c1881ad85e75800f9072c413ccf7b7</string> + <string>bb37557f78c72b26580a521f8b8dabfa1b34e6e6</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/108298970</string> + <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774126</string> </map> <key>name</key> <string>windows64</string> </map> + <key>linux</key> + <map> + <key>archive</key> + <map> + <key>creds</key> + <string>github</string> + <key>hash</key> + <string>711b82f9f588d3a125af7dcd8c81f93d9c343a7d</string> + <key>hash_algorithm</key> + <string>sha1</string> + <key>url</key> + <string>https://api.github.com/repos/secondlife/3p-kdu/releases/assets/136774121</string> + </map> + <key>name</key> + <string>linux</string> + </map> </map> <key>license</key> <string>Kakadu</string> @@ -1195,7 +1211,7 @@ <key>copyright</key> <string>Kakadu software</string> <key>version</key> - <string>7.10.4.539108</string> + <string>7.10.4.4b9ec5f</string> <key>name</key> <string>kdu</string> <key>description</key> @@ -1487,6 +1503,15 @@ </map> <key>llca</key> <map> + <key>copyright</key> + <string>Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project. + </string> + <key>license</key> + <string>mit</string> + <key>license_file</key> + <string>LICENSES/ca-license.txt</string> + <key>name</key> + <string>llca</string> <key>platforms</key> <map> <key>common</key> @@ -1494,27 +1519,18 @@ <key>archive</key> <map> <key>hash</key> - <string>3a3e14563cd5fc019c3f139b82aa46ec79847709</string> + <string>a9503e1b4e1d9790cf29d18a3d9ab39e6a515679</string> <key>hash_algorithm</key> <string>sha1</string> <key>url</key> - <string>https://github.com/secondlife/llca/releases/download/v202312051403.17-0f5d9c3/llca-202312051404.0-common-0f5d9c3.tar.zst</string> + <string>https://github.com/secondlife/llca/releases/download/v202402012004.0-0f5d9c3/llca-202402012004.0-common-0f5d9c3.tar.zst</string> </map> <key>name</key> <string>common</string> </map> </map> - <key>license</key> - <string>mit</string> - <key>license_file</key> - <string>LICENSES/ca-license.txt</string> - <key>copyright</key> - <string>Copyright (c) 2016, Linden Research, Inc.; data provided by the Mozilla NSS Project. - </string> <key>version</key> - <string>202312051404.0</string> - <key>name</key> - <string>llca</string> + <string>202402012004.0</string> </map> <key>llphysicsextensions_source</key> <map> diff --git a/doc/contributions.txt b/doc/contributions.txt index f45b9027a9..ffee07c383 100755 --- a/doc/contributions.txt +++ b/doc/contributions.txt @@ -64,6 +64,8 @@ Aimee Trescothick VWR-14711 VWR-14712 VWR-15454 +AiraYumi + SL-20781 (github PR #613) Alejandro Rosenthal VWR-1184 Aleric Inglewood @@ -849,6 +851,7 @@ Kadah Coba Jondan Lundquist Joosten Briebers MAINT-7074 + BUG-225288 Josef Munster Josette Windlow Juilan Tripsa diff --git a/indra/llappearance/llavatarappearance.cpp b/indra/llappearance/llavatarappearance.cpp index 8e39f47829..741d2fd443 100644 --- a/indra/llappearance/llavatarappearance.cpp +++ b/indra/llappearance/llavatarappearance.cpp @@ -24,12 +24,6 @@ * $/LicenseInfo$ */ -#if LL_MSVC -// disable warning about boost::lexical_cast returning uninitialized data -// when it fails to parse the string -#pragma warning (disable:4701) -#endif - #include "linden_common.h" #include "llavatarappearance.h" @@ -46,14 +40,6 @@ #include "boost/bind.hpp" #include "boost/tokenizer.hpp" - -#if LL_MSVC -// disable boost::lexical_cast warning -#pragma warning (disable:4702) -#endif - -#include <boost/lexical_cast.hpp> - using namespace LLAvatarAppearanceDefines; //----------------------------------------------------------------------------- @@ -230,7 +216,7 @@ void LLAvatarAppearance::initInstance() for (U32 lod = 0; lod < mesh_dict->mLOD; lod++) { LLAvatarJointMesh* mesh = createAvatarJointMesh(); - std::string mesh_name = "m" + mesh_dict->mName + boost::lexical_cast<std::string>(lod); + std::string mesh_name = "m" + mesh_dict->mName + std::to_string(lod); // We pre-pended an m - need to capitalize first character for camelCase mesh_name[1] = toupper(mesh_name[1]); mesh->setName(mesh_name); diff --git a/indra/llaudio/llaudioengine.cpp b/indra/llaudio/llaudioengine.cpp index a387bb23cd..ece0a12a7a 100644 --- a/indra/llaudio/llaudioengine.cpp +++ b/indra/llaudio/llaudioengine.cpp @@ -398,7 +398,7 @@ void LLAudioEngine::idle() for (source_map::value_type& src_pair : mAllSources) { LLAudioSource *sourcep = src_pair.second; - if (sourcep->isMuted() && sourcep->isSyncMaster() && sourcep->getPriority() > max_sm_priority) + if (!sourcep->isMuted() && sourcep->isSyncMaster() && sourcep->getPriority() > max_sm_priority) { sync_masterp = sourcep; master_channelp = sync_masterp->getChannel(); diff --git a/indra/llcommon/lldoubledispatch.h b/indra/llcommon/lldoubledispatch.h index 8ed295b6f1..ce6731e864 100644 --- a/indra/llcommon/lldoubledispatch.h +++ b/indra/llcommon/lldoubledispatch.h @@ -255,7 +255,7 @@ private: }; /// shared_ptr manages Entry lifespan for us - typedef boost::shared_ptr<EntryBase> EntryPtr; + typedef std::shared_ptr<EntryBase> EntryPtr; /// use a @c list to make it easy to insert typedef std::list<EntryPtr> DispatchTable; DispatchTable mDispatch; diff --git a/indra/llcommon/llerror.cpp b/indra/llcommon/llerror.cpp index 3de641fcba..0f48ce16b2 100644 --- a/indra/llcommon/llerror.cpp +++ b/indra/llcommon/llerror.cpp @@ -1070,7 +1070,7 @@ namespace LLError // // NOTE!!! Requires external mutex lock!!! template <typename RECORDER> - std::pair<boost::shared_ptr<RECORDER>, Recorders::iterator> + std::pair<std::shared_ptr<RECORDER>, Recorders::iterator> findRecorderPos(SettingsConfigPtr &s) { // Since we promise to return an iterator, use a classic iterator @@ -1081,7 +1081,7 @@ namespace LLError // *it is a RecorderPtr, a shared_ptr<Recorder>. Use a // dynamic_pointer_cast to try to downcast to test if it's also a // shared_ptr<RECORDER>. - auto ptr = boost::dynamic_pointer_cast<RECORDER>(*it); + auto ptr = std::dynamic_pointer_cast<RECORDER>(*it); if (ptr) { // found the entry we want @@ -1101,7 +1101,7 @@ namespace LLError // shared_ptr might be empty (operator!() returns true) if there was no // such RECORDER subclass instance in mRecorders. template <typename RECORDER> - boost::shared_ptr<RECORDER> findRecorder() + std::shared_ptr<RECORDER> findRecorder() { SettingsConfigPtr s = Globals::getInstance()->getSettingsConfig(); LLMutexLock lock(&s->mRecorderMutex); @@ -1134,7 +1134,7 @@ namespace LLError if (!file_name.empty()) { - boost::shared_ptr<RecordToFile> recordToFile(new RecordToFile(file_name)); + std::shared_ptr<RecordToFile> recordToFile(new RecordToFile(file_name)); if (recordToFile->okay()) { addRecorder(recordToFile); diff --git a/indra/llcommon/llerrorcontrol.h b/indra/llcommon/llerrorcontrol.h index 57f10b7895..77b187a80f 100644 --- a/indra/llcommon/llerrorcontrol.h +++ b/indra/llcommon/llerrorcontrol.h @@ -174,7 +174,7 @@ namespace LLError bool mWantsMultiline; }; - typedef boost::shared_ptr<Recorder> RecorderPtr; + typedef std::shared_ptr<Recorder> RecorderPtr; /** * Instantiate GenericRecorder with a callable(level, message) to get diff --git a/indra/llcommon/llevents.cpp b/indra/llcommon/llevents.cpp index 1a305ec3dc..70931f3a65 100644 --- a/indra/llcommon/llevents.cpp +++ b/indra/llcommon/llevents.cpp @@ -211,12 +211,21 @@ void LLEventPumps::clear() } } -void LLEventPumps::reset() +void LLEventPumps::reset(bool log_pumps) { // Reset every known LLEventPump instance. Leave it up to each instance to // decide what to do with the reset() call. + if (log_pumps) + { + LL_INFOS() << "Resetting " << (S32)mPumpMap.size() << " pumps" << LL_ENDL; + } + for (PumpMap::value_type& pair : mPumpMap) { + if (log_pumps) + { + LL_INFOS() << "Resetting pump " << pair.first << LL_ENDL; + } pair.second->reset(); } } @@ -373,9 +382,11 @@ std::string LLEventPump::inventName(const std::string& pfx) void LLEventPump::clear() { + LLMutexLock lock(&mConnectionListMutex); // Destroy the original LLStandardSignal instance, replacing it with a // whole new one. mSignal = std::make_shared<LLStandardSignal>(); + mConnections.clear(); } @@ -383,6 +394,7 @@ void LLEventPump::reset() { // Resetting mSignal is supposed to disconnect everything on its own // But due to crash on 'reset' added explicit cleanup to get more data + LLMutexLock lock(&mConnectionListMutex); ConnectionMap::const_iterator iter = mConnections.begin(); ConnectionMap::const_iterator end = mConnections.end(); while (iter!=end) @@ -407,6 +419,8 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL return LLBoundListener(); } + LLMutexLock lock(&mConnectionListMutex); + float nodePosition = 1.0; // if the supplied name is empty we are not interested in the ordering mechanism @@ -566,8 +580,9 @@ LLBoundListener LLEventPump::listen_impl(const std::string& name, const LLEventL return bound; } -LLBoundListener LLEventPump::getListener(const std::string& name) const +LLBoundListener LLEventPump::getListener(const std::string& name) { + LLMutexLock lock(&mConnectionListMutex); ConnectionMap::const_iterator found = mConnections.find(name); if (found != mConnections.end()) { @@ -579,6 +594,7 @@ LLBoundListener LLEventPump::getListener(const std::string& name) const void LLEventPump::stopListening(const std::string& name) { + LLMutexLock lock(&mConnectionListMutex); ConnectionMap::iterator found = mConnections.find(name); if (found != mConnections.end()) { diff --git a/indra/llcommon/llevents.h b/indra/llcommon/llevents.h index c1dbf4392f..bebcfacdcb 100644 --- a/indra/llcommon/llevents.h +++ b/indra/llcommon/llevents.h @@ -332,7 +332,7 @@ public: * Reset all known LLEventPump instances * workaround for DEV-35406 crash on shutdown */ - void reset(); + void reset(bool log_pumps = false); private: friend class LLEventPump; @@ -558,7 +558,7 @@ public: /// Get the LLBoundListener associated with the passed name (dummy /// LLBoundListener if not found) - virtual LLBoundListener getListener(const std::string& name) const; + virtual LLBoundListener getListener(const std::string& name); /** * Instantiate one of these to block an existing connection: * @code @@ -601,6 +601,7 @@ private: LLHandle<LLEventPumps> mRegistry; std::string mName; + LLMutex mConnectionListMutex; protected: virtual LLBoundListener listen_impl(const std::string& name, const LLEventListener&, diff --git a/indra/llcommon/llinitparam.h b/indra/llcommon/llinitparam.h index 9edc7e40f3..e0d0ab9ac7 100644 --- a/indra/llcommon/llinitparam.h +++ b/indra/llcommon/llinitparam.h @@ -627,7 +627,7 @@ namespace LLInitParam UserData* mUserData; }; - typedef boost::shared_ptr<ParamDescriptor> ParamDescriptorPtr; + typedef std::shared_ptr<ParamDescriptor> ParamDescriptorPtr; // each derived Block class keeps a static data structure maintaining offsets to various params class LL_COMMON_API BlockDescriptor diff --git a/indra/llcommon/llleap.cpp b/indra/llcommon/llleap.cpp index 8f88e728ce..b2b1162f63 100644 --- a/indra/llcommon/llleap.cpp +++ b/indra/llcommon/llleap.cpp @@ -462,10 +462,10 @@ private: LLProcessPtr mChild; LLTempBoundListener mStdinConnection, mStdoutConnection, mStdoutDataConnection, mStderrConnection; - boost::scoped_ptr<LLEventPump::Blocker> mBlocker; + std::unique_ptr<LLEventPump::Blocker> mBlocker; LLProcess::ReadPipe::size_type mExpect; LLError::RecorderPtr mRecorder; - boost::scoped_ptr<LLLeapListener> mListener; + std::unique_ptr<LLLeapListener> mListener; }; // These must follow the declaration of LLLeapImpl, so they may as well be last. diff --git a/indra/llcommon/llmemory.cpp b/indra/llcommon/llmemory.cpp index 7cdf7254ff..574b9b8b3b 100644 --- a/indra/llcommon/llmemory.cpp +++ b/indra/llcommon/llmemory.cpp @@ -38,6 +38,7 @@ #include <mach/mach_host.h> #elif LL_LINUX # include <unistd.h> +# include <sys/resource.h> #endif #include "llmemory.h" @@ -273,33 +274,16 @@ U64 LLMemory::getCurrentRSS() U64 LLMemory::getCurrentRSS() { - static const char statPath[] = "/proc/self/stat"; - LLFILE *fp = LLFile::fopen(statPath, "r"); - U64 rss = 0; + struct rusage usage; - if (fp == NULL) - { - LL_WARNS() << "couldn't open " << statPath << LL_ENDL; + if (getrusage(RUSAGE_SELF, &usage) != 0) { + // Error handling code could be here return 0; } - // Eee-yew! See Documentation/filesystems/proc.txt in your - // nearest friendly kernel tree for details. - - { - int ret = fscanf(fp, "%*d (%*[^)]) %*c %*d %*d %*d %*d %*d %*d %*d " - "%*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %*d %Lu", - &rss); - if (ret != 1) - { - LL_WARNS() << "couldn't parse contents of " << statPath << LL_ENDL; - rss = 0; - } - } - - fclose(fp); - - return rss; + // ru_maxrss (since Linux 2.6.32) + // This is the maximum resident set size used (in kilobytes). + return usage.ru_maxrss * 1024; } #else diff --git a/indra/llcommon/llprocess.cpp b/indra/llcommon/llprocess.cpp index 0d65762284..0d6a147da3 100644 --- a/indra/llcommon/llprocess.cpp +++ b/indra/llcommon/llprocess.cpp @@ -36,7 +36,6 @@ #include "llevents.h" #include "llexception.h" -#include <boost/foreach.hpp> #include <boost/bind.hpp> #include <boost/asio/streambuf.hpp> #include <boost/asio/buffers_iterator.hpp> @@ -587,7 +586,7 @@ LLProcess::LLProcess(const LLSDOrParams& params): // apr_procattr_child_err_set()), or accepting a filename, opening it and // passing that apr_file_t (simple <, >, 2> redirect emulation). std::vector<apr_int32_t> select; - BOOST_FOREACH(const FileParam& fparam, params.files) + for (const FileParam& fparam : params.files) { // Every iteration, we're going to append an item to 'select'. At the // top of the loop, its size() is, in effect, an index. Use that to @@ -684,7 +683,7 @@ LLProcess::LLProcess(const LLSDOrParams& params): argv.push_back(params.executable().c_str()); // Add arguments. See above remarks about c_str(). - BOOST_FOREACH(const std::string& arg, params.args) + for (const std::string& arg : params.args) { argv.push_back(arg.c_str()); } @@ -961,7 +960,7 @@ void LLProcess::handle_status(int reason, int status) // only be performed if in fact we're going to produce the log message. LL_DEBUGS("LLProcess") << empty; std::string reason_str; - BOOST_FOREACH(const ReasonCode& rcp, reasons) + for (const ReasonCode& rcp : reasons) { if (reason == rcp.code) { @@ -1151,7 +1150,7 @@ std::ostream& operator<<(std::ostream& out, const LLProcess::Params& params) out << "cd " << LLStringUtil::quote(params.cwd) << ": "; } out << LLStringUtil::quote(params.executable); - BOOST_FOREACH(const std::string& arg, params.args) + for (const std::string& arg : params.args) { out << ' ' << LLStringUtil::quote(arg); } diff --git a/indra/llcommon/llprocess.h b/indra/llcommon/llprocess.h index 0842f2eb07..c57821bf52 100644 --- a/indra/llcommon/llprocess.h +++ b/indra/llcommon/llprocess.h @@ -51,7 +51,7 @@ class LLEventPump; class LLProcess; /// LLProcess instances are created on the heap by static factory methods and /// managed by ref-counted pointers. -typedef boost::shared_ptr<LLProcess> LLProcessPtr; +typedef std::shared_ptr<LLProcess> LLProcessPtr; /** * LLProcess handles launching an external process with specified command line diff --git a/indra/llcommon/llrun.h b/indra/llcommon/llrun.h index d610f86234..42e3d9b47a 100644 --- a/indra/llcommon/llrun.h +++ b/indra/llcommon/llrun.h @@ -48,7 +48,7 @@ public: /** * @brief The pointer to a runnable. */ - typedef boost::shared_ptr<LLRunnable> run_ptr_t; + typedef std::shared_ptr<LLRunnable> run_ptr_t; /** * @brief The handle for use in the API. diff --git a/indra/llcommon/llsdutil.h b/indra/llcommon/llsdutil.h index ad54d1b0be..fdcc052bd0 100644 --- a/indra/llcommon/llsdutil.h +++ b/indra/llcommon/llsdutil.h @@ -478,9 +478,9 @@ namespace llsd { /***************************************************************************** -* BOOST_FOREACH() helpers for LLSD +* range-based for-loop helpers for LLSD *****************************************************************************/ -/// Usage: BOOST_FOREACH(LLSD item, inArray(someLLSDarray)) { ... } +/// Usage: for (LLSD item : inArray(someLLSDarray)) { ... } class inArray { public: @@ -503,7 +503,7 @@ private: /// MapEntry is what you get from dereferencing an LLSD::map_[const_]iterator. typedef std::map<LLSD::String, LLSD>::value_type MapEntry; -/// Usage: BOOST_FOREACH([const] MapEntry& e, inMap(someLLSDmap)) { ... } +/// Usage: for([const] MapEntry& e : inMap(someLLSDmap)) { ... } class inMap { public: diff --git a/indra/llcommon/llsingleton.cpp b/indra/llcommon/llsingleton.cpp index 6b1986d0e9..5f1a89670e 100644 --- a/indra/llcommon/llsingleton.cpp +++ b/indra/llcommon/llsingleton.cpp @@ -32,7 +32,6 @@ #include "lldependencies.h" #include "llexception.h" #include "llcoros.h" -#include <boost/foreach.hpp> #include <algorithm> #include <iostream> // std::cerr in dire emergency #include <sstream> @@ -411,7 +410,7 @@ void LLSingletonBase::cleanup_() void LLSingletonBase::deleteAll() { // It's essential to traverse these in dependency order. - BOOST_FOREACH(LLSingletonBase* sp, dep_sort()) + for (LLSingletonBase* sp : dep_sort()) { // Capture the class name first: in case of exception, don't count on // being able to extract it later. diff --git a/indra/llcommon/llstring.h b/indra/llcommon/llstring.h index a8d910298c..5e622dc6c1 100644 --- a/indra/llcommon/llstring.h +++ b/indra/llcommon/llstring.h @@ -1215,7 +1215,7 @@ void LLStringUtilBase<T>::getTokens(const string_type& string, std::vector<strin { // This overload must deal with escapes. Delegate that to InEscString // (unless there ARE no escapes). - boost::scoped_ptr< LLStringUtilBaseImpl::InString<T> > instrp; + std::unique_ptr< LLStringUtilBaseImpl::InString<T> > instrp; if (escapes.empty()) instrp.reset(new LLStringUtilBaseImpl::InString<T>(string.begin(), string.end())); else diff --git a/indra/llcommon/llsys.cpp b/indra/llcommon/llsys.cpp index b72fde9264..02cae908fa 100644 --- a/indra/llcommon/llsys.cpp +++ b/indra/llcommon/llsys.cpp @@ -49,7 +49,6 @@ #include "llsdutil.h" #include <boost/bind.hpp> #include <boost/circular_buffer.hpp> -#include <boost/foreach.hpp> #include <boost/lexical_cast.hpp> #include <boost/range.hpp> #include <boost/utility/enable_if.hpp> @@ -905,9 +904,9 @@ void LLMemoryInfo::stream(std::ostream& s) const // Max key length size_t key_width(0); - BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap)) + for (const auto& [key, value] : inMap(mStatsMap)) { - size_t len(pair.first.length()); + size_t len(key.length()); if (len > key_width) { key_width = len; @@ -915,10 +914,9 @@ void LLMemoryInfo::stream(std::ostream& s) const } // Now stream stats - BOOST_FOREACH(const MapEntry& pair, inMap(mStatsMap)) + for (const auto& [key, value] : inMap(mStatsMap)) { - s << pfx << std::setw(narrow<size_t>(key_width+1)) << (pair.first + ':') << ' '; - LLSD value(pair.second); + s << pfx << std::setw(narrow<size_t>(key_width+1)) << (key + ':') << ' '; if (value.isInteger()) s << std::setw(12) << value.asInteger(); else if (value.isReal()) diff --git a/indra/llcommon/tests/llerror_test.cpp b/indra/llcommon/tests/llerror_test.cpp index 148c18aabe..b4cdbdc6bf 100644 --- a/indra/llcommon/tests/llerror_test.cpp +++ b/indra/llcommon/tests/llerror_test.cpp @@ -153,27 +153,27 @@ namespace tut int countMessages() { - return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages(); + return std::dynamic_pointer_cast<TestRecorder>(mRecorder)->countMessages(); } void clearMessages() { - boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages(); + std::dynamic_pointer_cast<TestRecorder>(mRecorder)->clearMessages(); } void setWantsTime(bool t) { - boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->showTime(t); + std::dynamic_pointer_cast<TestRecorder>(mRecorder)->showTime(t); } void setWantsMultiline(bool t) { - boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->showMultiline(t); + std::dynamic_pointer_cast<TestRecorder>(mRecorder)->showMultiline(t); } std::string message(int n) { - return boost::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n); + return std::dynamic_pointer_cast<TestRecorder>(mRecorder)->message(n); } void ensure_message_count(int expectedCount) @@ -497,12 +497,12 @@ namespace void testLogName(LLError::RecorderPtr recorder, LogFromFunction f, const std::string& class_name = "") { - boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages(); + std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->clearMessages(); std::string name = f(false); f(true); - std::string messageWithoutName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0); - std::string messageWithName = boost::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1); + std::string messageWithoutName = std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(0); + std::string messageWithName = std::dynamic_pointer_cast<tut::TestRecorder>(recorder)->message(1); ensure_has(name + " logged without name", messageWithoutName, name); @@ -691,13 +691,13 @@ namespace tut LL_INFOS() << "boo" << LL_ENDL; ensure_message_field_equals(0, MSG_FIELD, "boo"); - ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1); - ensure_contains("alt recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo"); + ensure_equals("alt recorder count", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 1); + ensure_contains("alt recorder message 0", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(0), "boo"); LLError::setTimeFunction(roswell); LLError::RecorderPtr anotherRecorder(new TestRecorder()); - boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->showTime(true); + std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->showTime(true); LLError::addRecorder(anotherRecorder); LL_INFOS() << "baz" << LL_ENDL; @@ -705,10 +705,10 @@ namespace tut std::string when = roswell(); ensure_message_does_not_contain(1, when); - ensure_equals("alt recorder count", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2); - ensure_does_not_contain("alt recorder message 1", boost::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when); - ensure_equals("another recorder count", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1); - ensure_contains("another recorder message 0", boost::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when); + ensure_equals("alt recorder count", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->countMessages(), 2); + ensure_does_not_contain("alt recorder message 1", std::dynamic_pointer_cast<TestRecorder>(altRecorder)->message(1), when); + ensure_equals("another recorder count", std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->countMessages(), 1); + ensure_contains("another recorder message 0", std::dynamic_pointer_cast<TestRecorder>(anotherRecorder)->message(0), when); LLError::removeRecorder(altRecorder); LLError::removeRecorder(anotherRecorder); diff --git a/indra/llcommon/tests/lleventcoro_test.cpp b/indra/llcommon/tests/lleventcoro_test.cpp index 032923a108..01104545c6 100644 --- a/indra/llcommon/tests/lleventcoro_test.cpp +++ b/indra/llcommon/tests/lleventcoro_test.cpp @@ -101,7 +101,7 @@ namespace tut int which; LLTestApp testApp; - void explicit_wait(boost::shared_ptr<LLCoros::Promise<std::string>>& cbp); + void explicit_wait(std::shared_ptr<LLCoros::Promise<std::string>>& cbp); void waitForEventOn1(); void coroPump(); void postAndWait1(); @@ -111,7 +111,7 @@ namespace tut typedef coroutine_group::object object; coroutine_group coroutinegrp("coroutine"); - void test_data::explicit_wait(boost::shared_ptr<LLCoros::Promise<std::string>>& cbp) + void test_data::explicit_wait(std::shared_ptr<LLCoros::Promise<std::string>>& cbp) { BEGIN { @@ -127,7 +127,7 @@ namespace tut // For test purposes, instead of handing 'callback' (or an // adapter) off to some I/O subsystem, we'll just pass it back to // our caller. - cbp = boost::make_shared<LLCoros::Promise<std::string>>(); + cbp = std::make_shared<LLCoros::Promise<std::string>>(); LLCoros::Future<std::string> future = LLCoros::getFuture(*cbp); // calling get() on the future causes us to suspend @@ -146,7 +146,7 @@ namespace tut DEBUG; // Construct the coroutine instance that will run explicit_wait. - boost::shared_ptr<LLCoros::Promise<std::string>> respond; + std::shared_ptr<LLCoros::Promise<std::string>> respond; LLCoros::instance().launch("test<1>", [this, &respond](){ explicit_wait(respond); }); mSync.bump(); diff --git a/indra/llcommon/tests/llinstancetracker_test.cpp b/indra/llcommon/tests/llinstancetracker_test.cpp index 5daa29adf4..95af9c2a50 100644 --- a/indra/llcommon/tests/llinstancetracker_test.cpp +++ b/indra/llcommon/tests/llinstancetracker_test.cpp @@ -94,7 +94,7 @@ namespace tut ensure("couldn't find stack Keyed", bool(found)); ensure_equals("found wrong Keyed instance", found.get(), &one); { - boost::scoped_ptr<Keyed> two(new Keyed("two")); + std::unique_ptr<Keyed> two(new Keyed("two")); ensure_equals(Keyed::instanceCount(), 2); auto found = Keyed::getInstance("two"); ensure("couldn't find heap Keyed", bool(found)); @@ -118,7 +118,7 @@ namespace tut std::weak_ptr<Unkeyed> found = one.getWeak(); ensure(! found.expired()); { - boost::scoped_ptr<Unkeyed> two(new Unkeyed); + std::unique_ptr<Unkeyed> two(new Unkeyed); ensure_equals(Unkeyed::instanceCount(), 2); } ensure_equals(Unkeyed::instanceCount(), 1); diff --git a/indra/llcommon/tests/llprocess_test.cpp b/indra/llcommon/tests/llprocess_test.cpp index b6b297b8d7..628f046f55 100644 --- a/indra/llcommon/tests/llprocess_test.cpp +++ b/indra/llcommon/tests/llprocess_test.cpp @@ -21,7 +21,6 @@ // external library headers #include "llapr.h" #include "apr_thread_proc.h" -#include <boost/foreach.hpp> #include <boost/function.hpp> #include <boost/algorithm/string/find_iterator.hpp> #include <boost/algorithm/string/finder.hpp> @@ -323,7 +322,7 @@ namespace tut { /*==========================================================================*| std::string reason_str; - BOOST_FOREACH(const ReasonCode& rcp, reasons) + for (const ReasonCode& rcp : reasons) { if (reason == rcp.code) { @@ -554,7 +553,7 @@ namespace tut catch (const failure&) { std::cout << "History:\n"; - BOOST_FOREACH(const Item& item, history) + for (const Item& item : history) { std::string what(item.what); if ((! what.empty()) && what[what.length() - 1] == '\n') diff --git a/indra/llcommon/tests/llstreamqueue_test.cpp b/indra/llcommon/tests/llstreamqueue_test.cpp index 050ad5c5bf..8af057328b 100644 --- a/indra/llcommon/tests/llstreamqueue_test.cpp +++ b/indra/llcommon/tests/llstreamqueue_test.cpp @@ -15,9 +15,6 @@ #include "llstreamqueue.h" // STL headers #include <vector> -// std headers -// external library headers -#include <boost/foreach.hpp> // other Linden headers #include "../test/lltut.h" #include "stringize.h" @@ -133,7 +130,7 @@ namespace tut std::streamsize leave(5); // len("craft") above std::streamsize skip(total - leave); std::streamsize written(0); - BOOST_FOREACH(const std::string& block, blocks) + for (const std::string& block : blocks) { written += strq.write(&block[0], block.length()); ensure_equals("size() after write()", strq.size(), written); @@ -152,7 +149,7 @@ namespace tut { set_test_name("concatenate blocks"); std::string blocks[] = { "abcd", "efghij", "klmnopqrs" }; - BOOST_FOREACH(const std::string& block, blocks) + for (const std::string& block : blocks) { strq.write(&block[0], block.length()); } @@ -170,7 +167,7 @@ namespace tut { set_test_name("split blocks"); std::string blocks[] = { "abcdefghijklm", "nopqrstuvwxyz" }; - BOOST_FOREACH(const std::string& block, blocks) + for (const std::string& block : blocks) { strq.write(&block[0], block.length()); } diff --git a/indra/llcommon/tests/lltreeiterators_test.cpp b/indra/llcommon/tests/lltreeiterators_test.cpp index 1d619867d4..b9c7a70c07 100644 --- a/indra/llcommon/tests/lltreeiterators_test.cpp +++ b/indra/llcommon/tests/lltreeiterators_test.cpp @@ -38,7 +38,6 @@ // external library headers #include <boost/bind.hpp> #include <boost/range/iterator_range.hpp> -#include <boost/foreach.hpp> // associated header #include "../lltreeiterators.h" @@ -402,7 +401,7 @@ private: * * Example: * @code - * BOOST_FOREACH(TreeNodePtr node, getRootRange<LLTreeIter::UP>(somenode)) + * for (TreeNodePtr node : getRootRange<LLTreeIter::UP>(somenode)) * { * std::cout << node->name() << '\n'; * } @@ -424,7 +423,7 @@ getRootRange(const TreeNodePtr& node) * * Example: * @code - * BOOST_FOREACH(TreeNodePtr node, getWalkRange<LLTreeIter::DFS_PRE>(root)) + * for (TreeNodePtr node : getWalkRange<LLTreeIter::DFS_PRE>(root)) * { * std::cout << node->name() << '\n'; * } @@ -520,7 +519,7 @@ public: * * Example usage: * @code - * BOOST_FOREACH(EnhancedTreeNodePtr node, somenode->getRootRange<LLTreeIter::UP>()) + * for (EnhancedTreeNodePtr node : somenode->getRootRange<LLTreeIter::UP>()) * { * std::cout << node->name() << '\n'; * } @@ -564,7 +563,7 @@ public: * * Example usage: * @code - * BOOST_FOREACH(EnhancedTreeNodePtr node, somenode->getWalkRange<LLTreeIter::DFS_PRE>()) + * for (EnhancedTreeNodePtr node : somenode->getWalkRange<LLTreeIter::DFS_PRE>()) * { * std::cout << node->name() << '\n'; * } @@ -644,7 +643,7 @@ LLLinkedIter<PlainTree> PlainTree_child_end(PlainTree* node) * * Example: * @code - * BOOST_FOREACH(PlainTree* node, getRootRange<LLTreeIter::UP>(somenode)) + * for (PlainTree* node : getRootRange<LLTreeIter::UP>(somenode)) * { * std::cout << node->name() << '\n'; * } @@ -668,7 +667,7 @@ getRootRange(PlainTree* node) * * Example: * @code - * BOOST_FOREACH(PlainTree* node, getWalkRange<LLTreeIter::DFS_PRE>(root)) + * for (PlainTree* node : getWalkRange<LLTreeIter::DFS_PRE>(root)) * { * std::cout << node->name() << '\n'; * } @@ -1103,18 +1102,18 @@ namespace tut // This test function illustrates the looping techniques described in the // comments for the getRootRange() free function, the // EnhancedTreeNode::root_range template and the - // EnhancedTreeNode::getRootRange() method. Obviously the BOOST_FOREACH() + // EnhancedTreeNode::getRootRange() method. Obviously the for() // forms are more succinct. TreeNodePtr tnroot(example_tree<TreeNode>()); TreeNodePtr tnB2b(get_B2b<TreeNode, TreeNode::child_iterator> (tnroot, boost::bind(&TreeNode::child_begin, _1))); - std::string desc1("BOOST_FOREACH(TreeNodePr, getRootRange<LLTreeIter::UP>(tnB2b))"); + std::string desc1("for (TreeNodePr : getRootRange<LLTreeIter::UP>(tnB2b))"); // std::cout << desc1 << "\n"; // Although we've commented out the output statement, ensure that the // loop construct is still valid, as promised by the getRootRange() // documentation. - BOOST_FOREACH(TreeNodePtr node, getRootRange<LLTreeIter::UP>(tnB2b)) + for (TreeNodePtr node : getRootRange<LLTreeIter::UP>(tnB2b)) { // std::cout << node->name() << '\n'; } @@ -1137,9 +1136,9 @@ namespace tut // std::cout << (*ri)->name() << '\n'; } - std::string desc2("BOOST_FOREACH(EnhancedTreeNodePtr node, etnB2b->getRootRange<LLTreeIter::UP>())"); + std::string desc2("for (EnhancedTreeNodePtr node : etnB2b->getRootRange<LLTreeIter::UP>())"); // std::cout << desc2 << '\n'; - BOOST_FOREACH(EnhancedTreeNodePtr node, etnB2b->getRootRange<LLTreeIter::UP>()) + for (EnhancedTreeNodePtr node : etnB2b->getRootRange<LLTreeIter::UP>()) { // std::cout << node->name() << '\n'; } diff --git a/indra/llcommon/tests/wrapllerrs.h b/indra/llcommon/tests/wrapllerrs.h index d657b329bb..6978c296b3 100644 --- a/indra/llcommon/tests/wrapllerrs.h +++ b/indra/llcommon/tests/wrapllerrs.h @@ -218,12 +218,12 @@ public: /// for the sought string. std::string messageWith(const std::string& search, bool required=true) { - return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required); + return std::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->messageWith(search, required); } std::ostream& streamto(std::ostream& out) const { - return boost::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out); + return std::dynamic_pointer_cast<CaptureLogRecorder>(mRecorder)->streamto(out); } friend inline std::ostream& operator<<(std::ostream& out, const CaptureLog& self) diff --git a/indra/llcorehttp/_httplibcurl.h b/indra/llcorehttp/_httplibcurl.h index a71eae59c0..61ecc492af 100644 --- a/indra/llcorehttp/_httplibcurl.h +++ b/indra/llcorehttp/_httplibcurl.h @@ -65,7 +65,7 @@ private: void operator=(const HttpLibcurl &); // Not defined public: - typedef boost::shared_ptr<HttpOpRequest> opReqPtr_t; + typedef std::shared_ptr<HttpOpRequest> opReqPtr_t; /// Give cycles to libcurl to run active requests. Completed /// operations (successful or failed) will be retried or handed diff --git a/indra/llcorehttp/_httpoperation.cpp b/indra/llcorehttp/_httpoperation.cpp index 3b64018132..c3a9bcaf54 100644 --- a/indra/llcorehttp/_httpoperation.cpp +++ b/indra/llcorehttp/_httpoperation.cpp @@ -58,7 +58,7 @@ HttpOperation::handleMap_t HttpOperation::mHandleMap; LLCoreInt::HttpMutex HttpOperation::mOpMutex; HttpOperation::HttpOperation(): - boost::enable_shared_from_this<HttpOperation>(), + std::enable_shared_from_this<HttpOperation>(), mReplyQueue(), mUserHandler(), mReqPolicy(HttpRequest::DEFAULT_POLICY_ID), diff --git a/indra/llcorehttp/_httpoperation.h b/indra/llcorehttp/_httpoperation.h index 8c1364bab4..b07ef76d49 100644 --- a/indra/llcorehttp/_httpoperation.h +++ b/indra/llcorehttp/_httpoperation.h @@ -69,12 +69,12 @@ class HttpService; /// and those interfaces establish the access rules. class HttpOperation : private boost::noncopyable, - public boost::enable_shared_from_this<HttpOperation> + public std::enable_shared_from_this<HttpOperation> { public: - typedef boost::shared_ptr<HttpOperation> ptr_t; - typedef boost::weak_ptr<HttpOperation> wptr_t; - typedef boost::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t; + typedef std::shared_ptr<HttpOperation> ptr_t; + typedef std::weak_ptr<HttpOperation> wptr_t; + typedef std::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t; /// Threading: called by consumer thread. HttpOperation(); @@ -157,12 +157,12 @@ public: HttpHandle getHandle(); template< class OPT > - static boost::shared_ptr< OPT > fromHandle(HttpHandle handle) + static std::shared_ptr< OPT > fromHandle(HttpHandle handle) { ptr_t ptr = findByHandle(handle); if (!ptr) - return boost::shared_ptr< OPT >(); - return boost::dynamic_pointer_cast< OPT >(ptr); + return std::shared_ptr< OPT >(); + return std::dynamic_pointer_cast< OPT >(ptr); } protected: diff --git a/indra/llcorehttp/_httpoprequest.cpp b/indra/llcorehttp/_httpoprequest.cpp index d60eb6c95f..3247146212 100644 --- a/indra/llcorehttp/_httpoprequest.cpp +++ b/indra/llcorehttp/_httpoprequest.cpp @@ -201,7 +201,7 @@ HttpOpRequest::~HttpOpRequest() void HttpOpRequest::stageFromRequest(HttpService * service) { LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; - HttpOpRequest::ptr_t self(boost::dynamic_pointer_cast<HttpOpRequest>(shared_from_this())); + HttpOpRequest::ptr_t self(std::dynamic_pointer_cast<HttpOpRequest>(shared_from_this())); service->getPolicy().addOp(self); // transfers refcount } @@ -209,7 +209,7 @@ void HttpOpRequest::stageFromRequest(HttpService * service) void HttpOpRequest::stageFromReady(HttpService * service) { LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; - HttpOpRequest::ptr_t self(boost::dynamic_pointer_cast<HttpOpRequest>(shared_from_this())); + HttpOpRequest::ptr_t self(std::dynamic_pointer_cast<HttpOpRequest>(shared_from_this())); service->getTransport().addOp(self); // transfers refcount } @@ -290,7 +290,7 @@ void HttpOpRequest::visitNotifier(HttpRequest * request) // HttpOpRequest::ptr_t HttpOpRequest::fromHandle(HttpHandle handle) // { // -// return boost::dynamic_pointer_cast<HttpOpRequest>((static_cast<HttpOpRequest *>(handle))->shared_from_this()); +// return std::dynamic_pointer_cast<HttpOpRequest>((static_cast<HttpOpRequest *>(handle))->shared_from_this()); // } diff --git a/indra/llcorehttp/_httpoprequest.h b/indra/llcorehttp/_httpoprequest.h index ec84822cf4..626064329d 100644 --- a/indra/llcorehttp/_httpoprequest.h +++ b/indra/llcorehttp/_httpoprequest.h @@ -66,7 +66,7 @@ class BufferArray; class HttpOpRequest : public HttpOperation { public: - typedef boost::shared_ptr<HttpOpRequest> ptr_t; + typedef std::shared_ptr<HttpOpRequest> ptr_t; HttpOpRequest(); diff --git a/indra/llcorehttp/_httpopsetget.h b/indra/llcorehttp/_httpopsetget.h index eabd41e79f..04ab2446ef 100644 --- a/indra/llcorehttp/_httpopsetget.h +++ b/indra/llcorehttp/_httpopsetget.h @@ -53,7 +53,7 @@ namespace LLCore class HttpOpSetGet : public HttpOperation { public: - typedef boost::shared_ptr<HttpOpSetGet> ptr_t; + typedef std::shared_ptr<HttpOpSetGet> ptr_t; HttpOpSetGet(); diff --git a/indra/llcorehttp/_httppolicy.h b/indra/llcorehttp/_httppolicy.h index 0b8806a3e2..955f757c93 100644 --- a/indra/llcorehttp/_httppolicy.h +++ b/indra/llcorehttp/_httppolicy.h @@ -60,7 +60,7 @@ private: void operator=(const HttpPolicy &); // Not defined public: - typedef boost::shared_ptr<HttpOpRequest> opReqPtr_t; + typedef std::shared_ptr<HttpOpRequest> opReqPtr_t; /// Threading: called by init thread. HttpRequest::policy_t createPolicyClass(); diff --git a/indra/llcorehttp/_httpreplyqueue.h b/indra/llcorehttp/_httpreplyqueue.h index 33e205c1c9..2de26249ef 100644 --- a/indra/llcorehttp/_httpreplyqueue.h +++ b/indra/llcorehttp/_httpreplyqueue.h @@ -63,8 +63,8 @@ class HttpReplyQueue : private boost::noncopyable { public: - typedef boost::shared_ptr<HttpOperation> opPtr_t; - typedef boost::shared_ptr<HttpReplyQueue> ptr_t; + typedef std::shared_ptr<HttpOperation> opPtr_t; + typedef std::shared_ptr<HttpReplyQueue> ptr_t; HttpReplyQueue(); virtual ~HttpReplyQueue(); diff --git a/indra/llcorehttp/_httprequestqueue.h b/indra/llcorehttp/_httprequestqueue.h index f0296f30e3..52369df174 100644 --- a/indra/llcorehttp/_httprequestqueue.h +++ b/indra/llcorehttp/_httprequestqueue.h @@ -61,7 +61,7 @@ private: void operator=(const HttpRequestQueue &); // Not defined public: - typedef boost::shared_ptr<HttpOperation> opPtr_t; + typedef std::shared_ptr<HttpOperation> opPtr_t; static void init(); static void term(); diff --git a/indra/llcorehttp/httpcommon.h b/indra/llcorehttp/httpcommon.h index 18505e0aad..7fe5c48edf 100644 --- a/indra/llcorehttp/httpcommon.h +++ b/indra/llcorehttp/httpcommon.h @@ -301,24 +301,24 @@ struct HttpStatus HttpStatus() { - mDetails = boost::shared_ptr<Details>(new Details(LLCORE, HE_SUCCESS)); + mDetails = std::shared_ptr<Details>(new Details(LLCORE, HE_SUCCESS)); } HttpStatus(type_enum_t type, short status) { - mDetails = boost::shared_ptr<Details>(new Details(type, status)); + mDetails = std::shared_ptr<Details>(new Details(type, status)); } HttpStatus(int http_status) { - mDetails = boost::shared_ptr<Details>(new Details(http_status, + mDetails = std::shared_ptr<Details>(new Details(http_status, (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR)); llassert(http_status >= 100 && http_status <= 999); } HttpStatus(int http_status, const std::string &message) { - mDetails = boost::shared_ptr<Details>(new Details(http_status, + mDetails = std::shared_ptr<Details>(new Details(http_status, (http_status >= 200 && http_status <= 299) ? HE_SUCCESS : HE_REPLY_ERROR)); llassert(http_status >= 100 && http_status <= 999); mDetails->mMessage = message; @@ -341,7 +341,7 @@ struct HttpStatus HttpStatus & clone(const HttpStatus &rhs) { - mDetails = boost::shared_ptr<Details>(new Details(*rhs.mDetails)); + mDetails = std::shared_ptr<Details>(new Details(*rhs.mDetails)); return *this; } @@ -490,14 +490,14 @@ private: LLSD mErrorData; }; - boost::shared_ptr<Details> mDetails; + std::shared_ptr<Details> mDetails; }; // end struct HttpStatus /// A namespace for several free methods and low level utilities. namespace LLHttp { - typedef boost::shared_ptr<CURL> CURL_ptr; + typedef std::shared_ptr<CURL> CURL_ptr; void initialize(); void cleanup(); diff --git a/indra/llcorehttp/httphandler.h b/indra/llcorehttp/httphandler.h index 65e043f5d3..4cfb2598c7 100644 --- a/indra/llcorehttp/httphandler.h +++ b/indra/llcorehttp/httphandler.h @@ -58,8 +58,8 @@ class HttpResponse; class HttpHandler { public: - typedef boost::shared_ptr<HttpHandler> ptr_t; - typedef boost::weak_ptr<HttpHandler> wptr_t; + typedef std::shared_ptr<HttpHandler> ptr_t; + typedef std::weak_ptr<HttpHandler> wptr_t; virtual ~HttpHandler() { } diff --git a/indra/llcorehttp/httpheaders.h b/indra/llcorehttp/httpheaders.h index b9168cb6ec..e7cf4037bf 100644 --- a/indra/llcorehttp/httpheaders.h +++ b/indra/llcorehttp/httpheaders.h @@ -85,7 +85,7 @@ public: typedef container_t::const_reverse_iterator const_reverse_iterator; typedef container_t::value_type value_type; typedef container_t::size_type size_type; - typedef boost::shared_ptr<HttpHeaders> ptr_t; + typedef std::shared_ptr<HttpHeaders> ptr_t; public: /// @post In addition to the instance, caller has a refcount diff --git a/indra/llcorehttp/httpoptions.h b/indra/llcorehttp/httpoptions.h index 41f71896b0..fa993c857b 100644 --- a/indra/llcorehttp/httpoptions.h +++ b/indra/llcorehttp/httpoptions.h @@ -60,7 +60,7 @@ class HttpOptions : private boost::noncopyable public: HttpOptions(); - typedef boost::shared_ptr<HttpOptions> ptr_t; + typedef std::shared_ptr<HttpOptions> ptr_t; virtual ~HttpOptions(); // Use release() diff --git a/indra/llcorehttp/httprequest.h b/indra/llcorehttp/httprequest.h index ca4b9e92bc..857a034a7b 100644 --- a/indra/llcorehttp/httprequest.h +++ b/indra/llcorehttp/httprequest.h @@ -96,8 +96,8 @@ private: public: typedef unsigned int policy_t; - typedef boost::shared_ptr<HttpRequest> ptr_t; - typedef boost::weak_ptr<HttpRequest> wptr_t; + typedef std::shared_ptr<HttpRequest> ptr_t; + typedef std::weak_ptr<HttpRequest> wptr_t; public: /// @name PolicyMethods /// @{ @@ -627,7 +627,7 @@ public: protected: private: - typedef boost::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t; + typedef std::shared_ptr<HttpReplyQueue> HttpReplyQueuePtr_t; /// @name InstanceData /// diff --git a/indra/llcorehttp/httpresponse.h b/indra/llcorehttp/httpresponse.h index b834085e5c..ef98fbef2b 100644 --- a/indra/llcorehttp/httpresponse.h +++ b/indra/llcorehttp/httpresponse.h @@ -72,7 +72,7 @@ public: /// Statistics for the HTTP struct TransferStats { - typedef boost::shared_ptr<TransferStats> ptr_t; + typedef std::shared_ptr<TransferStats> ptr_t; TransferStats() : mSizeDownload(0.0), mTotalTime(0.0), mSpeedDownload(0.0) {} F64 mSizeDownload; diff --git a/indra/llfilesystem/lldir.cpp b/indra/llfilesystem/lldir.cpp index 69b23f9cf8..41fbb97175 100644 --- a/indra/llfilesystem/lldir.cpp +++ b/indra/llfilesystem/lldir.cpp @@ -44,7 +44,6 @@ #include "stringize.h" #include "llstring.h" #include <boost/filesystem.hpp> -#include <boost/foreach.hpp> #include <boost/range/begin.hpp> #include <boost/range/end.hpp> #include <boost/assign/list_of.hpp> @@ -691,10 +690,10 @@ void LLDir::walkSearchSkinDirs(const std::string& subdir, const std::string& filename, const FUNCTION& function) const { - BOOST_FOREACH(std::string skindir, mSearchSkinDirs) + for (const std::string& skindir : mSearchSkinDirs) { std::string subdir_path(add(skindir, subdir)); - BOOST_FOREACH(std::string subsubdir, subsubdirs) + for (const std::string& subsubdir : subsubdirs) { std::string full_path(add(subdir_path, subsubdir, filename)); if (fileExists(full_path)) @@ -843,7 +842,7 @@ std::vector<std::string> LLDir::findSkinnedFilenames(const std::string& subdir, // current language, copy them -- in proper order -- into results. // Don't drive this by walking the map itself: it matters that we // generate results in the same order as subsubdirs. - BOOST_FOREACH(std::string subsubdir, subsubdirs) + for (const std::string& subsubdir : subsubdirs) { StringMap::const_iterator found(path_for.find(subsubdir)); if (found != path_for.end()) @@ -855,7 +854,7 @@ std::vector<std::string> LLDir::findSkinnedFilenames(const std::string& subdir, LL_DEBUGS("LLDir") << empty; const char* comma = ""; - BOOST_FOREACH(std::string path, results) + for (const std::string& path : results) { LL_CONT << comma << "'" << path << "'"; comma = ", "; diff --git a/indra/llfilesystem/tests/lldir_test.cpp b/indra/llfilesystem/tests/lldir_test.cpp index 3cff622a4b..60265cade6 100644 --- a/indra/llfilesystem/tests/lldir_test.cpp +++ b/indra/llfilesystem/tests/lldir_test.cpp @@ -34,7 +34,6 @@ #include "../test/lltut.h" #include "stringize.h" -#include <boost/foreach.hpp> #include <boost/assign/list_of.hpp> using boost::assign::list_of; @@ -109,7 +108,7 @@ struct LLDir_Dummy: public LLDir "install/skins/default/future/somefile.txt" }; - BOOST_FOREACH(const char* path, preload) + for (const char* path : preload) { buildFilesystem(path); } @@ -166,7 +165,7 @@ struct LLDir_Dummy: public LLDir LLStringUtil::getTokens(path, components, "/"); // Ensure we have an entry representing every level of this path std::string partial; - BOOST_FOREACH(std::string component, components) + for (std::string component : components) { append(partial, component); mFilesystem.insert(partial); diff --git a/indra/llimage/llimage.cpp b/indra/llimage/llimage.cpp index 9c0cc8d760..6f41164ab4 100644 --- a/indra/llimage/llimage.cpp +++ b/indra/llimage/llimage.cpp @@ -2254,9 +2254,9 @@ bool LLImageFormatted::save(const std::string &filename) return false; } - outfile.write(getData(), getDataSize()); + S32 result = outfile.write(getData(), getDataSize()); outfile.close() ; - return true; + return (result != 0); } S8 LLImageFormatted::getCodec() const diff --git a/indra/llimage/llimagej2c.cpp b/indra/llimage/llimagej2c.cpp index 8dba1641a6..68598589b8 100644 --- a/indra/llimage/llimagej2c.cpp +++ b/indra/llimage/llimagej2c.cpp @@ -48,7 +48,7 @@ std::string LLImageJ2C::getEngineInfo() { // All known LLImageJ2CImpl implementation subclasses are cheap to // construct. - boost::scoped_ptr<LLImageJ2CImpl> impl(fallbackCreateLLImageJ2CImpl()); + std::unique_ptr<LLImageJ2CImpl> impl(fallbackCreateLLImageJ2CImpl()); return impl->getEngineInfo(); } diff --git a/indra/llimage/llimagej2c.h b/indra/llimage/llimagej2c.h index e196f7479e..b30df6f776 100644 --- a/indra/llimage/llimagej2c.h +++ b/indra/llimage/llimagej2c.h @@ -95,7 +95,7 @@ protected: S8 mRawDiscardLevel; F32 mRate; bool mReversible; - boost::scoped_ptr<LLImageJ2CImpl> mImpl; + std::unique_ptr<LLImageJ2CImpl> mImpl; std::string mLastError; // Image compression/decompression tester diff --git a/indra/llinventory/llinventory.cpp b/indra/llinventory/llinventory.cpp index 55bcc7c5b2..6334a35fd0 100644 --- a/indra/llinventory/llinventory.cpp +++ b/indra/llinventory/llinventory.cpp @@ -32,6 +32,7 @@ #include "llinventorydefines.h" #include "llxorcipher.h" #include "llsd.h" +#include "llsdserialize.h" #include "message.h" #include <boost/tokenizer.hpp> @@ -217,7 +218,19 @@ BOOL LLInventoryObject::importLegacyStream(std::istream& input_stream) } else if (0 == strcmp("metadata", keyword)) { - LLSD metadata(valuestr); + LLSD metadata; + if (strncmp("<llsd>", valuestr, 6) == 0) + { + std::istringstream stream(valuestr); + LLSDSerialize::fromXML(metadata, stream); + } + else + { + // next line likely contains metadata, but at the moment is not supported + // can do something like: + // LLSDSerialize::fromNotation(metadata, input_stream, -1); + } + if (metadata.has("thumbnail")) { const LLSD& thumbnail = metadata["thumbnail"]; @@ -693,7 +706,19 @@ BOOL LLInventoryItem::importLegacyStream(std::istream& input_stream) } else if (0 == strcmp("metadata", keyword)) { - LLSD metadata(valuestr); + LLSD metadata; + if (strncmp("<llsd>", valuestr, 6) == 0) + { + std::istringstream stream(valuestr); + LLSDSerialize::fromXML(metadata, stream); + } + else + { + // next line likely contains metadata, but at the moment is not supported + // can do something like: + // LLSDSerialize::fromNotation(metadata, input_stream, -1); + } + if (metadata.has("thumbnail")) { const LLSD& thumbnail = metadata["thumbnail"]; @@ -802,9 +827,14 @@ BOOL LLInventoryItem::exportLegacyStream(std::ostream& output_stream, BOOL inclu if (mThumbnailUUID.notNull()) { + // Max length is 255 chars, will have to export differently if it gets more data + // Ex: use newline and toNotation (uses {}) for unlimited size LLSD metadata; metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID); - output_stream << "\t\tmetadata\t" << metadata << "|\n"; + + output_stream << "\t\tmetadata\t"; + LLSDSerialize::toXML(metadata, output_stream); + output_stream << "|\n"; } // Check for permissions to see the asset id, and if so write it @@ -1303,7 +1333,19 @@ BOOL LLInventoryCategory::importLegacyStream(std::istream& input_stream) } else if (0 == strcmp("metadata", keyword)) { - LLSD metadata(valuestr); + LLSD metadata; + if (strncmp("<llsd>", valuestr, 6) == 0) + { + std::istringstream stream(valuestr); + LLSDSerialize::fromXML(metadata, stream); + } + else + { + // next line likely contains metadata, but at the moment is not supported + // can do something like: + // LLSDSerialize::fromNotation(metadata, input_stream, -1); + } + if (metadata.has("thumbnail")) { const LLSD& thumbnail = metadata["thumbnail"]; @@ -1343,9 +1385,12 @@ BOOL LLInventoryCategory::exportLegacyStream(std::ostream& output_stream, BOOL) output_stream << "\t\tname\t" << mName.c_str() << "|\n"; if (mThumbnailUUID.notNull()) { + // Only up to 255 chars LLSD metadata; metadata["thumbnail"] = LLSD().with("asset_id", mThumbnailUUID); - output_stream << "\t\tmetadata\t" << metadata << "|\n"; + output_stream << "\t\tmetadata\t"; + LLSDSerialize::toXML(metadata, output_stream); + output_stream << "|\n"; } output_stream << "\t}\n"; return TRUE; diff --git a/indra/llkdu/llimagej2ckdu.h b/indra/llkdu/llimagej2ckdu.h index b57e4cc40e..fe3902380c 100644 --- a/indra/llkdu/llimagej2ckdu.h +++ b/indra/llkdu/llimagej2ckdu.h @@ -113,10 +113,10 @@ private: }; // Encode variable - boost::scoped_ptr<LLKDUMemSource> mInputp; + std::unique_ptr<LLKDUMemSource> mInputp; CodeStreamHolder mCodeStreamp; - boost::scoped_ptr<kdu_core::kdu_coords> mTPosp; // tile position - boost::scoped_ptr<kdu_core::kdu_dims> mTileIndicesp; + std::unique_ptr<kdu_core::kdu_coords> mTPosp; // tile position + std::unique_ptr<kdu_core::kdu_dims> mTileIndicesp; int mBlocksSize; int mPrecinctsSize; int mLevels; @@ -125,7 +125,7 @@ private: // We don't own this LLImageRaw. We're simply pointing to an instance // passed into initDecode(). LLImageRaw *mRawImagep; - boost::scoped_ptr<LLKDUDecodeState> mDecodeState; + std::unique_ptr<LLKDUDecodeState> mDecodeState; }; #endif diff --git a/indra/llmath/llvolume.h b/indra/llmath/llvolume.h index afed98ff36..71878b8cb6 100644 --- a/indra/llmath/llvolume.h +++ b/indra/llmath/llvolume.h @@ -1000,7 +1000,7 @@ class LLVolume : public LLRefCount friend class LLVolumeLODGroup; protected: - ~LLVolume(); // use unref + virtual ~LLVolume(); // use unref public: typedef std::vector<LLVolumeFace> face_list_t; diff --git a/indra/llmessage/llcoproceduremanager.cpp b/indra/llmessage/llcoproceduremanager.cpp index ebbaea9b12..c0a5e361b1 100644 --- a/indra/llmessage/llcoproceduremanager.cpp +++ b/indra/llmessage/llcoproceduremanager.cpp @@ -95,7 +95,7 @@ public: private: struct QueuedCoproc { - typedef boost::shared_ptr<QueuedCoproc> ptr_t; + typedef std::shared_ptr<QueuedCoproc> ptr_t; QueuedCoproc(const std::string &name, const LLUUID &id, CoProcedure_t proc) : mName(name), @@ -115,7 +115,7 @@ private: // Use shared_ptr to control the lifespan of our CoprocQueue_t instance // because the consuming coroutine might outlive this LLCoprocedurePool // instance. - typedef boost::shared_ptr<CoprocQueue_t> CoprocQueuePtr; + typedef std::shared_ptr<CoprocQueue_t> CoprocQueuePtr; std::string mPoolName; size_t mPoolSize, mActiveCoprocsCount, mPending; @@ -301,7 +301,7 @@ LLCoprocedurePool::LLCoprocedurePool(const std::string &poolName, size_t size): mPoolSize(size), mActiveCoprocsCount(0), mPending(0), - mPendingCoprocs(boost::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)), + mPendingCoprocs(std::make_shared<CoprocQueue_t>(LLCoprocedureManager::DEFAULT_QUEUE_SIZE)), mHTTPPolicy(LLCore::HttpRequest::DEFAULT_POLICY_ID), mCoroMapping() { @@ -384,7 +384,7 @@ LLUUID LLCoprocedurePool::enqueueCoprocedure(const std::string &name, LLCoproced LL_INFOS("CoProcMgr") << "Coprocedure(" << name << ") enqueuing with id=" << id.asString() << " in pool \"" << mPoolName << "\" at " << mPending << LL_ENDL; } - auto pushed = mPendingCoprocs->try_push(boost::make_shared<QueuedCoproc>(name, id, proc)); + auto pushed = mPendingCoprocs->try_push(std::make_shared<QueuedCoproc>(name, id, proc)); if (pushed == boost::fibers::channel_op_status::success) { ++mPending; diff --git a/indra/llmessage/llcorehttputil.h b/indra/llmessage/llcorehttputil.h index 6d0d68cf24..fc561c6b0f 100644 --- a/indra/llmessage/llcorehttputil.h +++ b/indra/llmessage/llcorehttputil.h @@ -263,8 +263,8 @@ class HttpCoroHandler : public LLCore::HttpHandler { public: - typedef boost::shared_ptr<HttpCoroHandler> ptr_t; - typedef boost::weak_ptr<HttpCoroHandler> wptr_t; + typedef std::shared_ptr<HttpCoroHandler> ptr_t; + typedef std::weak_ptr<HttpCoroHandler> wptr_t; HttpCoroHandler(LLEventStream &reply); @@ -317,8 +317,8 @@ public: static const std::string HTTP_RESULTS_CONTENT; static const std::string HTTP_RESULTS_RAW; - typedef boost::shared_ptr<HttpCoroutineAdapter> ptr_t; - typedef boost::weak_ptr<HttpCoroutineAdapter> wptr_t; + typedef std::shared_ptr<HttpCoroutineAdapter> ptr_t; + typedef std::weak_ptr<HttpCoroutineAdapter> wptr_t; HttpCoroutineAdapter(const std::string &name, LLCore::HttpRequest::policy_t policyId); ~HttpCoroutineAdapter(); diff --git a/indra/llmessage/lldatapacker.cpp b/indra/llmessage/lldatapacker.cpp index 9f7768f78e..b7013dbb6e 100644 --- a/indra/llmessage/lldatapacker.cpp +++ b/indra/llmessage/lldatapacker.cpp @@ -298,6 +298,13 @@ BOOL LLDataPackerBinaryBuffer::unpackBinaryData(U8 *value, S32 &size, const char } htolememcpy(&size, mCurBufferp, MVT_S32, 4); + + if (size < 0) + { + LL_WARNS() << "LLDataPackerBinaryBuffer::unpackBinaryData unpacked invalid size, aborting!" << LL_ENDL; + return FALSE; + } + mCurBufferp += 4; if (!verifyLength(size, name)) diff --git a/indra/llmessage/llexperiencecache.h b/indra/llmessage/llexperiencecache.h index 8be4c64dfc..3ee45da2e7 100644 --- a/indra/llmessage/llexperiencecache.h +++ b/indra/llmessage/llexperiencecache.h @@ -112,7 +112,7 @@ private: // Callback types for get() typedef boost::signals2::signal < void(const LLSD &) > callback_signal_t; - typedef boost::shared_ptr<callback_signal_t> signal_ptr; + typedef std::shared_ptr<callback_signal_t> signal_ptr; // May have multiple callbacks for a single ID, which are // represented as multiple slots bound to the signal. // Avoid copying signals via pointers. diff --git a/indra/llmessage/lliohttpserver.cpp b/indra/llmessage/lliohttpserver.cpp index c707c7ad09..e302dd2b5e 100644 --- a/indra/llmessage/lliohttpserver.cpp +++ b/indra/llmessage/lliohttpserver.cpp @@ -982,7 +982,7 @@ LLHTTPNode& LLIOHTTPServer::create( } LLHTTPResponseFactory* factory = new LLHTTPResponseFactory; - boost::shared_ptr<LLChainIOFactory> factory_ptr(factory); + std::shared_ptr<LLChainIOFactory> factory_ptr(factory); LLIOServerSocket* server = new LLIOServerSocket(pool, socket, factory_ptr); diff --git a/indra/llmessage/lliopipe.h b/indra/llmessage/lliopipe.h index 7fd4cee8ba..e6ac8ebfc2 100644 --- a/indra/llmessage/lliopipe.h +++ b/indra/llmessage/lliopipe.h @@ -89,7 +89,7 @@ public: /** * @brief Scattered memory container. */ - typedef boost::shared_ptr<LLBufferArray> buffer_ptr_t; + typedef std::shared_ptr<LLBufferArray> buffer_ptr_t; /** * @brief Enumeration for IO return codes diff --git a/indra/llmessage/lliosocket.h b/indra/llmessage/lliosocket.h index 303d80eb14..a62b3c0204 100644 --- a/indra/llmessage/lliosocket.h +++ b/indra/llmessage/lliosocket.h @@ -65,7 +65,7 @@ public: /** * @brief Reference counted shared pointers to sockets. */ - typedef boost::shared_ptr<LLSocket> ptr_t; + typedef std::shared_ptr<LLSocket> ptr_t; /** * @brief Type of socket to create. @@ -305,7 +305,7 @@ class LLIOServerSocket : public LLIOPipe { public: typedef LLSocket::ptr_t socket_t; - typedef boost::shared_ptr<LLChainIOFactory> factory_t; + typedef std::shared_ptr<LLChainIOFactory> factory_t; LLIOServerSocket(apr_pool_t* pool, socket_t listener, factory_t reactor); virtual ~LLIOServerSocket(); diff --git a/indra/llmessage/llservice.h b/indra/llmessage/llservice.h index 9c09aeb44c..f215acab56 100644 --- a/indra/llmessage/llservice.h +++ b/indra/llmessage/llservice.h @@ -116,7 +116,7 @@ class LLService : public LLIOPipe public: //typedef boost::intrusive_ptr<LLServiceCreator> creator_t; //typedef boost::intrusive_ptr<LLService> service_t; - typedef boost::shared_ptr<LLChainIOFactory> creator_t; + typedef std::shared_ptr<LLChainIOFactory> creator_t; /** * @brief This method is used to register a protocol name with a diff --git a/indra/llmessage/llstoredmessage.h b/indra/llmessage/llstoredmessage.h index 9c98e2c558..6ea150fda3 100644 --- a/indra/llmessage/llstoredmessage.h +++ b/indra/llmessage/llstoredmessage.h @@ -46,7 +46,7 @@ private: std::string mName; }; -typedef boost::shared_ptr<LLStoredMessage> LLStoredMessagePtr; +typedef std::shared_ptr<LLStoredMessage> LLStoredMessagePtr; #endif // LL_STOREDMESSAGE_H diff --git a/indra/llmessage/tests/llcurl_stub.cpp b/indra/llmessage/tests/llcurl_stub.cpp index b7fdf4f437..1c571a74da 100644 --- a/indra/llmessage/tests/llcurl_stub.cpp +++ b/indra/llmessage/tests/llcurl_stub.cpp @@ -49,7 +49,7 @@ void LLCurl::Responder::httpCompleted() } void LLCurl::Responder::completedRaw(LLChannelDescriptors const&, - boost::shared_ptr<LLBufferArray> const&) + std::shared_ptr<LLBufferArray> const&) { } diff --git a/indra/llplugin/llpluginclassmedia.h b/indra/llplugin/llpluginclassmedia.h index ba76ae4e37..d56712257b 100644 --- a/indra/llplugin/llpluginclassmedia.h +++ b/indra/llplugin/llpluginclassmedia.h @@ -335,7 +335,7 @@ public: // "init_history" message void initializeUrlHistory(const LLSD& url_history); - boost::shared_ptr<LLPluginClassMedia> getSharedPtr() { return boost::dynamic_pointer_cast<LLPluginClassMedia>(shared_from_this()); } // due to enable_shared_from_this + std::shared_ptr<LLPluginClassMedia> getSharedPtr() { return std::dynamic_pointer_cast<LLPluginClassMedia>(shared_from_this()); } // due to enable_shared_from_this protected: diff --git a/indra/llplugin/llpluginprocessparent.h b/indra/llplugin/llpluginprocessparent.h index 1893c9e657..01627925d7 100644 --- a/indra/llplugin/llpluginprocessparent.h +++ b/indra/llplugin/llpluginprocessparent.h @@ -43,7 +43,7 @@ #include "llsd.h" #include "llevents.h" -class LLPluginProcessParentOwner : public boost::enable_shared_from_this < LLPluginProcessParentOwner > +class LLPluginProcessParentOwner : public std::enable_shared_from_this < LLPluginProcessParentOwner > { public: virtual ~LLPluginProcessParentOwner(); @@ -60,7 +60,7 @@ class LLPluginProcessParent : public LLPluginMessagePipeOwner LLPluginProcessParent(LLPluginProcessParentOwner *owner); public: - typedef boost::shared_ptr<LLPluginProcessParent> ptr_t; + typedef std::shared_ptr<LLPluginProcessParent> ptr_t; ~LLPluginProcessParent(); diff --git a/indra/llprimitive/lldaeloader.cpp b/indra/llprimitive/lldaeloader.cpp index 2e4b013b77..2c357e1ac5 100644 --- a/indra/llprimitive/lldaeloader.cpp +++ b/indra/llprimitive/lldaeloader.cpp @@ -53,8 +53,6 @@ #pragma warning (default : 4264) #endif -#include <boost/lexical_cast.hpp> - #include "lldaeloader.h" #include "llsdserialize.h" #include "lljoint.h" @@ -2385,7 +2383,7 @@ std::string LLDAELoader::getElementLabel(daeElement *element) if (ind > 0) { - index_string = "_" + boost::lexical_cast<std::string>(ind); + index_string = "_" + std::to_string(ind); } // if parent has a name or ID, use it diff --git a/indra/llprimitive/llgltfloader.cpp b/indra/llprimitive/llgltfloader.cpp index 7394f99794..8e498158d6 100644 --- a/indra/llprimitive/llgltfloader.cpp +++ b/indra/llprimitive/llgltfloader.cpp @@ -48,8 +48,6 @@ // TODO: includes inherited from dae loader. Validate / prune -#include <boost/lexical_cast.hpp> - #include "llsdserialize.h" #include "lljoint.h" diff --git a/indra/llprimitive/llmodel.cpp b/indra/llprimitive/llmodel.cpp index d56ffdc317..7b0d2632aa 100644 --- a/indra/llprimitive/llmodel.cpp +++ b/indra/llprimitive/llmodel.cpp @@ -68,6 +68,7 @@ LLModel::~LLModel() { LLConvexDecomposition::getInstance()->deleteDecomposition(mDecompID); } + mPhysics.mMesh.clear(); } //static diff --git a/indra/llprimitive/llmodel.h b/indra/llprimitive/llmodel.h index 4505d6b3b9..040257e00e 100644 --- a/indra/llprimitive/llmodel.h +++ b/indra/llprimitive/llmodel.h @@ -106,6 +106,8 @@ public: std::vector<LLVector3> mPositions; std::vector<LLVector3> mNormals; + ~PhysicsMesh() {} + void clear() { mPositions.clear(); @@ -131,6 +133,7 @@ public: public: Decomposition() { } Decomposition(LLSD& data); + ~Decomposition() { } void fromLLSD(LLSD& data); LLSD asLLSD() const; bool hasHullList() const; @@ -365,7 +368,7 @@ class LLModelInstanceBase { public: LLPointer<LLModel> mModel; - LLPointer<LLModel> mLOD[5]; + LLPointer<LLModel> mLOD[LLModel::NUM_LODS]; LLUUID mMeshID; LLMatrix4 mTransform; @@ -380,6 +383,15 @@ public: : mModel(NULL) { } + + virtual ~LLModelInstanceBase() + { + mModel = NULL; + for (int j = 0; j < LLModel::NUM_LODS; ++j) + { + mLOD[j] = NULL; + } + }; }; typedef std::vector<LLModelInstanceBase> model_instance_list; @@ -399,6 +411,8 @@ public: LLModelInstance(LLSD& data); + ~LLModelInstance() {} + LLSD asLLSD(); }; diff --git a/indra/llprimitive/tests/llmediaentry_test.cpp b/indra/llprimitive/tests/llmediaentry_test.cpp index b072ce3964..c3e17d1267 100644 --- a/indra/llprimitive/tests/llmediaentry_test.cpp +++ b/indra/llprimitive/tests/llmediaentry_test.cpp @@ -211,7 +211,7 @@ namespace tut void whitelist_test(int num, bool enable, const char *whitelist, const char *candidate_url, bool expected_pass) { - std::string message = "Whitelist test " + boost::lexical_cast<std::string>(num); + std::string message = "Whitelist test " + std::to_string(num); LLMediaEntry entry; entry.setWhiteListEnable(enable); set_whitelist(entry, whitelist); diff --git a/indra/llui/llcommandmanager.cpp b/indra/llui/llcommandmanager.cpp index 3e159365e5..8ef7bd837f 100644 --- a/indra/llui/llcommandmanager.cpp +++ b/indra/llui/llcommandmanager.cpp @@ -34,8 +34,6 @@ #include "llerror.h" #include "llxuiparser.h" -#include <boost/foreach.hpp> - // // LLCommandId class @@ -182,7 +180,7 @@ bool LLCommandManager::load() return false; } - BOOST_FOREACH(LLCommand::Params& commandParams, commandsParams.commands) + for (const LLCommand::Params& commandParams : commandsParams.commands) { LLCommand * command = new LLCommand(commandParams); diff --git a/indra/llui/llfiltereditor.h b/indra/llui/llfiltereditor.h index 3a05bc05a1..52cad3bff4 100644 --- a/indra/llui/llfiltereditor.h +++ b/indra/llui/llfiltereditor.h @@ -43,6 +43,7 @@ class LLFilterEditor : public LLSearchEditor public: struct Params : public LLInitParam::Block<Params, LLSearchEditor::Params> {}; + virtual ~LLFilterEditor() {} protected: LLFilterEditor(const Params&); diff --git a/indra/llui/llfloater.cpp b/indra/llui/llfloater.cpp index e6a47ca3eb..53a087eaf2 100644 --- a/indra/llui/llfloater.cpp +++ b/indra/llui/llfloater.cpp @@ -59,7 +59,6 @@ #include "llmultifloater.h" #include "llsdutil.h" #include "lluiusage.h" -#include <boost/foreach.hpp> // use this to control "jumping" behavior when Ctrl-Tabbing @@ -1849,6 +1848,8 @@ void LLFloater::onClickTearOff(LLFloater* self) { if (self->mSaveRect) { + LLRect screen_rect = self->calcScreenRect(); + self->mPosition = LLCoordGL(screen_rect.getCenterX(), screen_rect.getCenterY()).convert(); self->storeRectControl(); } self->setMinimized(FALSE); // to reenable minimize button if it was minimized @@ -2460,7 +2461,7 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) //{ // floaterp->translate(translate_x, translate_y); //} - BOOST_FOREACH(LLHandle<LLFloater> dependent_floater, floaterp->mDependents) + for (LLHandle<LLFloater> dependent_floater : floaterp->mDependents) { if (dependent_floater.get()) { @@ -2475,10 +2476,9 @@ void LLFloaterView::reshape(S32 width, S32 height, BOOL called_from_parent) void LLFloaterView::restoreAll() { // make sure all subwindows aren't minimized - child_list_t child_list = *(getChildList()); - for (child_list_const_iter_t child_it = child_list.begin(); child_it != child_list.end(); ++child_it) + for (auto child : *getChildList()) { - LLFloater* floaterp = dynamic_cast<LLFloater*>(*child_it); + LLFloater* floaterp = dynamic_cast<LLFloater*>(child); if (floaterp) { floaterp->setMinimized(FALSE); diff --git a/indra/llui/lllayoutstack.cpp b/indra/llui/lllayoutstack.cpp index 7e4e828a88..2769a96875 100644 --- a/indra/llui/lllayoutstack.cpp +++ b/indra/llui/lllayoutstack.cpp @@ -395,8 +395,7 @@ void LLLayoutStack::updateLayout() : getRect().getHeight(); // first, assign minimum dimensions - LLLayoutPanel* panelp = NULL; - BOOST_FOREACH(panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (panelp->mAutoResize) { @@ -409,12 +408,15 @@ void LLLayoutStack::updateLayout() llassert(total_visible_fraction < 1.05f); // don't need spacing after last panel - space_to_distribute += panelp ? ll_round((F32)mPanelSpacing * panelp->getVisibleAmount()) : 0; + if (!mPanels.empty()) + { + space_to_distribute += ll_round(F32(mPanelSpacing) * mPanels.back()->getVisibleAmount()); + } S32 remaining_space = space_to_distribute; if (space_to_distribute > 0 && total_visible_fraction > 0.f) { // give space proportionally to visible auto resize panels - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (panelp->mAutoResize) { @@ -427,7 +429,7 @@ void LLLayoutStack::updateLayout() } // distribute any left over pixels to non-collapsed, visible panels - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (remaining_space == 0) break; @@ -443,7 +445,7 @@ void LLLayoutStack::updateLayout() F32 cur_pos = (mOrientation == HORIZONTAL) ? 0.f : (F32)getRect().getHeight(); - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { F32 panel_dim = llmax(panelp->getExpandedMinDim(), panelp->mTargetDim); @@ -538,7 +540,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanel(LLPanel* panelp) const { if (!panelp) return NULL; - BOOST_FOREACH(LLLayoutPanel* p, mPanels) + for (LLLayoutPanel* p : mPanels) { if (p == panelp) { @@ -552,7 +554,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c { LLLayoutPanel* result = NULL; - BOOST_FOREACH(LLLayoutPanel* p, mPanels) + for (LLLayoutPanel* p : mPanels) { if (p->getName() == name) { @@ -566,7 +568,7 @@ LLLayoutPanel* LLLayoutStack::findEmbeddedPanelByName(const std::string& name) c void LLLayoutStack::createResizeBar(LLLayoutPanel* panelp) { - BOOST_FOREACH(LLLayoutPanel* lp, mPanels) + for (LLLayoutPanel* lp : mPanels) { if (lp->mResizeBar == NULL) { @@ -669,7 +671,7 @@ void LLLayoutStack::updateFractionalSizes() { F32 total_resizable_dim = 0.f; - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (panelp->mAutoResize) { @@ -677,7 +679,7 @@ void LLLayoutStack::updateFractionalSizes() } } - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (panelp->mAutoResize) { @@ -698,7 +700,7 @@ void LLLayoutStack::normalizeFractionalSizes() S32 num_auto_resize_panels = 0; F32 total_fractional_size = 0.f; - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (panelp->mAutoResize) { @@ -709,7 +711,7 @@ void LLLayoutStack::normalizeFractionalSizes() if (total_fractional_size == 0.f) { // equal distribution - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (panelp->mAutoResize) { @@ -719,7 +721,7 @@ void LLLayoutStack::normalizeFractionalSizes() } else { // renormalize - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (panelp->mAutoResize) { @@ -736,7 +738,7 @@ bool LLLayoutStack::animatePanels() // // animate visibility // - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (panelp->getVisible()) { @@ -834,7 +836,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& LLLayoutPanel* other_resize_panel = NULL; LLLayoutPanel* following_panel = NULL; - BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels) + BOOST_REVERSE_FOREACH(LLLayoutPanel* panelp, mPanels) // Should replace this when C++20 reverse view adaptor becomes available... { if (panelp->mAutoResize) { @@ -883,7 +885,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& AFTER_RESIZED_PANEL } which_panel = BEFORE_RESIZED_PANEL; - BOOST_FOREACH(LLLayoutPanel* panelp, mPanels) + for (LLLayoutPanel* panelp : mPanels) { if (!panelp->getVisible() || panelp->mCollapsed) { @@ -974,6 +976,7 @@ void LLLayoutStack::updatePanelRect( LLLayoutPanel* resized_panel, const LLRect& MIN_FRACTIONAL_SIZE, MAX_FRACTIONAL_SIZE); } + break; default: break; } @@ -990,8 +993,8 @@ void LLLayoutStack::reshape(S32 width, S32 height, BOOL called_from_parent) void LLLayoutStack::updateResizeBarLimits() { - LLLayoutPanel* previous_visible_panelp = NULL; - BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels) + LLLayoutPanel* previous_visible_panelp{ nullptr }; + BOOST_REVERSE_FOREACH(LLLayoutPanel* visible_panelp, mPanels) // Should replace this when C++20 reverse view adaptor becomes available... { if (!visible_panelp->getVisible() || visible_panelp->mCollapsed) { diff --git a/indra/llui/llloadingindicator.cpp b/indra/llui/llloadingindicator.cpp index 1ede5b706f..e8b6b7e43b 100644 --- a/indra/llui/llloadingindicator.cpp +++ b/indra/llui/llloadingindicator.cpp @@ -34,7 +34,6 @@ // Project includes #include "lluictrlfactory.h" #include "lluiimage.h" -#include "boost/foreach.hpp" // registered in llui.cpp to avoid being left out by MS linker //static LLDefaultChildRegistry::Register<LLLoadingIndicator> r("loading_indicator"); @@ -52,7 +51,7 @@ LLLoadingIndicator::LLLoadingIndicator(const Params& p) void LLLoadingIndicator::initFromParams(const Params& p) { - BOOST_FOREACH(LLUIImage* image, p.images().image) + for (LLUIImage* image : p.images().image) { mImages.push_back(image); } diff --git a/indra/llui/llmenugl.cpp b/indra/llui/llmenugl.cpp index 9c7b7db408..ce45087963 100644 --- a/indra/llui/llmenugl.cpp +++ b/indra/llui/llmenugl.cpp @@ -60,7 +60,6 @@ #include "v2math.h" #include <set> #include <boost/tokenizer.hpp> -#include <boost/foreach.hpp> // static LLMenuHolderGL *LLMenuGL::sMenuContainer = NULL; @@ -2162,7 +2161,7 @@ void LLMenuGL::arrange( void ) } else { - BOOST_FOREACH(LLMenuItemGL* itemp, mItems) + for (LLMenuItemGL* itemp : mItems) { // do first so LLMenuGLItemCall can call on_visible to determine if visible itemp->buildDrawLabel(); diff --git a/indra/llui/llnotifications.cpp b/indra/llui/llnotifications.cpp index 1ccd664022..dbf1351243 100644 --- a/indra/llui/llnotifications.cpp +++ b/indra/llui/llnotifications.cpp @@ -45,7 +45,6 @@ #include <algorithm> #include <boost/regex.hpp> -#include <boost/foreach.hpp> const std::string NOTIFICATION_PERSIST_VERSION = "0.93"; @@ -445,14 +444,14 @@ LLNotificationTemplate::LLNotificationTemplate(const LLNotificationTemplate::Par mSoundName = p.sound; } - BOOST_FOREACH(const LLNotificationTemplate::UniquenessContext& context, p.unique.contexts) + for (const LLNotificationTemplate::UniquenessContext& context : p.unique.contexts) { mUniqueContext.push_back(context.value); } LL_DEBUGS("Notifications") << "notification \"" << mName << "\": tag count is " << p.tags.size() << LL_ENDL; - BOOST_FOREACH(const LLNotificationTemplate::Tag& tag, p.tags) + for (const LLNotificationTemplate::Tag& tag : p.tags) { LL_DEBUGS("Notifications") << " tag \"" << std::string(tag.value) << "\"" << LL_ENDL; mTags.push_back(tag.value); @@ -995,6 +994,7 @@ LLBoundListener LLNotificationChannelBase::connectChangedImpl(const LLEventListe // all of the notifications that are already in the channel // we use a special signal called "load" in case the channel wants to care // only about new notifications + LLMutexLock lock(&mItemsMutex); for (LLNotificationSet::iterator it = mItems.begin(); it != mItems.end(); ++it) { slot(LLSD().with("sigtype", "load").with("id", (*it)->id())); @@ -1154,7 +1154,7 @@ LLNotificationChannel::LLNotificationChannel(const Params& p) LLInstanceTracker<LLNotificationChannel, std::string>(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()), mName(p.name.isProvided() ? p.name : LLUUID::generateNewID().asString()) { - BOOST_FOREACH(const std::string& source, p.sources) + for (const std::string& source : p.sources) { connectToChannel(source); } @@ -1172,29 +1172,33 @@ LLNotificationChannel::LLNotificationChannel(const std::string& name, connectToChannel(parent); } -bool LLNotificationChannel::isEmpty() const +LLNotificationChannel::~LLNotificationChannel() { - return mItems.empty(); + for (LLBoundListener &listener : mListeners) + { + listener.disconnect(); + } } -S32 LLNotificationChannel::size() const +bool LLNotificationChannel::isEmpty() const { - return mItems.size(); + return mItems.empty(); } -LLNotificationChannel::Iterator LLNotificationChannel::begin() +S32 LLNotificationChannel::size() const { - return mItems.begin(); + return mItems.size(); } -LLNotificationChannel::Iterator LLNotificationChannel::end() +size_t LLNotificationChannel::size() { - return mItems.end(); + return mItems.size(); } -size_t LLNotificationChannel::size() +void LLNotificationChannel::forEachNotification(NotificationProcess process) { - return mItems.size(); + LLMutexLock lock(&mItemsMutex); + std::for_each(mItems.begin(), mItems.end(), process); } std::string LLNotificationChannel::summarize() @@ -1202,7 +1206,8 @@ std::string LLNotificationChannel::summarize() std::string s("Channel '"); s += mName; s += "'\n "; - for (LLNotificationChannel::Iterator it = begin(); it != end(); ++it) + LLMutexLock lock(&mItemsMutex); + for (LLNotificationChannel::Iterator it = mItems.begin(); it != mItems.end(); ++it) { s += (*it)->summarize(); s += "\n "; @@ -1214,14 +1219,14 @@ void LLNotificationChannel::connectToChannel( const std::string& channel_name ) { if (channel_name.empty()) { - LLNotifications::instance().connectChanged( - boost::bind(&LLNotificationChannelBase::updateItem, this, _1)); + mListeners.push_back(LLNotifications::instance().connectChanged( + boost::bind(&LLNotificationChannelBase::updateItem, this, _1))); } else { mParents.push_back(channel_name); LLNotificationChannelPtr p = LLNotifications::instance().getChannel(channel_name); - p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1)); + mListeners.push_back(p->connectChanged(boost::bind(&LLNotificationChannelBase::updateItem, this, _1))); } } @@ -1522,7 +1527,7 @@ void replaceFormText(LLNotificationForm::Params& form, const std::string& patter form.ignore.text = replace; } - BOOST_FOREACH(LLNotificationForm::FormElement& element, form.form_elements.elements) + for (LLNotificationForm::FormElement& element : form.form_elements.elements) { if (element.button.isChosen() && element.button.text() == pattern) { @@ -1577,19 +1582,19 @@ bool LLNotifications::loadTemplates() mTemplates.clear(); - BOOST_FOREACH(LLNotificationTemplate::GlobalString& string, params.strings) + for (const LLNotificationTemplate::GlobalString& string : params.strings) { mGlobalStrings[string.name] = string.value; } std::map<std::string, LLNotificationForm::Params> form_templates; - BOOST_FOREACH(LLNotificationTemplate::Template& notification_template, params.templates) + for (const LLNotificationTemplate::Template& notification_template : params.templates) { form_templates[notification_template.name] = notification_template.form; } - BOOST_FOREACH(LLNotificationTemplate::Params& notification, params.notifications) + for (LLNotificationTemplate::Params& notification : params.notifications) { if (notification.form_ref.form_template.isChosen()) { @@ -1644,7 +1649,7 @@ bool LLNotifications::loadVisibilityRules() mVisibilityRules.clear(); - BOOST_FOREACH(LLNotificationVisibilityRule::Rule& rule, params.rules) + for (const LLNotificationVisibilityRule::Rule& rule : params.rules) { mVisibilityRules.push_back(LLNotificationVisibilityRulePtr(new LLNotificationVisibilityRule(rule))); } @@ -1737,6 +1742,7 @@ void LLNotifications::cancel(LLNotificationPtr pNotif) void LLNotifications::cancelByName(const std::string& name) { + LLMutexLock lock(&mItemsMutex); std::vector<LLNotificationPtr> notifs_to_cancel; for (LLNotificationSet::iterator it=mItems.begin(), end_it = mItems.end(); it != end_it; @@ -1761,6 +1767,7 @@ void LLNotifications::cancelByName(const std::string& name) void LLNotifications::cancelByOwner(const LLUUID ownerId) { + LLMutexLock lock(&mItemsMutex); std::vector<LLNotificationPtr> notifs_to_cancel; for (LLNotificationSet::iterator it = mItems.begin(), end_it = mItems.end(); it != end_it; @@ -1808,11 +1815,6 @@ LLNotificationPtr LLNotifications::find(LLUUID uuid) } } -void LLNotifications::forEachNotification(NotificationProcess process) -{ - std::for_each(mItems.begin(), mItems.end(), process); -} - std::string LLNotifications::getGlobalString(const std::string& key) const { GlobalStringMap::const_iterator it = mGlobalStrings.find(key); diff --git a/indra/llui/llnotifications.h b/indra/llui/llnotifications.h index d44be65841..e912f89c16 100644 --- a/indra/llui/llnotifications.h +++ b/indra/llui/llnotifications.h @@ -739,16 +739,19 @@ class LLNotificationChannelBase : { LOG_CLASS(LLNotificationChannelBase); public: - LLNotificationChannelBase(LLNotificationFilter filter) - : mFilter(filter), - mItems() - {} + LLNotificationChannelBase(LLNotificationFilter filter) + : mFilter(filter) + , mItems() + , mItemsMutex() + {} + virtual ~LLNotificationChannelBase() { // explicit cleanup for easier issue detection mChanged.disconnect_all_slots(); mPassedFilter.disconnect_all_slots(); mFailedFilter.disconnect_all_slots(); + LLMutexLock lock(&mItemsMutex); mItems.clear(); } // you can also connect to a Channel, so you can be notified of @@ -787,6 +790,7 @@ protected: LLStandardSignal mChanged; LLStandardSignal mPassedFilter; LLStandardSignal mFailedFilter; + LLMutex mItemsMutex; // these are action methods that subclasses can override to take action // on specific types of changes; the management of the mItems list is @@ -836,7 +840,7 @@ public: LLNotificationChannel(const Params& p = Params()); LLNotificationChannel(const std::string& name, const std::string& parent, LLNotificationFilter filter); - virtual ~LLNotificationChannel() {} + virtual ~LLNotificationChannel(); typedef LLNotificationSet::iterator Iterator; std::string getName() const { return mName; } @@ -845,21 +849,23 @@ public: { return boost::iterator_range<parents_iter>(mParents); } - - void connectToChannel(const std::string& channel_name); - + bool isEmpty() const; S32 size() const; - - Iterator begin(); - Iterator end(); - size_t size(); - + size_t size(); + + typedef boost::function<void(LLNotificationPtr)> NotificationProcess; + void forEachNotification(NotificationProcess process); + std::string summarize(); +protected: + void connectToChannel(const std::string& channel_name); + private: std::string mName; std::vector<std::string> mParents; + std::vector<LLBoundListener> mListeners; }; // An interface class to provide a clean linker seam to the LLNotifications class. @@ -925,10 +931,6 @@ public: void update(const LLNotificationPtr pNotif); LLNotificationPtr find(LLUUID uuid); - - typedef boost::function<void (LLNotificationPtr)> NotificationProcess; - - void forEachNotification(NotificationProcess process); // This is all stuff for managing the templates // take your template out @@ -991,7 +993,7 @@ private: bool mIgnoreAllNotifications; - boost::scoped_ptr<LLNotificationsListener> mListener; + std::unique_ptr<LLNotificationsListener> mListener; std::vector<LLNotificationChannelPtr> mDefaultChannels; }; diff --git a/indra/llui/llnotificationslistener.cpp b/indra/llui/llnotificationslistener.cpp index e73ba1fbe9..859222f907 100644 --- a/indra/llui/llnotificationslistener.cpp +++ b/indra/llui/llnotificationslistener.cpp @@ -32,7 +32,6 @@ #include "llnotificationtemplate.h" #include "llsd.h" #include "llui.h" -#include <boost/foreach.hpp> LLNotificationsListener::LLNotificationsListener(LLNotifications & notifications) : LLEventAPI("LLNotifications", @@ -149,11 +148,11 @@ void LLNotificationsListener::listChannelNotifications(const LLSD& params) const if (channel) { LLSD notifications(LLSD::emptyArray()); - for (LLNotificationChannel::Iterator ni(channel->begin()), nend(channel->end()); - ni != nend; ++ni) - { - notifications.append(asLLSD(*ni)); - } + std::function<void(LLNotificationPtr)> func = [notifications](LLNotificationPtr ni) mutable + { + notifications.append(asLLSD(ni)); + }; + channel->forEachNotification(func); response["notifications"] = notifications; } LLEventPumps::instance().obtain(params["reply"]).post(response); diff --git a/indra/llui/llsearcheditor.cpp b/indra/llui/llsearcheditor.cpp index cfaf08ec0a..8bf135f10c 100644 --- a/indra/llui/llsearcheditor.cpp +++ b/indra/llui/llsearcheditor.cpp @@ -104,6 +104,14 @@ LLSearchEditor::LLSearchEditor(const LLSearchEditor::Params& p) } } +LLSearchEditor::~LLSearchEditor() +{ + mSearchButton = NULL; + mClearButton = NULL; + mSearchEditor->deleteAllChildren(); + deleteAllChildren(); +} + //virtual void LLSearchEditor::draw() { diff --git a/indra/llui/llsearcheditor.h b/indra/llui/llsearcheditor.h index c0f3c1d60c..bd51988d07 100644 --- a/indra/llui/llsearcheditor.h +++ b/indra/llui/llsearcheditor.h @@ -74,7 +74,7 @@ protected: friend class LLUICtrlFactory; public: - virtual ~LLSearchEditor() {} + virtual ~LLSearchEditor(); /*virtual*/ void draw(); diff --git a/indra/llui/lltoolbar.cpp b/indra/llui/lltoolbar.cpp index 58ecf3e603..eabb032f24 100644 --- a/indra/llui/lltoolbar.cpp +++ b/indra/llui/lltoolbar.cpp @@ -27,7 +27,6 @@ #include "linden_common.h" -#include <boost/foreach.hpp> #include "lltoolbar.h" #include "llcommandmanager.h" @@ -219,7 +218,7 @@ void LLToolBar::initFromParams(const LLToolBar::Params& p) mCenteringStack->addChild(LLUICtrlFactory::create<LLLayoutPanel>(border_panel_p)); - BOOST_FOREACH(LLCommandId id, p.commands) + for (const auto& id : p.commands) { addCommand(id); } @@ -417,7 +416,7 @@ BOOL LLToolBar::handleRightMouseDown(S32 x, S32 y, MASK mask) // Determine which button the mouse was over during the click in case the context menu action // is intended to affect the button. mRightMouseTargetButton = NULL; - BOOST_FOREACH(LLToolBarButton* button, mButtons) + for (LLToolBarButton* button : mButtons) { LLRect button_rect; button->localRectToOtherView(button->getLocalRect(), &button_rect, this); @@ -505,7 +504,7 @@ void LLToolBar::setButtonType(LLToolBarEnums::ButtonType button_type) void LLToolBar::resizeButtonsInRow(std::vector<LLToolBarButton*>& buttons_in_row, S32 max_row_girth) { // make buttons in current row all same girth - BOOST_FOREACH(LLToolBarButton* button, buttons_in_row) + for (LLToolBarButton* button : buttons_in_row) { if (getOrientation(mSideType) == LLLayoutStack::HORIZONTAL) { @@ -693,7 +692,7 @@ void LLToolBar::updateLayoutAsNeeded() std::vector<LLToolBarButton*> buttons_in_row; - BOOST_FOREACH(LLToolBarButton* button, mButtons) + for (LLToolBarButton* button : mButtons) { button->reshape(button->mWidthRange.getMin(), button->mDesiredHeight); button->autoResize(); @@ -878,7 +877,7 @@ void LLToolBar::createButtons() { std::set<LLUUID> set_flashing; - BOOST_FOREACH(LLToolBarButton* button, mButtons) + for (LLToolBarButton* button : mButtons) { if (button->getFlashTimer() && button->getFlashTimer()->isFlashingInProgress()) { @@ -896,7 +895,7 @@ void LLToolBar::createButtons() mButtonMap.clear(); mRightMouseTargetButton = NULL; - BOOST_FOREACH(LLCommandId& command_id, mButtonCommands) + for (const LLCommandId& command_id : mButtonCommands) { LLToolBarButton* button = createButton(command_id); mButtons.push_back(button); diff --git a/indra/llui/lltooltip.cpp b/indra/llui/lltooltip.cpp index 75fc86b226..bea46f4a6f 100644 --- a/indra/llui/lltooltip.cpp +++ b/indra/llui/lltooltip.cpp @@ -444,7 +444,13 @@ void LLToolTipMgr::createToolTip(const LLToolTip::Params& params) tooltip_params.rect = LLRect (0, 1, 1, 0); if (tooltip_params.create_callback.isProvided()) - mToolTip = tooltip_params.create_callback()(tooltip_params); + { + mToolTip = tooltip_params.create_callback()(tooltip_params); + if (mToolTip == NULL) + { + return; + } + } else mToolTip = LLUICtrlFactory::create<LLToolTip> (tooltip_params); @@ -496,7 +502,7 @@ void LLToolTipMgr::show(const LLToolTip::Params& params) { if (!params.styled_message.isProvided() && (!params.message.isProvided() || params.message().empty()) - && !params.image.isProvided()) return; + && !params.image.isProvided() && !params.create_callback.isProvided()) return; // fill in default tooltip params from tool_tip.xml LLToolTip::Params params_with_defaults(params); diff --git a/indra/llui/lluicolortable.cpp b/indra/llui/lluicolortable.cpp index 096336045c..f43bdf1fdc 100644 --- a/indra/llui/lluicolortable.cpp +++ b/indra/llui/lluicolortable.cpp @@ -32,7 +32,6 @@ #include "llui.h" #include "lluicolortable.h" #include "lluictrlfactory.h" -#include <boost/foreach.hpp> LLUIColorTable::ColorParams::ColorParams() : value("value"), @@ -208,7 +207,7 @@ bool LLUIColorTable::loadFromSettings() // pass constraint=LLDir::ALL_SKINS because we want colors.xml from every // skin dir - BOOST_FOREACH(std::string colors_path, + for (const std::string& colors_path : gDirUtilp->findSkinnedFilenames(LLDir::SKINBASE, "colors.xml", LLDir::ALL_SKINS)) { result |= loadFromFilename(colors_path, mLoadedColors); diff --git a/indra/llui/llview.cpp b/indra/llui/llview.cpp index 1a80a69293..5900251e18 100644 --- a/indra/llui/llview.cpp +++ b/indra/llui/llview.cpp @@ -32,7 +32,6 @@ #include <sstream> #include <boost/tokenizer.hpp> -#include <boost/foreach.hpp> #include <boost/bind.hpp> #include "llrender.h" @@ -61,6 +60,7 @@ static const S32 LINE_HEIGHT = 15; S32 LLView::sDepth = 0; bool LLView::sDebugRects = false; bool LLView::sDebugUnicode = false; +bool LLView::sDebugCamera = false; bool LLView::sIsRectDirty = false; LLRect LLView::sDirtyRect; bool LLView::sDebugRectsShowNames = true; @@ -593,7 +593,7 @@ void LLView::deleteAllChildren() void LLView::setAllChildrenEnabled(BOOL b) { - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { viewp->setEnabled(b); } @@ -622,7 +622,7 @@ void LLView::onVisibilityChange ( BOOL new_visibility ) { BOOL old_visibility; BOOL log_visibility_change = LLViewerEventRecorder::instance().getLoggingStatus(); - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { if (!viewp) { @@ -726,7 +726,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m { if ( getVisible() && getEnabled() ) { - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { if ((viewp->*method)(c, mask, TRUE)) { @@ -745,7 +745,7 @@ LLView* LLView::childrenHandleCharEvent(const std::string& desc, const METHOD& m template <typename METHOD, typename XDATA> LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDATA extra, bool allow_mouse_block) { - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { S32 local_x = x - viewp->getRect().mLeft; S32 local_y = y - viewp->getRect().mBottom; @@ -774,7 +774,7 @@ LLView* LLView::childrenHandleMouseEvent(const METHOD& method, S32 x, S32 y, XDA LLView* LLView::childrenHandleToolTip(S32 x, S32 y, MASK mask) { - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { S32 local_x = x - viewp->getRect().mLeft; S32 local_y = y - viewp->getRect().mBottom; @@ -806,7 +806,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask, // default to not accepting drag and drop, will be overridden by handler *accept = ACCEPT_NO; - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { S32 local_x = x - viewp->getRect().mLeft; S32 local_y = y - viewp->getRect().mBottom; @@ -832,7 +832,7 @@ LLView* LLView::childrenHandleDragAndDrop(S32 x, S32 y, MASK mask, LLView* LLView::childrenHandleHover(S32 x, S32 y, MASK mask) { - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { S32 local_x = x - viewp->getRect().mLeft; S32 local_y = y - viewp->getRect().mBottom; @@ -860,7 +860,7 @@ LLView* LLView::childFromPoint(S32 x, S32 y, bool recur) if (!getVisible()) return NULL; - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { S32 local_x = x - viewp->getRect().mLeft; S32 local_y = y - viewp->getRect().mBottom; @@ -1407,7 +1407,7 @@ void LLView::reshape(S32 width, S32 height, BOOL called_from_parent) mRect.mTop = getRect().mBottom + height; // move child views according to reshape flags - BOOST_FOREACH(LLView* viewp, mChildList) + for (LLView* viewp : mChildList) { if (viewp != NULL) { @@ -1479,7 +1479,7 @@ LLRect LLView::calcBoundingRect() { LLRect local_bounding_rect = LLRect::null; - BOOST_FOREACH(LLView* childp, mChildList) + for (LLView* childp : mChildList) { // ignore invisible and "top" children when calculating bounding rect // such as combobox popups @@ -1642,7 +1642,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const LL_PROFILE_ZONE_SCOPED_CATEGORY_UI; // Look for direct children *first* - BOOST_FOREACH(LLView* childp, mChildList) + for (LLView* childp : mChildList) { llassert(childp); if (childp->getName() == name) @@ -1653,7 +1653,7 @@ LLView* LLView::findChildView(const std::string& name, BOOL recurse) const if (recurse) { // Look inside each child as well. - BOOST_FOREACH(LLView* childp, mChildList) + for (LLView* childp : mChildList) { llassert(childp); LLView* viewp = childp->findChildView(name, recurse); @@ -2837,7 +2837,7 @@ S32 LLView::notifyParent(const LLSD& info) bool LLView::notifyChildren(const LLSD& info) { bool ret = false; - BOOST_FOREACH(LLView* childp, mChildList) + for (LLView* childp : mChildList) { ret = ret || childp->notifyChildren(info); } diff --git a/indra/llui/llview.h b/indra/llui/llview.h index c023cc95b7..4f1f3e9ec9 100644 --- a/indra/llui/llview.h +++ b/indra/llui/llview.h @@ -664,6 +664,9 @@ public: // Show hexadecimal byte values of unicode symbols in a tooltip static bool sDebugUnicode; + // Show camera position and direction in Camera Controls floater + static bool sDebugCamera; + static bool sIsRectDirty; static LLRect sDirtyRect; diff --git a/indra/llwindow/lldxhardware.cpp b/indra/llwindow/lldxhardware.cpp index 391a377280..aaa2f6aef1 100644 --- a/indra/llwindow/lldxhardware.cpp +++ b/indra/llwindow/lldxhardware.cpp @@ -65,13 +65,12 @@ HRESULT GetVideoMemoryViaWMI(WCHAR* strInputDeviceID, DWORD* pdwAdapterRam) { HRESULT hr; bool bGotMemory = false; - HRESULT hrCoInitialize = S_OK; IWbemLocator* pIWbemLocator = nullptr; IWbemServices* pIWbemServices = nullptr; BSTR pNamespace = nullptr; *pdwAdapterRam = 0; - hrCoInitialize = CoInitialize( 0 ); + CoInitializeEx(0, COINIT_APARTMENTTHREADED); hr = CoCreateInstance( CLSID_WbemLocator, nullptr, @@ -208,8 +207,7 @@ HRESULT GetVideoMemoryViaWMI(WCHAR* strInputDeviceID, DWORD* pdwAdapterRam) SAFE_RELEASE( pIWbemLocator ); - if( SUCCEEDED( hrCoInitialize ) ) - CoUninitialize(); + CoUninitialize(); if( bGotMemory ) return S_OK; @@ -232,9 +230,8 @@ S32 LLDXHardware::getMBVideoMemoryViaWMI() std::string LLDXHardware::getDriverVersionWMI(EGPUVendor vendor) { std::string mDriverVersion; - HRESULT hrCoInitialize = S_OK; HRESULT hres; - hrCoInitialize = CoInitialize(0); + CoInitializeEx(0, COINIT_APARTMENTTHREADED); IWbemLocator *pLoc = NULL; hres = CoCreateInstance( @@ -437,10 +434,10 @@ std::string LLDXHardware::getDriverVersionWMI(EGPUVendor vendor) { pEnumerator->Release(); } - if (SUCCEEDED(hrCoInitialize)) - { - CoUninitialize(); - } + + // supposed to always call CoUninitialize even if init returned false + CoUninitialize(); + return mDriverVersion; } @@ -687,7 +684,8 @@ BOOL LLDXHardware::getInfo(BOOL vram_only) BOOL ok = FALSE; HRESULT hr; - CoInitialize(NULL); + // CLSID_DxDiagProvider does not work with Multithreaded? + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); IDxDiagProvider *dx_diag_providerp = NULL; IDxDiagContainer *dx_diag_rootp = NULL; @@ -976,7 +974,7 @@ LLSD LLDXHardware::getDisplayInfo() LLTimer hw_timer; HRESULT hr; LLSD ret; - CoInitialize(NULL); + CoInitializeEx(NULL, COINIT_APARTMENTTHREADED); IDxDiagProvider *dx_diag_providerp = NULL; IDxDiagContainer *dx_diag_rootp = NULL; diff --git a/indra/newview/CMakeLists.txt b/indra/newview/CMakeLists.txt index 798e7445b9..e97ab4c52c 100644 --- a/indra/newview/CMakeLists.txt +++ b/indra/newview/CMakeLists.txt @@ -234,6 +234,7 @@ set(viewer_SOURCE_FILES llfloaterimcontainer.cpp llfloaterinspect.cpp llfloaterinventorysettings.cpp + llfloaterinventorythumbnailshelper.cpp llfloaterjoystick.cpp llfloaterlagmeter.cpp llfloaterland.cpp @@ -890,6 +891,7 @@ set(viewer_HEADER_FILES llfloaterimcontainer.h llfloaterinspect.h llfloaterinventorysettings.h + llfloaterinventorythumbnailshelper.h llfloaterjoystick.h llfloaterlagmeter.h llfloaterland.h @@ -1577,34 +1579,15 @@ endif (WINDOWS) # Add the xui files. This is handy for searching for xui elements # from within the IDE. -set(viewer_XUI_FILES - skins/default/colors.xml - skins/default/default_languages.xml - skins/default/textures/textures.xml - ) -file(GLOB DEFAULT_XUI_FILE_GLOB_LIST - ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/*.xml) -list(APPEND viewer_XUI_FILES ${DEFAULT_XUI_FILE_GLOB_LIST}) - -file(GLOB DEFAULT_WIDGET_FILE_GLOB_LIST - ${CMAKE_CURRENT_SOURCE_DIR}/skins/*/xui/en/widgets/*.xml) -list(APPEND viewer_XUI_FILES ${DEFAULT_WIDGET_FILE_GLOB_LIST}) - -# Cannot append empty lists in CMake, wait until we have files here. -#file(GLOB SILVER_WIDGET_FILE_GLOB_LIST -# ${CMAKE_CURRENT_SOURCE_DIR}/skins/silver/xui/en-us/widgets/*.xml) -#list(APPEND viewer_XUI_FILES ${SILVER_WIDGET_FILE_GLOB_LIST}) - -list(SORT viewer_XUI_FILES) - -source_group("XUI Files" FILES ${viewer_XUI_FILES}) - -set_source_files_properties(${viewer_XUI_FILES} +file(GLOB_RECURSE viewer_XUI_FILES LIST_DIRECTORIES FALSE + ${CMAKE_CURRENT_SOURCE_DIR}/skins/*.xml) +source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/skins PREFIX "XUI Files" FILES ${viewer_XUI_FILES}) +set_source_files_properties(${viewer_XUI_FILES} PROPERTIES HEADER_FILE_ONLY TRUE) - list(APPEND viewer_SOURCE_FILES ${viewer_XUI_FILES}) -file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES TRUE +# Add the shader sources +file(GLOB_RECURSE viewer_SHADER_FILES LIST_DIRECTORIES FALSE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders/*.glsl) source_group(TREE ${CMAKE_CURRENT_SOURCE_DIR}/app_settings/shaders PREFIX "Shaders" FILES ${viewer_SHADER_FILES}) set_source_files_properties(${viewer_SHADER_FILES} @@ -1614,6 +1597,7 @@ list(APPEND viewer_SOURCE_FILES ${viewer_SHADER_FILES}) set(viewer_APPSETTINGS_FILES app_settings/anim.ini + app_settings/autoreplace.xml app_settings/cmd_line.xml app_settings/commands.xml app_settings/emoji_groups.xml diff --git a/indra/newview/VIEWER_VERSION.txt b/indra/newview/VIEWER_VERSION.txt index 14627a7c8c..2380dcfd47 100644 --- a/indra/newview/VIEWER_VERSION.txt +++ b/indra/newview/VIEWER_VERSION.txt @@ -1 +1 @@ -7.1.6 +7.1.7 diff --git a/indra/newview/llagent.cpp b/indra/newview/llagent.cpp index 3853aaa8fd..13501833b2 100644 --- a/indra/newview/llagent.cpp +++ b/indra/newview/llagent.cpp @@ -95,7 +95,6 @@ #include "llworld.h" #include "llworldmap.h" #include "stringize.h" -#include "boost/foreach.hpp" #include "llcorehttputil.h" #include "lluiusage.h" @@ -1469,23 +1468,27 @@ void LLAgent::pitch(F32 angle) LLVector3 skyward = getReferenceUpVector(); - // SL-19286 Avatar is upside down when viewed from below - // after left-clicking the mouse on the avatar and dragging down - // - // The issue is observed on angle below 10 degrees - const F32 look_down_limit = 179.f * DEG_TO_RAD; - const F32 look_up_limit = 10.f * DEG_TO_RAD; - - F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward); - // clamp pitch to limits - if ((angle >= 0.f) && (angle_from_skyward + angle > look_down_limit)) + if (angle >= 0.f) { - angle = look_down_limit - angle_from_skyward; + const F32 look_down_limit = 179.f * DEG_TO_RAD; + F32 angle_from_skyward = acos(mFrameAgent.getAtAxis() * skyward); + if (angle_from_skyward + angle > look_down_limit) + { + angle = look_down_limit - angle_from_skyward; + } } - else if ((angle < 0.f) && (angle_from_skyward + angle < look_up_limit)) + else if (angle < 0.f) { - angle = look_up_limit - angle_from_skyward; + const F32 look_up_limit = 5.f * DEG_TO_RAD; + const LLVector3& viewer_camera_pos = LLViewerCamera::getInstance()->getOrigin(); + LLVector3 agent_focus_pos = getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal()); + LLVector3 look_dir = agent_focus_pos - viewer_camera_pos; + F32 angle_from_skyward = angle_between(look_dir, skyward); + if (angle_from_skyward + angle < look_up_limit) + { + angle = look_up_limit - angle_from_skyward; + } } if (fabs(angle) > 1e-4) @@ -2329,7 +2332,7 @@ void LLAgent::endAnimationUpdateUI() LLFloaterIMContainer* im_box = LLFloaterReg::getTypedInstance<LLFloaterIMContainer>("im_container"); LLFloaterIMContainer::floater_list_t conversations; im_box->getDetachedConversationFloaters(conversations); - BOOST_FOREACH(LLFloater* conversation, conversations) + for (LLFloater* conversation : conversations) { LL_INFOS() << "skip_list.insert(session_floater): " << conversation->getTitle() << LL_ENDL; skip_list.insert(conversation); @@ -4333,6 +4336,10 @@ void LLAgent::teleportRequest( // Landmark ID = LLUUID::null means teleport home void LLAgent::teleportViaLandmark(const LLUUID& landmark_asset_id) { + if (landmark_asset_id.isNull()) + { + gAgentCamera.resetView(); + } mTeleportRequest = LLTeleportRequestPtr(new LLTeleportRequestViaLandmark(landmark_asset_id)); startTeleportRequest(); } diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h index fd3a9b1d7b..43b4457bf5 100644 --- a/indra/newview/llagent.h +++ b/indra/newview/llagent.h @@ -61,7 +61,7 @@ class LLTeleportRequest; -typedef boost::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr; +typedef std::shared_ptr<LLTeleportRequest> LLTeleportRequestPtr; //-------------------------------------------------------------------- // Types @@ -131,7 +131,7 @@ public: private: bool mInitialized; bool mFirstLogin; - boost::shared_ptr<LLAgentListener> mListener; + std::shared_ptr<LLAgentListener> mListener; //-------------------------------------------------------------------- // Session diff --git a/indra/newview/llagentcamera.cpp b/indra/newview/llagentcamera.cpp index b51bf132f4..8289fb9c62 100644 --- a/indra/newview/llagentcamera.cpp +++ b/indra/newview/llagentcamera.cpp @@ -1779,7 +1779,7 @@ LLVector3d LLAgentCamera::calcCameraPositionTargetGlobal(BOOL *hit_limit) head_offset.clearVec(); F32 fixup; - if (gAgentAvatarp->hasPelvisFixup(fixup)) + if (gAgentAvatarp->hasPelvisFixup(fixup) && !gAgentAvatarp->isSitting()) { head_offset[VZ] -= fixup; } diff --git a/indra/newview/llaisapi.cpp b/indra/newview/llaisapi.cpp index 17e1a27934..f23ce13608 100644 --- a/indra/newview/llaisapi.cpp +++ b/indra/newview/llaisapi.cpp @@ -1738,10 +1738,6 @@ void AISUpdate::doUpdate() LL_DEBUGS("Inventory") << "cat version update " << cat->getName() << " to version " << cat->getVersion() << LL_ENDL; if (cat->getVersion() != version) { - LL_WARNS() << "Possible version mismatch for category " << cat->getName() - << ", viewer version " << cat->getVersion() - << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL; - // the AIS version should be considered the true version. Adjust // our local category model to reflect this version number. Otherwise // it becomes possible to get stuck with the viewer being out of @@ -1751,13 +1747,23 @@ void AISUpdate::doUpdate() // is performed. This occasionally gets out of sync however. if (version != LLViewerInventoryCategory::VERSION_UNKNOWN) { + LL_WARNS() << "Possible version mismatch for category " << cat->getName() + << ", viewer version " << cat->getVersion() + << " AIS version " << version << " !!!Adjusting local version!!!" << LL_ENDL; cat->setVersion(version); } else { // We do not account for update if version is UNKNOWN, so we shouldn't rise version // either or viewer will get stuck on descendants count -1, try to refetch folder instead - cat->fetch(); + // + // Todo: proper backoff? + + LL_WARNS() << "Possible version mismatch for category " << cat->getName() + << ", viewer version " << cat->getVersion() + << " AIS version " << version << " !!!Rerequesting category!!!" << LL_ENDL; + const S32 LONG_EXPIRY = 360; + cat->fetch(LONG_EXPIRY); } } } diff --git a/indra/newview/llappearancemgr.cpp b/indra/newview/llappearancemgr.cpp index fa0dee3ef9..adf53c78ce 100644 --- a/indra/newview/llappearancemgr.cpp +++ b/indra/newview/llappearancemgr.cpp @@ -27,7 +27,6 @@ #include "llviewerprecompiledheaders.h" #include <boost/lexical_cast.hpp> -#include <boost/foreach.hpp> #include "llaccordionctrltab.h" #include "llagent.h" #include "llagentcamera.h" @@ -1652,7 +1651,7 @@ void LLAppearanceMgr::removeOutfitPhoto(const LLUUID& outfit_id) sub_cat_array, outfit_item_array, LLInventoryModel::EXCLUDE_TRASH); - BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) + for (LLViewerInventoryItem* outfit_item : outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); if (linked_item != NULL) @@ -3443,7 +3442,7 @@ void update_base_outfit_after_ordering() sub_cat_array, outfit_item_array, LLInventoryModel::EXCLUDE_TRASH); - BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) + for (LLViewerInventoryItem* outfit_item : outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); if (linked_item != NULL) @@ -3747,7 +3746,7 @@ LLSD LLAppearanceMgr::dumpCOF() const LLUUID linked_asset_id(linked_item->getAssetUUID()); md5.update((unsigned char*)linked_asset_id.mData, 16); U32 flags = linked_item->getFlags(); - md5.update(boost::lexical_cast<std::string>(flags)); + md5.update(std::to_string(flags)); } else if (LLAssetType::AT_LINK_FOLDER != inv_item->getActualType()) { diff --git a/indra/newview/llappviewer.cpp b/indra/newview/llappviewer.cpp index fc6153defd..a189e531da 100644 --- a/indra/newview/llappviewer.cpp +++ b/indra/newview/llappviewer.cpp @@ -143,7 +143,6 @@ // Third party library includes #include <boost/bind.hpp> -#include <boost/foreach.hpp> #include <boost/algorithm/string.hpp> #include <boost/regex.hpp> #include <boost/throw_exception.hpp> @@ -1199,7 +1198,7 @@ bool LLAppViewer::init() LLSD item(LeapCommand); LeapCommand.append(item); } - BOOST_FOREACH(const std::string& leap, llsd::inArray(LeapCommand)) + for (const auto& leap : llsd::inArray(LeapCommand)) { LL_INFOS("InitInfo") << "processing --leap \"" << leap << '"' << LL_ENDL; // We don't have any better description of this plugin than the @@ -1704,7 +1703,7 @@ bool LLAppViewer::cleanup() LLNotifications::instance().clear(); // workaround for DEV-35406 crash on shutdown - LLEventPumps::instance().reset(); + LLEventPumps::instance().reset(true); //dump scene loading monitor results if (LLSceneMonitor::instanceExists()) @@ -2361,7 +2360,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, LL_ERRS() << "Invalid settings location list" << LL_ENDL; } - BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) + for (const SettingsGroup& group : mSettingsLocationList->groups) { // skip settings groups that aren't the one we requested if (group.name() != location_key) continue; @@ -2373,7 +2372,7 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, return false; } - BOOST_FOREACH(const SettingsFile& file, group.files) + for (const SettingsFile& file : group.files) { LL_INFOS("Settings") << "Attempting to load settings for the group " << file.name() << " - from location " << location_key << LL_ENDL; @@ -2438,11 +2437,11 @@ bool LLAppViewer::loadSettingsFromDirectory(const std::string& location_key, std::string LLAppViewer::getSettingsFilename(const std::string& location_key, const std::string& file) { - BOOST_FOREACH(const SettingsGroup& group, mSettingsLocationList->groups) + for (const SettingsGroup& group : mSettingsLocationList->groups) { if (group.name() == location_key) { - BOOST_FOREACH(const SettingsFile& settings_file, group.files) + for (const SettingsFile& settings_file : group.files) { if (settings_file.name() == file) { @@ -3028,7 +3027,7 @@ void LLAppViewer::initStrings() // Now that we've set "[sourceid]", have to go back through // default_trans_args and reinitialize all those other keys because some // of them, in turn, reference "[sourceid]". - BOOST_FOREACH(std::string key, default_trans_args) + for (const std::string& key : default_trans_args) { std::string brackets(key), nobrackets(key); // Invalid to inspect key[0] if key is empty(). But then, the entire @@ -4694,16 +4693,23 @@ void LLAppViewer::idle() // When appropriate, update agent location to the simulator. F32 agent_update_time = agent_update_timer.getElapsedTimeF32(); F32 agent_force_update_time = mLastAgentForceUpdate + agent_update_time; - BOOL force_update = gAgent.controlFlagsDirty() - || (mLastAgentControlFlags != gAgent.getControlFlags()) - || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); - if (force_update || (agent_update_time > (1.0f / (F32) AGENT_UPDATES_PER_SECOND))) + bool timed_out = agent_update_time > (1.0f / (F32)AGENT_UPDATES_PER_SECOND); + BOOL force_send = + // if there is something to send + (gAgent.controlFlagsDirty() && timed_out) + // if something changed + || (mLastAgentControlFlags != gAgent.getControlFlags()) + // keep alive + || (agent_force_update_time > (1.0f / (F32) AGENT_FORCE_UPDATES_PER_SECOND)); + // timing out doesn't warranty that an update will be sent, + // just that it will be checked. + if (force_send || timed_out) { LL_PROFILE_ZONE_SCOPED_CATEGORY_NETWORK; // Send avatar and camera info mLastAgentControlFlags = gAgent.getControlFlags(); - mLastAgentForceUpdate = force_update ? 0 : agent_force_update_time; - send_agent_update(force_update); + mLastAgentForceUpdate = force_send ? 0 : agent_force_update_time; + send_agent_update(force_send); agent_update_timer.reset(); } } diff --git a/indra/newview/llchiclet.cpp b/indra/newview/llchiclet.cpp index cc4f4536a4..3444f50e52 100644 --- a/indra/newview/llchiclet.cpp +++ b/indra/newview/llchiclet.cpp @@ -177,6 +177,11 @@ LLNotificationChiclet::LLNotificationChiclet(const Params& p) LLFloaterNotificationsTabbed::getInstance()->setSysWellChiclet(this); } +LLNotificationChiclet::~LLNotificationChiclet() +{ + mNotificationChannel.reset(); +} + void LLNotificationChiclet::onMenuItemClicked(const LLSD& user_data) { std::string action = user_data.asString(); diff --git a/indra/newview/llchiclet.h b/indra/newview/llchiclet.h index 58a797218f..1698fa269a 100644 --- a/indra/newview/llchiclet.h +++ b/indra/newview/llchiclet.h @@ -531,8 +531,9 @@ public: struct Params : public LLInitParam::Block<Params, LLSysWellChiclet::Params>{}; protected: - struct ChicletNotificationChannel : public LLNotificationChannel + class ChicletNotificationChannel : public LLNotificationChannel { + public: ChicletNotificationChannel(LLNotificationChiclet* chiclet) : LLNotificationChannel(LLNotificationChannel::Params().filter(filterNotification).name(chiclet->getSessionId().asString())) , mChiclet(chiclet) @@ -542,6 +543,7 @@ protected: connectToChannel("Offer"); connectToChannel("Notifications"); } + virtual ~ChicletNotificationChannel() {} static bool filterNotification(LLNotificationPtr notify); // connect counter updaters to the corresponding signals @@ -553,9 +555,10 @@ protected: }; boost::scoped_ptr<ChicletNotificationChannel> mNotificationChannel; - - LLNotificationChiclet(const Params& p); - + + LLNotificationChiclet(const Params& p); + ~LLNotificationChiclet(); + /** * Processes clicks on chiclet menu. */ diff --git a/indra/newview/llcompilequeue.cpp b/indra/newview/llcompilequeue.cpp index 320806d78d..a3dcea5410 100644 --- a/indra/newview/llcompilequeue.cpp +++ b/indra/newview/llcompilequeue.cpp @@ -74,7 +74,7 @@ namespace class ObjectInventoryFetcher: public LLVOInventoryListener { public: - typedef boost::shared_ptr<ObjectInventoryFetcher> ptr_t; + typedef std::shared_ptr<ObjectInventoryFetcher> ptr_t; ObjectInventoryFetcher(LLEventPump &pump, LLViewerObject* object, void* user_data) : mPump(pump), diff --git a/indra/newview/llconversationlog.cpp b/indra/newview/llconversationlog.cpp index a696c99a82..3c59ca046d 100644 --- a/indra/newview/llconversationlog.cpp +++ b/indra/newview/llconversationlog.cpp @@ -32,7 +32,6 @@ #include "llnotificationsutil.h" #include "lltrans.h" -#include <boost/foreach.hpp> #include "boost/lexical_cast.hpp" const S32Days CONVERSATION_LIFETIME = (S32Days)30; // lifetime of LLConversation is 30 days by spec @@ -392,7 +391,7 @@ void LLConversationLog::deleteBackupLogs() std::vector<std::string> backup_logs; getListOfBackupLogs(backup_logs); - BOOST_FOREACH(const std::string& fullpath, backup_logs) + for (const std::string& fullpath : backup_logs) { LLFile::remove(fullpath); } @@ -434,7 +433,7 @@ bool LLConversationLog::moveLog(const std::string &originDirectory, const std::s while(LLFile::isfile(backupFileName)) { ++backupFileCount; - backupFileName = targetDirectory + ".backup" + boost::lexical_cast<std::string>(backupFileCount); + backupFileName = targetDirectory + ".backup" + std::to_string(backupFileCount); } //Rename the file to its backup name so it is not overwritten diff --git a/indra/newview/llconversationmodel.cpp b/indra/newview/llconversationmodel.cpp index 9e043dbac0..f152e36cf5 100644 --- a/indra/newview/llconversationmodel.cpp +++ b/indra/newview/llconversationmodel.cpp @@ -37,8 +37,6 @@ #include "llimview.h" //For LLIMModel #include "lltrans.h" -#include <boost/foreach.hpp> - // // Conversation items : common behaviors // @@ -300,8 +298,7 @@ void LLConversationItemSession::updateName(LLConversationItemParticipant* partic // In the case of a P2P conversation, we need to grab the name of the other participant in the session instance itself // as we do not create participants for such a session. - LLFolderViewModelItem * itemp; - BOOST_FOREACH(itemp, mChildren) + for (auto itemp : mChildren) { LLConversationItem* current_participant = dynamic_cast<LLConversationItem*>(itemp); // Add the avatar uuid to the list (except if it's the own agent uuid) diff --git a/indra/newview/llexternaleditor.cpp b/indra/newview/llexternaleditor.cpp index b66eb754a4..b0d88159c1 100644 --- a/indra/newview/llexternaleditor.cpp +++ b/indra/newview/llexternaleditor.cpp @@ -32,7 +32,6 @@ #include "llprocess.h" #include "llsdutil.h" #include "llstring.h" -#include <boost/foreach.hpp> // static const std::string LLExternalEditor::sFilenameMarker = "%s"; @@ -93,7 +92,7 @@ LLExternalEditor::EErrorCode LLExternalEditor::run(const std::string& file_path) params.executable = mProcessParams.executable; // Substitute the filename marker in the command with the actual passed file name. - BOOST_FOREACH(const std::string& arg, mProcessParams.args) + for (const std::string& arg : mProcessParams.args) { std::string fixed(arg); LLStringUtil::replaceString(fixed, sFilenameMarker, file_path); diff --git a/indra/newview/llfloatercamera.cpp b/indra/newview/llfloatercamera.cpp index 1c69b9d60b..7985ce447f 100644 --- a/indra/newview/llfloatercamera.cpp +++ b/indra/newview/llfloatercamera.cpp @@ -44,6 +44,7 @@ #include "llfirstuse.h" #include "llhints.h" #include "lltabcontainer.h" +#include "llviewercamera.h" #include "llvoavatarself.h" static LLDefaultChildRegistry::Register<LLPanelCameraItem> r("panel_camera_item"); @@ -65,13 +66,19 @@ class LLPanelCameraZoom : public LLPanel { LOG_CLASS(LLPanelCameraZoom); + public: - LLPanelCameraZoom(); + struct Params : public LLInitParam::Block<Params, LLPanel::Params> {}; + + LLPanelCameraZoom() { onCreate(); } /* virtual */ BOOL postBuild(); /* virtual */ void draw(); protected: + LLPanelCameraZoom(const Params& p) { onCreate(); } + + void onCreate(); void onZoomPlusHeldDown(); void onZoomMinusHeldDown(); void onSliderValueChanged(); @@ -80,9 +87,11 @@ protected: F32 getOrbitRate(F32 time); private: - LLButton* mPlusBtn; - LLButton* mMinusBtn; - LLSlider* mSlider; + LLButton* mPlusBtn { nullptr }; + LLButton* mMinusBtn{ nullptr }; + LLSlider* mSlider{ nullptr }; + + friend class LLUICtrlFactory; }; LLPanelCameraItem::Params::Params() @@ -158,10 +167,7 @@ static LLPanelInjector<LLPanelCameraZoom> t_camera_zoom_panel("camera_zoom_panel // LLPanelCameraZoom //------------------------------------------------------------------------------- -LLPanelCameraZoom::LLPanelCameraZoom() -: mPlusBtn( NULL ), - mMinusBtn( NULL ), - mSlider( NULL ) +void LLPanelCameraZoom::onCreate() { mCommitCallbackRegistrar.add("Zoom.minus", boost::bind(&LLPanelCameraZoom::onZoomMinusHeldDown, this)); mCommitCallbackRegistrar.add("Zoom.plus", boost::bind(&LLPanelCameraZoom::onZoomPlusHeldDown, this)); @@ -172,9 +178,9 @@ LLPanelCameraZoom::LLPanelCameraZoom() BOOL LLPanelCameraZoom::postBuild() { - mPlusBtn = getChild <LLButton> ("zoom_plus_btn"); - mMinusBtn = getChild <LLButton> ("zoom_minus_btn"); - mSlider = getChild <LLSlider> ("zoom_slider"); + mPlusBtn = getChild<LLButton>("zoom_plus_btn"); + mMinusBtn = getChild<LLButton>("zoom_minus_btn"); + mSlider = getChild<LLSlider>("zoom_slider"); return LLPanel::postBuild(); } @@ -240,11 +246,80 @@ void activate_camera_tool() LLToolMgr::getInstance()->setTransientTool(LLToolCamera::getInstance()); }; +class LLCameraInfoPanel : public LLPanel +{ +public: + typedef std::function<LLVector3()> get_vector_t; + + LLCameraInfoPanel( + const LLView* parent, + const char* title, + const LLCoordFrame& camera, + const get_vector_t get_focus + ) + : LLPanel([&]() -> LLPanel::Params + { + LLPanel::Params params; + params.rect = LLRect(parent->getLocalRect()); + return params; + }()) + , mTitle(title) + , mCamera(camera) + , mGetFocus(get_focus) + , mFont(LLFontGL::getFontSansSerifBig()) + { + } + + virtual void draw() override + { + LLPanel::draw(); + + static const U32 HPADDING = 10; + static const U32 VPADDING = 5; + LLVector3 focus = mGetFocus(); + LLVector3 sight = focus - mCamera.mOrigin; + std::pair<const char*, const LLVector3&> const data[] = + { + { "Origin:", mCamera.mOrigin }, + { "X Axis:", mCamera.mXAxis }, + { "Y Axis:", mCamera.mYAxis }, + { "Z Axis:", mCamera.mZAxis }, + { "Focus:", focus }, + { "Sight:", sight } + }; + S32 width = getRect().getWidth(); + S32 height = getRect().getHeight(); + S32 row_count = 1 + sizeof(data) / sizeof(*data); + S32 row_height = (height - VPADDING * 2) / row_count; + S32 top = height - VPADDING - row_height / 2; + mFont->renderUTF8(mTitle, 0, HPADDING, top, LLColor4::white, LLFontGL::LEFT, LLFontGL::VCENTER); + for (const auto& row : data) + { + top -= row_height; + mFont->renderUTF8(row.first, 0, HPADDING, top, LLColor4::white, LLFontGL::LEFT, LLFontGL::VCENTER); + const LLVector3& vector = row.second; + for (S32 i = 0; i < 3; ++i) + { + std::string text = llformat("%.6f", vector[i]); + S32 right = width / 4 * (i + 2) - HPADDING; + mFont->renderUTF8(text, 0, right, top, LLColor4::white, LLFontGL::RIGHT, LLFontGL::VCENTER); + } + } + } + +private: + const char* mTitle; + const LLCoordFrame& mCamera; + const get_vector_t mGetFocus; + const LLFontGL* mFont; +}; + // // Member functions // -/*static*/ bool LLFloaterCamera::inFreeCameraMode() +// static +bool LLFloaterCamera::inFreeCameraMode() { LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); if (floater_camera && floater_camera->mCurrMode == CAMERA_CTRL_MODE_FREE_CAMERA && gAgentCamera.getCameraMode() != CAMERA_MODE_MOUSELOOK) @@ -254,6 +329,7 @@ void activate_camera_tool() return false; } +// static void LLFloaterCamera::resetCameraMode() { LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); @@ -261,6 +337,7 @@ void LLFloaterCamera::resetCameraMode() floater_camera->switchMode(CAMERA_CTRL_MODE_PAN); } +// static void LLFloaterCamera::onAvatarEditingAppearance(bool editing) { sAppearanceEditing = editing; @@ -269,15 +346,46 @@ void LLFloaterCamera::onAvatarEditingAppearance(bool editing) floater_camera->handleAvatarEditingAppearance(editing); } -void LLFloaterCamera::handleAvatarEditingAppearance(bool editing) +// static +void LLFloaterCamera::onDebugCameraToggled() { + if (LLFloaterCamera* instance = LLFloaterCamera::findInstance()) + { + instance->showDebugInfo(LLView::sDebugCamera); + } + if (LLView::sDebugCamera) + { + LLFloaterReg::showInstanceOrBringToFront("camera"); + } +} + +void LLFloaterCamera::showDebugInfo(bool show) +{ + // Initially LLPanel contains 1 child "view_border" + if (show && mViewerCameraInfo->getChildCount() < 2) + { + mViewerCameraInfo->addChild(new LLCameraInfoPanel(mViewerCameraInfo, "Viewer Camera", *LLViewerCamera::getInstance(), + []() { return LLViewerCamera::getInstance()->getPointOfInterest(); })); + mAgentCameraInfo->addChild(new LLCameraInfoPanel(mAgentCameraInfo, "Agent Camera", gAgent.getFrameAgent(), + []() { return gAgent.getPosAgentFromGlobal(gAgentCamera.calcFocusPositionTargetGlobal()); })); + } + + mAgentCameraInfo->setVisible(show); + mViewerCameraInfo->setVisible(show); +} + +void LLFloaterCamera::handleAvatarEditingAppearance(bool editing) +{ } void LLFloaterCamera::update() { ECameraControlMode mode = determineMode(); - if (mode != mCurrMode) setMode(mode); + if (mode != mCurrMode) + { + setMode(mode); + } } @@ -286,7 +394,8 @@ void LLFloaterCamera::toPrevMode() switchMode(mPrevMode); } -/*static*/ void LLFloaterCamera::onLeavingMouseLook() +// static +void LLFloaterCamera::onLeavingMouseLook() { LLFloaterCamera* floater_camera = LLFloaterCamera::findInstance(); if (floater_camera) @@ -320,12 +429,14 @@ void LLFloaterCamera::onOpen(const LLSD& key) mClosed = FALSE; populatePresetCombo(); + + showDebugInfo(LLView::sDebugCamera); } void LLFloaterCamera::onClose(bool app_quitting) { //We don't care of camera mode if app is quitting - if(app_quitting) + if (app_quitting) return; // It is necessary to reset mCurrMode to CAMERA_CTRL_MODE_PAN so // to avoid seeing an empty floater when reopening the control. @@ -360,14 +471,18 @@ BOOL LLFloaterCamera::postBuild() { updateTransparency(TT_ACTIVE); // force using active floater transparency (STORM-730) + mControls = getChild<LLPanel>("controls"); + mAgentCameraInfo = getChild<LLPanel>("agent_camera_info"); + mViewerCameraInfo = getChild<LLPanel>("viewer_camera_info"); mRotate = getChild<LLJoystickCameraRotate>(ORBIT); - mZoom = findChild<LLPanelCameraZoom>(ZOOM); + mZoom = getChild<LLPanelCameraZoom>(ZOOM); mTrack = getChild<LLJoystickCameraTrack>(PAN); mPresetCombo = getChild<LLComboBox>("preset_combo"); + mPreciseCtrls = getChild<LLTextBox>("precise_ctrs_label"); - getChild<LLTextBox>("precise_ctrs_label")->setShowCursorHand(false); - getChild<LLTextBox>("precise_ctrs_label")->setSoundFlags(LLView::MOUSE_UP); - getChild<LLTextBox>("precise_ctrs_label")->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE)); + mPreciseCtrls->setShowCursorHand(false); + mPreciseCtrls->setSoundFlags(LLView::MOUSE_UP); + mPreciseCtrls->setClickedCallback(boost::bind(&LLFloaterReg::showInstance, "prefs_view_advanced", LLSD(), FALSE)); mPresetCombo->setCommitCallback(boost::bind(&LLFloaterCamera::onCustomPresetSelected, this)); LLPresetsManager::getInstance()->setPresetListChangeCameraCallback(boost::bind(&LLFloaterCamera::populatePresetCombo, this)); @@ -507,6 +622,7 @@ void LLFloaterCamera::updateItemsSelection() getChild<LLPanelCameraItem>("object_view")->setValue(argument); } +// static void LLFloaterCamera::onClickCameraItem(const LLSD& param) { std::string name = param.asString(); @@ -533,7 +649,7 @@ void LLFloaterCamera::onClickCameraItem(const LLSD& param) } } -/*static*/ +// static void LLFloaterCamera::switchToPreset(const std::string& name) { sFreeCamera = false; diff --git a/indra/newview/llfloatercamera.h b/indra/newview/llfloatercamera.h index a69b87ad16..f31bc5486b 100644 --- a/indra/newview/llfloatercamera.h +++ b/indra/newview/llfloatercamera.h @@ -63,6 +63,9 @@ public: /** Called when Avatar is entered/exited editing appearance mode */ static void onAvatarEditingAppearance(bool editing); + /** Called when opening and when "Advanced | Debug Camera" menu item is toggled */ + static void onDebugCameraToggled(); + /* determines actual mode and updates ui */ void update(); @@ -77,9 +80,9 @@ public: void populatePresetCombo(); - LLJoystickCameraRotate* mRotate; - LLPanelCameraZoom* mZoom; - LLJoystickCameraTrack* mTrack; + LLJoystickCameraRotate* mRotate { nullptr }; + LLPanelCameraZoom* mZoom { nullptr }; + LLJoystickCameraTrack* mTrack { nullptr }; private: @@ -117,6 +120,8 @@ private: void handleAvatarEditingAppearance(bool editing); + void showDebugInfo(bool show); + // set to true when free camera mode is selected in modes list // remains true until preset camera mode is chosen, or pan button is clicked, or escape pressed static bool sFreeCamera; @@ -126,7 +131,11 @@ private: ECameraControlMode mCurrMode; std::map<ECameraControlMode, LLButton*> mMode2Button; - LLComboBox* mPresetCombo; + LLPanel* mControls { nullptr }; + LLPanel* mViewerCameraInfo { nullptr }; + LLPanel* mAgentCameraInfo { nullptr }; + LLComboBox* mPresetCombo { nullptr }; + LLTextBox* mPreciseCtrls { nullptr }; }; /** diff --git a/indra/newview/llfloatereditsky.cpp b/indra/newview/llfloatereditsky.cpp index 2d5e86869d..fa51143f3a 100644 --- a/indra/newview/llfloatereditsky.cpp +++ b/indra/newview/llfloatereditsky.cpp @@ -84,7 +84,7 @@ BOOL LLFloaterEditSky::postBuild() mSkyPresetCombo = getChild<LLComboBox>("sky_preset_combo"); mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb"); mSaveButton = getChild<LLButton>("save"); - mSkyAdapter = boost::make_shared<LLSkySettingsAdapter>(); + mSkyAdapter = std::make_shared<LLSkySettingsAdapter>(); LLEnvironment::instance().setSkyListChange(boost::bind(&LLFloaterEditSky::onSkyPresetListChange, this)); diff --git a/indra/newview/llfloatereditwater.cpp b/indra/newview/llfloatereditwater.cpp index c44ae7faca..4a6268435b 100644 --- a/indra/newview/llfloatereditwater.cpp +++ b/indra/newview/llfloatereditwater.cpp @@ -71,7 +71,7 @@ BOOL LLFloaterEditWater::postBuild() mMakeDefaultCheckBox = getChild<LLCheckBoxCtrl>("make_default_cb"); mSaveButton = getChild<LLButton>("save"); - mWaterAdapter = boost::make_shared<LLWatterSettingsAdapter>(); + mWaterAdapter = std::make_shared<LLWatterSettingsAdapter>(); LLEnvironment::instance().setWaterListChange(boost::bind(&LLFloaterEditWater::onWaterPresetListChange, this)); diff --git a/indra/newview/llfloaterimcontainer.cpp b/indra/newview/llfloaterimcontainer.cpp index 635aee64ff..44938d5509 100644 --- a/indra/newview/llfloaterimcontainer.cpp +++ b/indra/newview/llfloaterimcontainer.cpp @@ -57,7 +57,6 @@ #include "llsdserialize.h" #include "llviewermenu.h" // is_agent_mappable #include "llviewerobjectlist.h" -#include "boost/foreach.hpp" const S32 EVENTS_PER_IDLE_LOOP_CURRENT_SESSION = 80; @@ -805,12 +804,11 @@ void LLFloaterIMContainer::setVisible(BOOL visible) void LLFloaterIMContainer::getDetachedConversationFloaters(floater_list_t& floaters) { - typedef conversations_widgets_map::value_type conv_pair; LLFloaterIMNearbyChat *nearby_chat = LLFloaterReg::findTypedInstance<LLFloaterIMNearbyChat>("nearby_chat"); - BOOST_FOREACH(conv_pair item, mConversationsWidgets) + for (const auto& [key, fvi] : mConversationsWidgets) { - LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(item.second); + LLConversationViewSession* widget = dynamic_cast<LLConversationViewSession*>(fvi); if (widget) { LLFloater* session_floater = widget->getSessionFloater(); diff --git a/indra/newview/llfloaterimnearbychathandler.cpp b/indra/newview/llfloaterimnearbychathandler.cpp index 76bb10d149..e201417786 100644 --- a/indra/newview/llfloaterimnearbychathandler.cpp +++ b/indra/newview/llfloaterimnearbychathandler.cpp @@ -453,7 +453,7 @@ void LLFloaterIMNearbyChatScreenChannel::arrangeToasts() //----------------------------------------------------------------------------------------------- //LLFloaterIMNearbyChatHandler //----------------------------------------------------------------------------------------------- -boost::scoped_ptr<LLEventPump> LLFloaterIMNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat")); +std::unique_ptr<LLEventPump> LLFloaterIMNearbyChatHandler::sChatWatcher(new LLEventStream("LLChat")); LLFloaterIMNearbyChatHandler::LLFloaterIMNearbyChatHandler() { diff --git a/indra/newview/llfloaterimnearbychathandler.h b/indra/newview/llfloaterimnearbychathandler.h index 5e6f8cde30..1849604470 100644 --- a/indra/newview/llfloaterimnearbychathandler.h +++ b/indra/newview/llfloaterimnearbychathandler.h @@ -46,7 +46,7 @@ public: protected: virtual void initChannel(); - static boost::scoped_ptr<LLEventPump> sChatWatcher; + static std::unique_ptr<LLEventPump> sChatWatcher; }; } diff --git a/indra/newview/llfloaterinventorythumbnailshelper.cpp b/indra/newview/llfloaterinventorythumbnailshelper.cpp new file mode 100644 index 0000000000..814f88e9b9 --- /dev/null +++ b/indra/newview/llfloaterinventorythumbnailshelper.cpp @@ -0,0 +1,543 @@ +/** + * @file llfloaterinventorythumbnailshelper.cpp + * @author Callum Prentice + * @brief LLFloaterInventoryThumbnailsHelper class implementation + * + * Usage instructions and some brief notes can be found in Confluence here: + * https://lindenlab.atlassian.net/wiki/spaces/~174746736/pages/2928672843/Inventory+Thumbnail+Helper+Tool + * + * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#include "llviewerprecompiledheaders.h" + +#include "llaisapi.h" +#include "llclipboard.h" +#include "llinventoryfunctions.h" +#include "llinventorymodel.h" +#include "llnotifications.h" +#include "llnotificationsutil.h" +#include "llscrolllistctrl.h" +#include "lltexteditor.h" +#include "lluictrlfactory.h" +#include "lluuid.h" + +#include "llfloaterinventorythumbnailshelper.h" + +LLFloaterInventoryThumbnailsHelper::LLFloaterInventoryThumbnailsHelper(const LLSD& key) + : LLFloater("floater_inventory_thumbnails_helper") +{ +} + +LLFloaterInventoryThumbnailsHelper::~LLFloaterInventoryThumbnailsHelper() +{ +} + +BOOL LLFloaterInventoryThumbnailsHelper::postBuild() +{ + mInventoryThumbnailsList = getChild<LLScrollListCtrl>("inventory_thumbnails_list"); + mInventoryThumbnailsList->setAllowMultipleSelection(true); + + mOutputLog = getChild<LLTextEditor>("output_log"); + mOutputLog->setMaxTextLength(0xffff * 0x10); + + mPasteItemsBtn = getChild<LLUICtrl>("paste_items_btn"); + mPasteItemsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onPasteItems, this)); + mPasteItemsBtn->setEnabled(true); + + mPasteTexturesBtn = getChild<LLUICtrl>("paste_textures_btn"); + mPasteTexturesBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onPasteTextures, this)); + mPasteTexturesBtn->setEnabled(true); + + mWriteThumbnailsBtn = getChild<LLUICtrl>("write_thumbnails_btn"); + mWriteThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onWriteThumbnails, this)); + mWriteThumbnailsBtn->setEnabled(false); + + mLogMissingThumbnailsBtn = getChild<LLUICtrl>("log_missing_thumbnails_btn"); + mLogMissingThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onLogMissingThumbnails, this)); + mLogMissingThumbnailsBtn->setEnabled(false); + + mClearThumbnailsBtn = getChild<LLUICtrl>("clear_thumbnails_btn"); + mClearThumbnailsBtn->setCommitCallback(boost::bind(&LLFloaterInventoryThumbnailsHelper::onClearThumbnails, this)); + mClearThumbnailsBtn->setEnabled(false); + + return true; +} + +// Records an entry in the pasted items - saves it to a map and writes it to the log +// window for later confirmation/validation - since it uses a map, duplicates (based on +// the name) are discarded +void LLFloaterInventoryThumbnailsHelper::recordInventoryItemEntry(LLViewerInventoryItem* item) +{ + const std::string name = item->getName(); + + std::map<std::string, LLViewerInventoryItem*>::iterator iter = mItemNamesItems.find(name); + if (iter == mItemNamesItems.end()) + { + mItemNamesItems.insert({name, item}); + + writeToLog( + STRINGIZE( + "ITEM " << mItemNamesItems.size() << "> " << + name << + std::endl + ), false); + } + else + { + // dupe - do not save + } +} + +// Called when the user has copied items from their inventory and selects the Paste Items button +// in the UI - iterates over items and folders and saves details of each one. +// The first use of this tool is for updating NUX items and as such, only looks for OBJECTS, +// CLOTHING and BODYPARTS - later versions of this tool should make that selection editable. +void LLFloaterInventoryThumbnailsHelper::onPasteItems() +{ + if (!LLClipboard::instance().hasContents()) + { + return; + } + + writeToLog( + STRINGIZE( + "\n==== Pasting items from inventory ====" << + std::endl + ), false); + + std::vector<LLUUID> objects; + LLClipboard::instance().pasteFromClipboard(objects); + size_t count = objects.size(); + + for (size_t i = 0; i < count; i++) + { + const LLUUID& entry = objects.at(i); + + // Check for a folder + const LLInventoryCategory* cat = gInventory.getCategory(entry); + if (cat) + { + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + + LLIsType is_object(LLAssetType::AT_OBJECT); + gInventory.collectDescendentsIf(cat->getUUID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_object); + + LLIsType is_bodypart(LLAssetType::AT_BODYPART); + gInventory.collectDescendentsIf(cat->getUUID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_bodypart); + + LLIsType is_clothing(LLAssetType::AT_CLOTHING); + gInventory.collectDescendentsIf(cat->getUUID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_clothing); + + for (size_t i = 0; i < item_array.size(); i++) + { + LLViewerInventoryItem* item = item_array.at(i); + recordInventoryItemEntry(item); + } + } + + // Check for an item + LLViewerInventoryItem* item = gInventory.getItem(entry); + if (item) + { + const LLAssetType::EType item_type = item->getType(); + if (item_type == LLAssetType::AT_OBJECT || item_type == LLAssetType::AT_BODYPART || item_type == LLAssetType::AT_CLOTHING) + { + recordInventoryItemEntry(item); + } + } + } + + // update the main list view based on what we found + updateDisplayList(); + + // update the buttons enabled state based on what we found/saved + updateButtonStates(); +} + +// Records a entry in the pasted textures - saves it to a map and writes it to the log +// window for later confirmation/validation - since it uses a map, duplicates (based on +// the name) are discarded +void LLFloaterInventoryThumbnailsHelper::recordTextureItemEntry(LLViewerInventoryItem* item) +{ + const std::string name = item->getName(); + + std::map<std::string, LLUUID>::iterator iter = mTextureNamesIDs.find(name); + if (iter == mTextureNamesIDs.end()) + { + LLUUID id = item->getAssetUUID(); + mTextureNamesIDs.insert({name, id}); + + writeToLog( + STRINGIZE( + "TEXTURE " << mTextureNamesIDs.size() << "> " << + name << + //" | " << + //id.asString() << + std::endl + ), false); + } + else + { + // dupe - do not save + } +} + +// Called when the user has copied textures from their inventory and selects the Paste Textures +// button in the UI - iterates over textures and folders and saves details of each one. +void LLFloaterInventoryThumbnailsHelper::onPasteTextures() +{ + if (!LLClipboard::instance().hasContents()) + { + return; + } + + writeToLog( + STRINGIZE( + "\n==== Pasting textures from inventory ====" << + std::endl + ), false); + + std::vector<LLUUID> objects; + LLClipboard::instance().pasteFromClipboard(objects); + size_t count = objects.size(); + + for (size_t i = 0; i < count; i++) + { + const LLUUID& entry = objects.at(i); + + const LLInventoryCategory* cat = gInventory.getCategory(entry); + if (cat) + { + LLInventoryModel::cat_array_t cat_array; + LLInventoryModel::item_array_t item_array; + + LLIsType is_object(LLAssetType::AT_TEXTURE); + gInventory.collectDescendentsIf(cat->getUUID(), + cat_array, + item_array, + LLInventoryModel::EXCLUDE_TRASH, + is_object); + + for (size_t i = 0; i < item_array.size(); i++) + { + LLViewerInventoryItem* item = item_array.at(i); + recordTextureItemEntry(item); + } + } + + LLViewerInventoryItem* item = gInventory.getItem(entry); + if (item) + { + const LLAssetType::EType item_type = item->getType(); + if (item_type == LLAssetType::AT_TEXTURE) + { + recordTextureItemEntry(item); + } + } + } + + // update the main list view based on what we found + updateDisplayList(); + + // update the buttons enabled state based on what we found/saved + updateButtonStates(); +} + +// Updates the main list of entries in the UI based on what is in the maps/storage +void LLFloaterInventoryThumbnailsHelper::updateDisplayList() +{ + mInventoryThumbnailsList->deleteAllItems(); + + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + std::string item_name = (*item_iter).first; + + std::string existing_texture_name = std::string(); + LLUUID existing_thumbnail_id = (*item_iter).second->getThumbnailUUID(); + if (existing_thumbnail_id != LLUUID::null) + { + existing_texture_name = existing_thumbnail_id.asString(); + } + else + { + existing_texture_name = "none"; + } + + std::string new_texture_name = std::string(); + std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name); + if (texture_iter != mTextureNamesIDs.end()) + { + new_texture_name = (*texture_iter).first; + } + else + { + new_texture_name = "missing"; + } + + LLSD row; + row["columns"][EListColumnNum::NAME]["column"] = "item_name"; + row["columns"][EListColumnNum::NAME]["type"] = "text"; + row["columns"][EListColumnNum::NAME]["value"] = item_name; + row["columns"][EListColumnNum::NAME]["font"]["name"] = "Monospace"; + + row["columns"][EListColumnNum::EXISTING_TEXTURE]["column"] = "existing_texture"; + row["columns"][EListColumnNum::EXISTING_TEXTURE]["type"] = "text"; + row["columns"][EListColumnNum::EXISTING_TEXTURE]["font"]["name"] = "Monospace"; + row["columns"][EListColumnNum::EXISTING_TEXTURE]["value"] = existing_texture_name; + + row["columns"][EListColumnNum::NEW_TEXTURE]["column"] = "new_texture"; + row["columns"][EListColumnNum::NEW_TEXTURE]["type"] = "text"; + row["columns"][EListColumnNum::NEW_TEXTURE]["font"]["name"] = "Monospace"; + row["columns"][EListColumnNum::NEW_TEXTURE]["value"] = new_texture_name; + + mInventoryThumbnailsList->addElement(row); + + ++item_iter; + } +} + +#if 1 +// *TODO$: LLInventoryCallback should be deprecated to conform to the new boost::bind/coroutine model. +// temp code in transition +void inventoryThumbnailsHelperCb(LLPointer<LLInventoryCallback> cb, LLUUID id) +{ + if (cb.notNull()) + { + cb->fire(id); + } +} +#endif + +// Makes calls to the AIS v3 API to record the local changes made to the thumbnails. +// If this is not called, the operations (e.g. set thumbnail or clear thumbnail) +// appear to work but do not push the changes back to the inventory (local cache view only) +bool writeInventoryThumbnailID(LLUUID item_id, LLUUID thumbnail_asset_id) +{ + if (AISAPI::isAvailable()) + { + + LLSD updates; + updates["thumbnail"] = LLSD().with("asset_id", thumbnail_asset_id.asString()); + + LLPointer<LLInventoryCallback> cb; + + AISAPI::completion_t cr = boost::bind(&inventoryThumbnailsHelperCb, cb, _1); + AISAPI::UpdateItem(item_id, updates, cr); + + return true; + } + else + { + LL_WARNS() << "Unable to write inventory thumbnail because the AIS API is not available" << LL_ENDL; + return false; + } +} + +// Called when the Write Thumbanils button is pushed. Iterates over the name/item and +// name/.texture maps and where it finds a common name, extracts what is needed and +// writes the thumbnail accordingly. +void LLFloaterInventoryThumbnailsHelper::onWriteThumbnails() +{ + // create and show confirmation (Yes/No) textbox since this is a destructive operation + LLNotificationsUtil::add("WriteInventoryThumbnailsWarning", LLSD(), LLSD(), + [&](const LLSD & notif, const LLSD & resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + std::string item_name = (*item_iter).first; + + std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name); + if (texture_iter != mTextureNamesIDs.end()) + { + LLUUID item_id = (*item_iter).second->getUUID(); + + LLUUID thumbnail_asset_id = (*texture_iter).second; + + writeToLog( + STRINGIZE( + "WRITING THUMB " << + (*item_iter).first << + "\n" << + "item ID: " << + item_id << + "\n" << + "thumbnail texture ID: " << + thumbnail_asset_id << + "\n" + ), true); + + + (*item_iter).second->setThumbnailUUID(thumbnail_asset_id); + + // This additional step (notifying AIS API) is required + // to make the changes persist outside of the local cache + writeInventoryThumbnailID(item_id, thumbnail_asset_id); + } + + ++item_iter; + } + + updateDisplayList(); + } + else + { + LL_INFOS() << "Writing new thumbnails was canceled" << LL_ENDL; + } + }); +} + +// Called when the Log Items with Missing Thumbnails is selected. This merely writes +// a list of all the items for which the thumbnail ID is Null. Typical use case is to +// copy from the log window, pasted to Slack to illustrate which items are missing +// a thumbnail +void LLFloaterInventoryThumbnailsHelper::onLogMissingThumbnails() +{ + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + LLUUID thumbnail_id = (*item_iter).second->getThumbnailUUID(); + + if (thumbnail_id == LLUUID::null) + { + writeToLog( + STRINGIZE( + "Missing thumbnail: " << + (*item_iter).first << + std::endl + ), true); + } + + ++item_iter; + } +} + +// Called when the Clear Thumbnail button is selected. Code to perform the clear (really +// just writing a NULL UUID into the thumbnail field) is behind an "Are you Sure?" dialog +// since it cannot be undone and potentinally, you could remove the thumbnails from your +// whole inventory this way. +void LLFloaterInventoryThumbnailsHelper::onClearThumbnails() +{ + // create and show confirmation (Yes/No) textbox since this is a destructive operation + LLNotificationsUtil::add("ClearInventoryThumbnailsWarning", LLSD(), LLSD(), + [&](const LLSD & notif, const LLSD & resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + (*item_iter).second->setThumbnailUUID(LLUUID::null); + + // This additional step (notifying AIS API) is required + // to make the changes persist outside of the local cache + const LLUUID item_id = (*item_iter).second->getUUID(); + writeInventoryThumbnailID(item_id, LLUUID::null); + + ++item_iter; + } + + updateDisplayList(); + } + else + { + LL_INFOS() << "Clearing on thumbnails was canceled" << LL_ENDL; + } + }); +} + +// Update the endabled state of some of the UI buttons based on what has +// been recorded so far. For example, if there are no valid item/texture pairs, +// then the Write Thumbnails button is not enabled. +void LLFloaterInventoryThumbnailsHelper::updateButtonStates() +{ + size_t found_count = 0; + + std::map<std::string, LLViewerInventoryItem*>::iterator item_iter = mItemNamesItems.begin(); + while (item_iter != mItemNamesItems.end()) + { + std::string item_name = (*item_iter).first; + + std::map<std::string, LLUUID>::iterator texture_iter = mTextureNamesIDs.find(item_name); + if (texture_iter != mTextureNamesIDs.end()) + { + found_count++; + } + + ++item_iter; + } + + // the "Write Thumbnails" button is only enabled when there is at least one + // item with a matching texture ready to be written to the thumbnail field + if (found_count > 0) + { + mWriteThumbnailsBtn->setEnabled(true); + } + else + { + mWriteThumbnailsBtn->setEnabled(false); + } + + // The "Log Missing Items" and "Clear Thumbnails" buttons are only enabled + // when there is at least 1 item that was pasted from inventory (doesn't need + // to have a matching texture for these operations) + if (mItemNamesItems.size() > 0) + { + mLogMissingThumbnailsBtn->setEnabled(true); + mClearThumbnailsBtn->setEnabled(true); + } + else + { + mLogMissingThumbnailsBtn->setEnabled(false); + mClearThumbnailsBtn->setEnabled(false); + } +} + +// Helper function for writing a line to the log window. Currently the only additional +// feature is that it scrolls to the bottom each time a line is written but it +// is envisaged that other common actions will be added here eventually - E.G. write eavh +// line to the Second Life log too for example. +void LLFloaterInventoryThumbnailsHelper::writeToLog(std::string logline, bool prepend_newline) +{ + mOutputLog->appendText(logline, prepend_newline); + + mOutputLog->setCursorAndScrollToEnd(); +} diff --git a/indra/newview/llfloaterinventorythumbnailshelper.h b/indra/newview/llfloaterinventorythumbnailshelper.h new file mode 100644 index 0000000000..b42a85d1a5 --- /dev/null +++ b/indra/newview/llfloaterinventorythumbnailshelper.h @@ -0,0 +1,82 @@ +/** + * @file llfloaterinventorythumbnailshelper.h + * @author Callum Prentice + * @brief Helper floater for bulk processing of inventory thumbnails tool + * + * $LicenseInfo:firstyear=2008&license=viewerlgpl$ + * Second Life Viewer Source Code + * Copyright (C) 2010, Linden Research, Inc. + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; + * version 2.1 of the License only. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + * + * Linden Research, Inc., 945 Battery Street, San Francisco, CA 94111 USA + * $/LicenseInfo$ + */ + +#ifndef LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H +#define LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H + +#include "llfloater.h" +class LLTextEditor; +class LLScrollListCtrl; +class LLViewerInventoryItem; +class LLUUID; + +class LLFloaterInventoryThumbnailsHelper: + public LLFloater +{ + friend class LLFloaterReg; + private: + LLFloaterInventoryThumbnailsHelper(const LLSD& key); + BOOL postBuild() override; + ~LLFloaterInventoryThumbnailsHelper(); + + LLScrollListCtrl* mInventoryThumbnailsList; + + LLTextEditor* mOutputLog; + + LLUICtrl* mPasteItemsBtn; + void onPasteItems(); + + LLUICtrl* mPasteTexturesBtn; + void onPasteTextures(); + + LLUICtrl* mWriteThumbnailsBtn; + void onWriteThumbnails(); + + LLUICtrl* mLogMissingThumbnailsBtn; + void onLogMissingThumbnails(); + + LLUICtrl* mClearThumbnailsBtn; + void onClearThumbnails(); + + void recordInventoryItemEntry(LLViewerInventoryItem* item); + void recordTextureItemEntry(LLViewerInventoryItem* item); + void updateButtonStates(); + void updateDisplayList(); + void writeToLog(std::string logline, bool prepend_newline); + + std::map<std::string, LLViewerInventoryItem*> mItemNamesItems; + std::map<std::string, LLUUID> mTextureNamesIDs; + + enum EListColumnNum + { + NAME = 0, + EXISTING_TEXTURE = 1, + NEW_TEXTURE = 2 + }; +}; + +#endif // LL_LLFLOATERINVENTORYTHUMBNAILSHELPER_H diff --git a/indra/newview/llfloatermarketplacelistings.cpp b/indra/newview/llfloatermarketplacelistings.cpp index 71b3b16809..6216f4e39a 100644 --- a/indra/newview/llfloatermarketplacelistings.cpp +++ b/indra/newview/llfloatermarketplacelistings.cpp @@ -183,7 +183,8 @@ void LLPanelMarketplaceListings::draw() // Get the audit button enabled only after the whole inventory is fetched if (!mAuditBtn->getEnabled()) { - mAuditBtn->setEnabled(LLInventoryModelBackgroundFetch::instance().isEverythingFetched()); + LLInventoryModelBackgroundFetch* inst = LLInventoryModelBackgroundFetch::getInstance(); + mAuditBtn->setEnabled(inst->isEverythingFetched() && !inst->folderFetchActive()); } LLPanel::draw(); @@ -410,8 +411,14 @@ BOOL LLFloaterMarketplaceListings::postBuild() mCategoryAddedObserver = new LLMarketplaceListingsAddedObserver(this); gInventory.addObserver(mCategoryAddedObserver); - // Fetch aggressively so we can interact with listings right onOpen() - fetchContents(); + + // Fetch aggressively so we can interact with listings as soon as possible + if (!fetchContents()) + { + const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); + LLInventoryModelBackgroundFetch::instance().start(marketplacelistings_id, true); + } + return TRUE; } @@ -440,17 +447,19 @@ void LLFloaterMarketplaceListings::onFocusReceived() updateView(); } -void LLFloaterMarketplaceListings::fetchContents() +bool LLFloaterMarketplaceListings::fetchContents() { - if (mRootFolderId.notNull() && + if (mRootFolderId.notNull() && (LLMarketplaceData::instance().getSLMDataFetched() != MarketplaceFetchCodes::MARKET_FETCH_LOADING) && (LLMarketplaceData::instance().getSLMDataFetched() != MarketplaceFetchCodes::MARKET_FETCH_DONE)) - { + { LLMarketplaceData::instance().setDataFetchedSignal(boost::bind(&LLFloaterMarketplaceListings::updateView, this)); LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_LOADING); - LLInventoryModelBackgroundFetch::instance().start(mRootFolderId, true); + LLInventoryModelBackgroundFetch::instance().start(mRootFolderId, true); LLMarketplaceData::instance().getSLMListings(); - } + return true; + } + return false; } void LLFloaterMarketplaceListings::setRootFolder() diff --git a/indra/newview/llfloatermarketplacelistings.h b/indra/newview/llfloatermarketplacelistings.h index 085e517a9d..78d43f97a9 100644 --- a/indra/newview/llfloatermarketplacelistings.h +++ b/indra/newview/llfloatermarketplacelistings.h @@ -114,8 +114,8 @@ public: protected: void setRootFolder(); void setPanels(); - void fetchContents(); - + bool fetchContents(); + void setStatusString(const std::string& statusString); void onClose(bool app_quitting); diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp index 168106f1d2..96b3a669ce 100644 --- a/indra/newview/llfloaterpreference.cpp +++ b/indra/newview/llfloaterpreference.cpp @@ -1014,7 +1014,6 @@ void LLFloaterPreference::onBtnCancel(const LLSD& userdata) if (userdata.asString() == "closeadvanced") { LLFloaterReg::hideInstance("prefs_graphics_advanced"); - updateMaxComplexity(); } else { diff --git a/indra/newview/llfloateruipreview.cpp b/indra/newview/llfloateruipreview.cpp index db69c3e2c3..553d09bec2 100644 --- a/indra/newview/llfloateruipreview.cpp +++ b/indra/newview/llfloateruipreview.cpp @@ -158,7 +158,7 @@ public: // typedef std::map<std::string,std::pair<std::list<std::string>,std::list<std::string> > > DiffMap; // this version copies the lists etc., and thus is bad memory-wise typedef std::list<std::string> StringList; - typedef boost::shared_ptr<StringList> StringListPtr; + typedef std::shared_ptr<StringList> StringListPtr; typedef std::map<std::string, std::pair<StringListPtr,StringListPtr> > DiffMap; DiffMap mDiffsMap; // map, of filename to pair of list of changed element paths and list of errors diff --git a/indra/newview/llfloaterworldmap.cpp b/indra/newview/llfloaterworldmap.cpp index 5d72f8e3bf..14ff0da12f 100755 --- a/indra/newview/llfloaterworldmap.cpp +++ b/indra/newview/llfloaterworldmap.cpp @@ -315,6 +315,7 @@ void* LLFloaterWorldMap::createWorldMapView(void* data) BOOL LLFloaterWorldMap::postBuild() { mMapView = dynamic_cast<LLWorldMapView*>(getChild<LLPanel>("objects_mapview")); + mMapView->setPan(0, 0, true); LLComboBox *avatar_combo = getChild<LLComboBox>("friend combo"); avatar_combo->selectFirstItem(); diff --git a/indra/newview/llimview.cpp b/indra/newview/llimview.cpp index 17a28e84bb..03e7b6e4f5 100644 --- a/indra/newview/llimview.cpp +++ b/indra/newview/llimview.cpp @@ -3168,9 +3168,11 @@ void LLIMMgr::addMessage( // Fetch group chat history, enabled by default. if (gSavedPerAccountSettings.getBOOL("FetchGroupChatHistory")) { - std::string chat_url = gAgent.getRegion()->getCapability("ChatSessionRequest"); - LLCoros::instance().launch("chatterBoxHistoryCoro", - boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp)); + std::string chat_url = gAgent.getRegionCapability("ChatSessionRequest"); + if (!chat_url.empty()) + { + LLCoros::instance().launch("chatterBoxHistoryCoro", boost::bind(&chatterBoxHistoryCoro, chat_url, session_id, from, msg, timestamp)); + } } //Play sound for new conversations diff --git a/indra/newview/llinspecttexture.cpp b/indra/newview/llinspecttexture.cpp index da4e3c0949..76e428b7d0 100644 --- a/indra/newview/llinspecttexture.cpp +++ b/indra/newview/llinspecttexture.cpp @@ -84,7 +84,10 @@ LLToolTip* LLInspectTextureUtil::createInventoryToolTip(LLToolTip::Params p) } } } - + if ((!p.message.isProvided() || p.message().empty())) + { + return NULL; + } // No or more than one texture found => show default tooltip return LLUICtrlFactory::create<LLToolTip>(p); } diff --git a/indra/newview/llinventorybridge.cpp b/indra/newview/llinventorybridge.cpp index 988dffc8a5..4580fb7af4 100644 --- a/indra/newview/llinventorybridge.cpp +++ b/indra/newview/llinventorybridge.cpp @@ -2292,8 +2292,11 @@ BOOL LLFolderBridge::isItemMovable() const void LLFolderBridge::selectItem() { - // Have no fear: the first thing start() does is to test if everything for that folder has been fetched... - LLInventoryModelBackgroundFetch::instance().start(getUUID(), true); + LLViewerInventoryCategory* cat = gInventory.getCategory(getUUID()); + if (cat) + { + cat->fetch(); + } } void LLFolderBridge::buildDisplayName() const @@ -2789,7 +2792,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, is_movable = can_move_folder_to_marketplace(master_folder, dest_folder, inv_cat, tooltip_msg, bundle_size); } - if (is_movable) + if (is_movable && !move_is_into_landmarks) { LLInventoryPanel* active_panel = LLInventoryPanel::getActiveInventoryPanel(FALSE); is_movable = active_panel != NULL; @@ -3006,7 +3009,7 @@ BOOL LLFolderBridge::dragCategoryIntoFolder(LLInventoryCategory* inv_cat, return accept; } -void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> move_inv) +void warn_move_inventory(LLViewerObject* object, std::shared_ptr<LLMoveInv> move_inv) { const char* dialog = NULL; if (object->flagScripted()) @@ -3019,7 +3022,7 @@ void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> mo } static LLNotificationPtr notification_ptr; - static boost::shared_ptr<LLMoveInv> inv_ptr; + static std::shared_ptr<LLMoveInv> inv_ptr; // Notification blocks user from interacting with inventories so everything that comes after first message // is part of this message - don'r show it again @@ -3132,7 +3135,7 @@ BOOL move_inv_category_world_to_agent(const LLUUID& object_id, if(drop && accept) { it = inventory_objects.begin(); - boost::shared_ptr<LLMoveInv> move_inv(new LLMoveInv); + std::shared_ptr<LLMoveInv> move_inv(new LLMoveInv); move_inv->mObjectID = object_id; move_inv->mCategoryID = category_id; move_inv->mCallback = callback; @@ -5179,7 +5182,7 @@ LLFontGL::StyleFlags LLMarketplaceFolderBridge::getLabelStyle() const // helper stuff -bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr<LLMoveInv> move_inv) +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, std::shared_ptr<LLMoveInv> move_inv) { LLFloaterOpenObject::LLCatAndWear* cat_and_wear = (LLFloaterOpenObject::LLCatAndWear* )move_inv->mUserData; LLViewerObject* object = gObjectList.findObject(move_inv->mObjectID); @@ -5674,7 +5677,7 @@ BOOL LLFolderBridge::dragItemIntoFolder(LLInventoryItem* inv_item, if (accept && drop) { LLUUID item_id = inv_item->getUUID(); - boost::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); + std::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); move_inv->mObjectID = inv_item->getParentUUID(); two_uuids_t item_pair(mUUID, item_id); move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/llinventorybridge.h b/indra/newview/llinventorybridge.h index 8bdb76cdef..6fb7a56559 100644 --- a/indra/newview/llinventorybridge.h +++ b/indra/newview/llinventorybridge.h @@ -820,7 +820,7 @@ struct LLMoveInv void* mUserData; }; -void warn_move_inventory(LLViewerObject* object, boost::shared_ptr<LLMoveInv> move_inv); -bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, boost::shared_ptr<LLMoveInv>); +void warn_move_inventory(LLViewerObject* object, std::shared_ptr<LLMoveInv> move_inv); +bool move_task_inventory_callback(const LLSD& notification, const LLSD& response, std::shared_ptr<LLMoveInv>); #endif // LL_LLINVENTORYBRIDGE_H diff --git a/indra/newview/llinventoryfilter.cpp b/indra/newview/llinventoryfilter.cpp index 7b4283e94d..332c6d3085 100644 --- a/indra/newview/llinventoryfilter.cpp +++ b/indra/newview/llinventoryfilter.cpp @@ -202,12 +202,18 @@ bool LLInventoryFilter::checkFolder(const LLUUID& folder_id) const && !LLInventoryModelBackgroundFetch::instance().inventoryFetchInProgress()) { LLViewerInventoryCategory* cat = gInventory.getCategory(folder_id); - if ((!cat && folder_id.notNull()) || (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN)) + if ((!cat && folder_id.notNull())) { - // At the moment background fetch only cares about VERSION_UNKNOWN, - // so do not check isCategoryComplete that compares descendant count + // Shouldn't happen? Server provides full list of folders on startup LLInventoryModelBackgroundFetch::instance().start(folder_id, false); } + else if (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) + { + // At the moment background fetch only cares about VERSION_UNKNOWN, + // so do not check isCategoryComplete that compares descendant count, + // but if that is nesesary, do a forced scheduleFolderFetch. + cat->fetch(); + } } if (!checkAgainstFilterThumbnails(folder_id)) diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp index 8a15281e78..4173510cb9 100644 --- a/indra/newview/llinventoryfunctions.cpp +++ b/indra/newview/llinventoryfunctions.cpp @@ -91,8 +91,6 @@ #include "llvoavatarself.h" #include "llwearablelist.h" -#include <boost/foreach.hpp> - BOOL LLInventoryState::sWearNewClothing = FALSE; LLUUID LLInventoryState::sWearNewClothingTransactionID; std::list<LLUUID> LLInventoryAction::sMarketplaceFolders; @@ -462,6 +460,13 @@ void copy_inventory_category(LLInventoryModel* model, gInventory.createNewCategory(parent_id, LLFolderType::FT_NONE, cat->getName(), func, cat->getThumbnailUUID()); } +void copy_cb(const LLUUID& dest_folder, const LLUUID& root_id) +{ + // Decrement the count in root_id since that one item won't be copied over + LLMarketplaceData::instance().decrementValidationWaiting(root_id); + update_folder_cb(dest_folder); +}; + void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& root_copy_id, bool move_no_copy_items) { model->notifyObservers(); @@ -480,12 +485,21 @@ void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryMode LLMarketplaceData::instance().setValidationWaiting(root_id, count_descendants_items(cat->getUUID())); } + LLPointer<LLInventoryCallback> cb; + if (root_copy_id.isNull()) + { + cb = new LLBoostFuncInventoryCallback(boost::bind(copy_cb, new_cat_uuid, root_id)); + } + else + { + cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid)); + } + // Copy all the items LLInventoryModel::item_array_t item_array_copy = *item_array; for (LLInventoryModel::item_array_t::iterator iter = item_array_copy.begin(); iter != item_array_copy.end(); iter++) { LLInventoryItem* item = *iter; - LLPointer<LLInventoryCallback> cb = new LLBoostFuncInventoryCallback(boost::bind(update_folder_cb, new_cat_uuid)); if (item->getIsLinkType()) { @@ -500,8 +514,11 @@ void copy_inventory_category_content(const LLUUID& new_cat_uuid, LLInventoryMode LLViewerInventoryItem * viewer_inv_item = (LLViewerInventoryItem *)item; gInventory.changeItemParent(viewer_inv_item, new_cat_uuid, true); } - // Decrement the count in root_id since that one item won't be copied over - LLMarketplaceData::instance().decrementValidationWaiting(root_id); + if (root_copy_id.isNull()) + { + // Decrement the count in root_id since that one item won't be copied over + LLMarketplaceData::instance().decrementValidationWaiting(root_id); + } } else { @@ -3055,6 +3072,23 @@ bool get_selection_object_uuids(LLFolderView *root, uuid_vec_t& ids) void LLInventoryAction::doToSelected(LLInventoryModel* model, LLFolderView* root, const std::string& action, BOOL user_confirm) { std::set<LLFolderViewItem*> selected_items = root->getSelectionList(); + if (selected_items.empty() + && action != "wear" + && action != "wear_add" + && !isRemoveAction(action)) + { + // Was item removed while user was checking menu? + // "wear" and removal exlusions are due to use of + // getInventorySelectedUUIDs() below + LL_WARNS("Inventory") << "Menu tried to operate on empty selection" << LL_ENDL; + + if (("copy" == action) || ("cut" == action)) + { + LLClipboard::instance().reset(); + } + + return; + } // Prompt the user and check for authorization for some marketplace active listing edits if (user_confirm && (("delete" == action) || ("cut" == action) || ("rename" == action) || ("properties" == action) || ("task_properties" == action) || ("open" == action))) diff --git a/indra/newview/llinventorygallery.cpp b/indra/newview/llinventorygallery.cpp index 3c3da253d3..329c0d751a 100644 --- a/indra/newview/llinventorygallery.cpp +++ b/indra/newview/llinventorygallery.cpp @@ -2565,17 +2565,22 @@ void LLInventoryGallery::startDrag() } const LLViewerInventoryCategory* cat = gInventory.getCategory(selected_id); - if (cat && gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID()) - && !LLFolderType::lookupIsProtectedType((cat)->getPreferredType())) + if (cat) { - if (cat->getOwnerID() == ALEXANDRIA_LINDEN_ID) + if (gInventory.isObjectDescendentOf(selected_id, gInventory.getLibraryRootFolderID())) { src = LLToolDragAndDrop::SOURCE_LIBRARY; + EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType()); + types.push_back(type); + ids.push_back(selected_id); + } + else if (gInventory.isObjectDescendentOf(selected_id, gInventory.getRootFolderID()) + && !LLFolderType::lookupIsProtectedType((cat)->getPreferredType())) + { + EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType()); + types.push_back(type); + ids.push_back(selected_id); } - - EDragAndDropType type = LLViewerAssetType::lookupDragAndDropType(cat->getType()); - types.push_back(type); - ids.push_back(selected_id); } } LLToolDragAndDrop::getInstance()->beginMultiDrag(types, ids, src); @@ -3480,7 +3485,7 @@ BOOL dragItemIntoFolder(LLUUID folder_id, LLInventoryItem* inv_item, BOOL drop, if (accept && drop) { - boost::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); + std::shared_ptr<LLMoveInv> move_inv (new LLMoveInv()); move_inv->mObjectID = inv_item->getParentUUID(); std::pair<LLUUID, LLUUID> item_pair(folder_id, inv_item->getUUID()); move_inv->mMoveList.push_back(item_pair); diff --git a/indra/newview/llinventorymodel.cpp b/indra/newview/llinventorymodel.cpp index 10feb16346..35ee650618 100644 --- a/indra/newview/llinventorymodel.cpp +++ b/indra/newview/llinventorymodel.cpp @@ -3560,6 +3560,9 @@ void LLInventoryModel::processUpdateCreateInventoryItem(LLMessageSystem* msg, vo gInventoryCallbacks.fire(callback_id, item_id); + // Message system at the moment doesn't support Thumbnails and potential + // newer features so just rerequest whole item + // // todo: instead of unpacking message fully, // grab only an item_id, then fetch LLInventoryModelBackgroundFetch::instance().scheduleItemFetch(item_id, true); @@ -3922,19 +3925,22 @@ void LLInventoryModel::processBulkUpdateInventory(LLMessageSystem* msg, void**) for (cat_array_t::iterator cit = folders.begin(); cit != folders.end(); ++cit) { - gInventory.updateCategory(*cit); - - // Temporary workaround: just fetch the item using AIS to get missing fields. - // If this works fine we might want to extract ids only from the message - // then use AIS as a primary fetcher - LLInventoryModelBackgroundFetch::instance().scheduleFolderFetch((*cit)->getUUID(), true /*force, since it has changes*/); + gInventory.updateCategory(*cit); + if ((*cit)->getVersion() != LLViewerInventoryCategory::VERSION_UNKNOWN) + { + // Temporary workaround: just fetch the item using AIS to get missing fields. + // If this works fine we might want to extract 'ids only' from the message + // then use AIS as a primary fetcher + LLInventoryModelBackgroundFetch::instance().scheduleFolderFetch((*cit)->getUUID(), true /*force, since it has changes*/); + } + // else already called fetch() above } for (item_array_t::iterator iit = items.begin(); iit != items.end(); ++iit) { gInventory.updateItem(*iit); // Temporary workaround: just fetch the item using AIS to get missing fields. - // If this works fine we might want to extract ids only from the message + // If this works fine we might want to extract 'ids only' from the message // then use AIS as a primary fetcher LLInventoryModelBackgroundFetch::instance().scheduleItemFetch((*iit)->getUUID(), true); } diff --git a/indra/newview/llinventorymodelbackgroundfetch.cpp b/indra/newview/llinventorymodelbackgroundfetch.cpp index 1f410bea10..722447b5d7 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.cpp +++ b/indra/newview/llinventorymodelbackgroundfetch.cpp @@ -193,13 +193,16 @@ LLInventoryModelBackgroundFetch::LLInventoryModelBackgroundFetch(): mLastFetchCount(0), mFetchFolderCount(0), mAllRecursiveFoldersFetched(false), - mRecursiveInventoryFetchStarted(false), - mRecursiveLibraryFetchStarted(false), - mMinTimeBetweenFetches(0.3f) + mRecursiveInventoryFetchStarted(false), + mRecursiveLibraryFetchStarted(false), + mRecursiveMarketplaceFetchStarted(false), + mMinTimeBetweenFetches(0.3f) {} LLInventoryModelBackgroundFetch::~LLInventoryModelBackgroundFetch() -{} +{ + gIdleCallbacks.deleteFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); +} bool LLInventoryModelBackgroundFetch::isBulkFetchProcessingComplete() const { @@ -314,6 +317,23 @@ void LLInventoryModelBackgroundFetch::start(const LLUUID& id, bool recursive) gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); } } + else if (recursive && cat && cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS) + { + if (mFetchFolderQueue.empty() || mFetchFolderQueue.back().mUUID != id) + { + if (recursive && AISAPI::isAvailable()) + { + // Request marketplace folder and content separately + mFetchFolderQueue.push_front(FetchQueueInfo(id, FT_FOLDER_AND_CONTENT)); + } + else + { + mFetchFolderQueue.push_front(FetchQueueInfo(id, recursion_type)); + } + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); + mRecursiveMarketplaceFetchStarted = true; + } + } else { if (AISAPI::isAvailable()) @@ -359,8 +379,22 @@ void LLInventoryModelBackgroundFetch::scheduleFolderFetch(const LLUUID& cat_id, mBackgroundFetchActive = true; mFolderFetchActive = true; - // Specific folder requests go to front of queue. - mFetchFolderQueue.push_front(FetchQueueInfo(cat_id, forced ? FT_FORCED : FT_DEFAULT)); + if (forced) + { + // check if already requested + if (mForceFetchSet.find(cat_id) == mForceFetchSet.end()) + { + mForceFetchSet.insert(cat_id); + mFetchItemQueue.push_front(FetchQueueInfo(cat_id, FT_FORCED)); + } + } + else + { + // Specific folder requests go to front of queue. + // version presence acts as dupplicate prevention for normal fetches + mFetchItemQueue.push_front(FetchQueueInfo(cat_id, FT_DEFAULT)); + } + gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); } } @@ -370,8 +404,21 @@ void LLInventoryModelBackgroundFetch::scheduleItemFetch(const LLUUID& item_id, b if (mFetchItemQueue.empty() || mFetchItemQueue.front().mUUID != item_id) { mBackgroundFetchActive = true; + if (forced) + { + // check if already requested + if (mForceFetchSet.find(item_id) == mForceFetchSet.end()) + { + mForceFetchSet.insert(item_id); + mFetchItemQueue.push_front(FetchQueueInfo(item_id, FT_FORCED, false)); + } + } + else + { + // 'isFinished' being set acts as dupplicate prevention for normal fetches + mFetchItemQueue.push_front(FetchQueueInfo(item_id, FT_DEFAULT, false)); + } - mFetchItemQueue.push_front(FetchQueueInfo(item_id, forced ? FT_FORCED : FT_DEFAULT, false)); gIdleCallbacks.addFunction(&LLInventoryModelBackgroundFetch::backgroundFetchCB, NULL); } } @@ -591,6 +638,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i return; } + LLViewerInventoryCategory::EFetchType new_state = LLViewerInventoryCategory::FETCH_NONE; bool request_descendants = false; if (response_id.isNull()) // Failure { @@ -608,10 +656,12 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i // set folder's version to prevent viewer from trying to request folder indefinetely LLViewerInventoryCategory* cat(gInventory.getCategory(request_id)); - if (cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) + if (cat && cat->getVersion() == LLViewerInventoryCategory::VERSION_UNKNOWN) { cat->setVersion(0); } + // back off for a bit in case something tries to force-request immediately + new_state = LLViewerInventoryCategory::FETCH_FAILED; } } else @@ -664,7 +714,7 @@ void LLInventoryModelBackgroundFetch::onAISFolderCalback(const LLUUID &request_i LLViewerInventoryCategory * cat(gInventory.getCategory(request_id)); if (cat) { - cat->setFetching(LLViewerInventoryCategory::FETCH_NONE); + cat->setFetching(new_state); } } @@ -753,7 +803,26 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis() if (isFolderFetchProcessingComplete() && mFolderFetchActive) { - setAllFoldersFetched(); + if (!mRecursiveInventoryFetchStarted || mRecursiveMarketplaceFetchStarted) + { + setAllFoldersFetched(); + } + else + { + // Intent is for marketplace request to happen after + // main inventory is done, unless requested by floater + mRecursiveMarketplaceFetchStarted = true; + const LLUUID& marketplacelistings_id = gInventory.findCategoryUUIDForType(LLFolderType::FT_MARKETPLACE_LISTINGS); + if (marketplacelistings_id.notNull()) + { + mFetchFolderQueue.push_front(FetchQueueInfo(marketplacelistings_id, FT_FOLDER_AND_CONTENT)); + } + else + { + setAllFoldersFetched(); + } + } + } if (isBulkFetchProcessingComplete()) @@ -813,22 +882,8 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc if (child_cat->getPreferredType() == LLFolderType::FT_MARKETPLACE_LISTINGS) { - // special case - content_done = false; - if (children.empty()) - { - // fetch marketplace alone - // Should it actually be fetched as FT_FOLDER_AND_CONTENT? - children.push_back(child_cat->getUUID()); - mExpectedFolderIds.push_back(child_cat->getUUID()); - child_cat->setFetching(target_state); - break; - } - else - { - // fetch marketplace alone next run - continue; - } + // special case, marketplace will fetch that as needed + continue; } children.push_back(child_cat->getUUID()); @@ -902,10 +957,10 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc mExpectedFolderIds.push_back(cat_id); EFetchType type = fetch_info.mFetchType; - LLUUID cat_id = cat->getUUID(); - AISAPI::completion_t cb = [cat_id , type](const LLUUID& response_id) + LLUUID cat_cb_id = cat_id; + AISAPI::completion_t cb = [cat_cb_id, type](const LLUUID& response_id) { - LLInventoryModelBackgroundFetch::instance().onAISFolderCalback(cat_id , response_id , type); + LLInventoryModelBackgroundFetch::instance().onAISFolderCalback(cat_cb_id, response_id , type); }; AISAPI::ITEM_TYPE item_type = AISAPI::INVENTORY; @@ -964,6 +1019,11 @@ void LLInventoryModelBackgroundFetch::bulkFetchViaAis(const FetchQueueInfo& fetc AISAPI::FetchItem(fetch_info.mUUID, AISAPI::INVENTORY, ais_simple_item_callback); } } + + if (fetch_info.mFetchType == FT_FORCED) + { + mForceFetchSet.erase(fetch_info.mUUID); + } } // Bundle up a bunch of requests to send all at once. diff --git a/indra/newview/llinventorymodelbackgroundfetch.h b/indra/newview/llinventorymodelbackgroundfetch.h index a712fc7604..989968be53 100644 --- a/indra/newview/llinventorymodelbackgroundfetch.h +++ b/indra/newview/llinventorymodelbackgroundfetch.h @@ -76,7 +76,6 @@ public: void incrFetchFolderCount(S32 fetching); bool isBulkFetchProcessingComplete() const; - bool isFolderFetchProcessingComplete() const; void setAllFoldersFetched(); typedef boost::function<void()> folders_fetched_callback_t; @@ -86,6 +85,7 @@ public: void addRequestAtBack(const LLUUID & id, bool recursive, bool is_category); protected: + bool isFolderFetchProcessingComplete() const; typedef enum { FT_DEFAULT = 0, @@ -122,6 +122,7 @@ protected: private: bool mRecursiveInventoryFetchStarted; bool mRecursiveLibraryFetchStarted; + bool mRecursiveMarketplaceFetchStarted; // AIS3 specific bool mAllRecursiveFoldersFetched; typedef boost::signals2::signal<void()> folders_fetched_signal_t; folders_fetched_signal_t mFoldersFetchedSignal; @@ -136,6 +137,7 @@ private: F32 mMinTimeBetweenFetches; fetch_queue_t mFetchFolderQueue; fetch_queue_t mFetchItemQueue; + uuid_set_t mForceFetchSet; std::list<LLUUID> mExpectedFolderIds; // for debug, should this track time? }; diff --git a/indra/newview/llinventoryobserver.cpp b/indra/newview/llinventoryobserver.cpp index e1eaa18206..15cd7957a2 100644 --- a/indra/newview/llinventoryobserver.cpp +++ b/indra/newview/llinventoryobserver.cpp @@ -356,7 +356,6 @@ void LLInventoryFetchItemsObserver::startFetch() { // Start fetching whole folder since we need all items LLInventoryModelBackgroundFetch::getInstance()->scheduleFolderFetch(folder.first, true); - } else { diff --git a/indra/newview/lllogchat.cpp b/indra/newview/lllogchat.cpp index 5f3ad7c58f..9774f75fa6 100644 --- a/indra/newview/lllogchat.cpp +++ b/indra/newview/lllogchat.cpp @@ -42,7 +42,6 @@ #include <boost/algorithm/string/trim.hpp> #include <boost/algorithm/string/replace.hpp> #include <boost/regex.hpp> -#include <boost/foreach.hpp> #if LL_MSVC #pragma warning(push) @@ -730,7 +729,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory, std::string backupFileName; unsigned backupFileCount; - BOOST_FOREACH(const std::string& fullpath, listOfFilesToMove) + for (const std::string& fullpath : listOfFilesToMove) { backupFileCount = 0; newFullPath = targetDirectory + fullpath.substr(originDirectory.length(), std::string::npos); @@ -744,7 +743,7 @@ bool LLLogChat::moveTranscripts(const std::string originDirectory, while(LLFile::isfile(backupFileName)) { ++backupFileCount; - backupFileName = newFullPath + ".backup" + boost::lexical_cast<std::string>(backupFileCount); + backupFileName = newFullPath + ".backup" + std::to_string(backupFileCount); } //Rename the file to its backup name so it is not overwritten @@ -801,7 +800,7 @@ void LLLogChat::deleteTranscripts() getListOfTranscriptFiles(list_of_transcriptions); getListOfTranscriptBackupFiles(list_of_transcriptions); - BOOST_FOREACH(const std::string& fullpath, list_of_transcriptions) + for (const std::string& fullpath : list_of_transcriptions) { S32 retry_count = 0; while (retry_count < 5) diff --git a/indra/newview/lllogininstance.h b/indra/newview/lllogininstance.h index 2e9aab7c00..74d6890d1d 100644 --- a/indra/newview/lllogininstance.h +++ b/indra/newview/lllogininstance.h @@ -90,7 +90,7 @@ private: void attemptComplete() { mAttemptComplete = true; } // In the future an event? - boost::scoped_ptr<LLLogin> mLoginModule; + std::unique_ptr<LLLogin> mLoginModule; LLNotificationsInterface* mNotifications; std::string mLoginState; diff --git a/indra/newview/llmachineid.cpp b/indra/newview/llmachineid.cpp index 583742f970..1f4418f119 100644 --- a/indra/newview/llmachineid.cpp +++ b/indra/newview/llmachineid.cpp @@ -85,11 +85,11 @@ void LLWMIMethods::initCOMObjects() // Step 1: -------------------------------------------------- // Initialize COM. ------------------------------------------ - mHR = CoInitializeEx(0, COINIT_MULTITHREADED); + mHR = CoInitializeEx(0, COINIT_APARTMENTTHREADED); if (FAILED(mHR)) { + // if result S_FALSE, it's already initialized LL_DEBUGS("AppInit") << "Failed to initialize COM library. Error code = 0x" << std::hex << mHR << LL_ENDL; - return; } // Step 2: -------------------------------------------------- diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp index 8784f403cb..d27ee941a6 100644 --- a/indra/newview/llmarketplacefunctions.cpp +++ b/indra/newview/llmarketplacefunctions.cpp @@ -611,27 +611,17 @@ private: static void onIdleProcessQueue(void *userdata); // doesn't hold just marketplace related ids - static std::set<LLUUID> sAddQueue; static std::set<LLUUID> sStructureQueue; static bool sProcessingQueue; }; -std::set<LLUUID> LLMarketplaceInventoryObserver::sAddQueue; std::set<LLUUID> LLMarketplaceInventoryObserver::sStructureQueue; bool LLMarketplaceInventoryObserver::sProcessingQueue = false; void LLMarketplaceInventoryObserver::changed(U32 mask) { - if (mask & LLInventoryObserver::ADD && LLMarketplaceData::instance().hasValidationWaiting()) - { - // When things are added to the marketplace, we might need to re-validate and fix the containing listings - // just add whole list even if it contains items and non-marketplace folders - const std::set<LLUUID>& changed_items = gInventory.getChangedIDs(); - sAddQueue.insert(changed_items.begin(), changed_items.end()); - } - - if (mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE)) - { + if (mask & (LLInventoryObserver::INTERNAL | LLInventoryObserver::STRUCTURE)) + { // When things are changed in the inventory, this can trigger a host of changes in the marketplace listings folder: // * stock counts changing : no copy items coming in and out will change the stock count on folders // * version and listing folders : moving those might invalidate the marketplace data itself @@ -641,7 +631,7 @@ void LLMarketplaceInventoryObserver::changed(U32 mask) sStructureQueue.insert(changed_items.begin(), changed_items.end()); } - if (!sProcessingQueue && (!sAddQueue.empty() || !sStructureQueue.empty())) + if (!sProcessingQueue && !sStructureQueue.empty()) { gIdleCallbacks.addFunction(onIdleProcessQueue, NULL); // can do without sProcessingQueue, but it's usufull for simplicity and reliability @@ -655,40 +645,6 @@ void LLMarketplaceInventoryObserver::onIdleProcessQueue(void *userdata) const U64 MAX_PROCESSING_TIME = 1000; U64 stop_time = start_time + MAX_PROCESSING_TIME; - if (!sAddQueue.empty()) - { - // Make a copy of sAddQueue since decrementValidationWaiting - // can theoretically add more items - std::set<LLUUID> add_queue(sAddQueue); - sAddQueue.clear(); - - std::set<LLUUID>::const_iterator id_it = add_queue.begin(); - std::set<LLUUID>::const_iterator id_end = add_queue.end(); - // First, count the number of items in this list... - S32 count = 0; - for (; id_it != id_end; ++id_it) - { - LLInventoryObject* obj = gInventory.getObject(*id_it); - if (obj && (LLAssetType::AT_CATEGORY != obj->getType())) - { - count++; - } - } - // Then, decrement the folders of that amount - // Note that of all of those, only one folder will be a listing folder (if at all). - // The other will be ignored by the decrement method. - id_it = add_queue.begin(); - for (; id_it != id_end; ++id_it) - { - LLInventoryObject* obj = gInventory.getObject(*id_it); - if (obj && (LLAssetType::AT_CATEGORY == obj->getType())) - { - // can trigger notifyObservers - LLMarketplaceData::instance().decrementValidationWaiting(obj->getUUID(), count); - } - } - } - while (!sStructureQueue.empty() && LLTimer::getTotalTime() < stop_time) { std::set<LLUUID>::const_iterator id_it = sStructureQueue.begin(); @@ -722,7 +678,7 @@ void LLMarketplaceInventoryObserver::onIdleProcessQueue(void *userdata) sStructureQueue.erase(id_it); } - if (LLApp::isExiting() || (sAddQueue.empty() && sStructureQueue.empty())) + if (LLApp::isExiting() || sStructureQueue.empty()) { // Nothing to do anymore gIdleCallbacks.deleteFunction(onIdleProcessQueue, NULL); diff --git a/indra/newview/llmarketplacenotifications.cpp b/indra/newview/llmarketplacenotifications.cpp index 0886f9a990..02bd9e1f34 100644 --- a/indra/newview/llmarketplacenotifications.cpp +++ b/indra/newview/llmarketplacenotifications.cpp @@ -33,7 +33,6 @@ #include "llerror.h" -#include <boost/foreach.hpp> #include <boost/signals2.hpp> @@ -54,7 +53,7 @@ namespace LLMarketplaceInventoryNotifications llassert(!no_copy_payloads.empty()); llassert(no_copy_cb_action != NULL); - BOOST_FOREACH(const LLSD& payload, no_copy_payloads) + for (const LLSD& payload : no_copy_payloads) { (*no_copy_cb_action)(payload); } diff --git a/indra/newview/llmaterialmgr.cpp b/indra/newview/llmaterialmgr.cpp index 3b59b2f05e..577ab0048f 100644 --- a/indra/newview/llmaterialmgr.cpp +++ b/indra/newview/llmaterialmgr.cpp @@ -68,7 +68,7 @@ class LLMaterialHttpHandler : public LLHttpSDHandler { public: typedef boost::function<void(bool, const LLSD&)> CallbackFunction; - typedef boost::shared_ptr<LLMaterialHttpHandler> ptr_t; + typedef std::shared_ptr<LLMaterialHttpHandler> ptr_t; LLMaterialHttpHandler(const std::string& method, CallbackFunction cback); diff --git a/indra/newview/llmediadataclient.h b/indra/newview/llmediadataclient.h index 58f8bad3e4..8cd4793106 100644 --- a/indra/newview/llmediadataclient.h +++ b/indra/newview/llmediadataclient.h @@ -116,10 +116,10 @@ protected: // Request (pure virtual base class for requests in the queue) class Request: - public boost::enable_shared_from_this<Request> + public std::enable_shared_from_this<Request> { public: - typedef boost::shared_ptr<Request> ptr_t; + typedef std::shared_ptr<Request> ptr_t; // Subclasses must implement this to build a payload for their request type. virtual LLSD getPayload() const = 0; diff --git a/indra/newview/llmeshrepository.cpp b/indra/newview/llmeshrepository.cpp index 48fd946a21..a5601dafbe 100644 --- a/indra/newview/llmeshrepository.cpp +++ b/indra/newview/llmeshrepository.cpp @@ -411,7 +411,7 @@ namespace { static S32 dump_num = 0; std::string make_dump_name(std::string prefix, S32 num) { - return prefix + boost::lexical_cast<std::string>(num) + std::string(".xml"); + return prefix + std::to_string(num) + std::string(".xml"); } void dump_llsd_to_file(const LLSD& content, std::string filename); LLSD llsd_from_file(std::string filename); @@ -572,10 +572,10 @@ S32 LLMeshRepoThread::sRequestWaterLevel = 0; // LLMeshUploadThread class LLMeshHandlerBase : public LLCore::HttpHandler, - public boost::enable_shared_from_this<LLMeshHandlerBase> + public std::enable_shared_from_this<LLMeshHandlerBase> { public: - typedef boost::shared_ptr<LLMeshHandlerBase> ptr_t; + typedef std::shared_ptr<LLMeshHandlerBase> ptr_t; LOG_CLASS(LLMeshHandlerBase); LLMeshHandlerBase(U32 offset, U32 requested_bytes) diff --git a/indra/newview/llmodelpreview.cpp b/indra/newview/llmodelpreview.cpp index ddfaa9b23f..dba6e1ff46 100644 --- a/indra/newview/llmodelpreview.cpp +++ b/indra/newview/llmodelpreview.cpp @@ -220,6 +220,16 @@ LLModelPreview::~LLModelPreview() mPreviewAvatar->markDead(); mPreviewAvatar = NULL; } + + mUploadData.clear(); + mTextureSet.clear(); + + for (U32 i = 0; i < LLModel::NUM_LODS; i++) + { + clearModel(i); + } + mBaseModel.clear(); + mBaseScene.clear(); } void LLModelPreview::updateDimentionsAndOffsets() diff --git a/indra/newview/llmodelpreview.h b/indra/newview/llmodelpreview.h index f68cec4441..a62c3a5ab0 100644 --- a/indra/newview/llmodelpreview.h +++ b/indra/newview/llmodelpreview.h @@ -310,7 +310,6 @@ protected: vv_LLVolumeFace_t mBaseModelFacesCopy; U32 mGroup; - std::map<LLPointer<LLModel>, U32> mObject; // Amount of triangles in original(base) model U32 mMaxTriangleLimit; diff --git a/indra/newview/llnotificationmanager.cpp b/indra/newview/llnotificationmanager.cpp index b06131cf38..3f6a86106a 100644 --- a/indra/newview/llnotificationmanager.cpp +++ b/indra/newview/llnotificationmanager.cpp @@ -34,9 +34,6 @@ #include "llfloaterimnearbychathandler.h" #include "llnotifications.h" -#include <boost/bind.hpp> -#include <boost/foreach.hpp> - using namespace LLNotificationsUI; //-------------------------------------------------------------------------- @@ -53,15 +50,15 @@ LLNotificationManager::~LLNotificationManager() //-------------------------------------------------------------------------- void LLNotificationManager::init() { - mChannels.push_back(new LLScriptHandler()); - mChannels.push_back(new LLTipHandler()); - mChannels.push_back(new LLGroupHandler()); - mChannels.push_back(new LLAlertHandler("Alerts", "alert", false)); - mChannels.push_back(new LLAlertHandler("AlertModal", "alertmodal", true)); - mChannels.push_back(new LLOfferHandler()); - mChannels.push_back(new LLHintHandler()); - mChannels.push_back(new LLBrowserNotification()); - mChannels.push_back(new LLIMHandler()); + mChannels.emplace_back(new LLScriptHandler()); + mChannels.emplace_back(new LLTipHandler()); + mChannels.emplace_back(new LLGroupHandler()); + mChannels.emplace_back(new LLAlertHandler("Alerts", "alert", false)); + mChannels.emplace_back(new LLAlertHandler("AlertModal", "alertmodal", true)); + mChannels.emplace_back(new LLOfferHandler()); + mChannels.emplace_back(new LLHintHandler()); + mChannels.emplace_back(new LLBrowserNotification()); + mChannels.emplace_back(new LLIMHandler()); mChatHandler = std::shared_ptr<LLFloaterIMNearbyChatHandler>(new LLFloaterIMNearbyChatHandler()); } diff --git a/indra/newview/lloutfitgallery.cpp b/indra/newview/lloutfitgallery.cpp index 65ec38a41d..efffcefc4a 100644 --- a/indra/newview/lloutfitgallery.cpp +++ b/indra/newview/lloutfitgallery.cpp @@ -28,8 +28,6 @@ #include "llviewerprecompiledheaders.h" // must be first include #include "lloutfitgallery.h" -#include <boost/foreach.hpp> - // llcommon #include "llcommonutils.h" #include "llfilesystem.h" @@ -1151,22 +1149,13 @@ LLContextMenu* LLOutfitGalleryContextMenu::createMenu() registrar.add("Outfit.Delete", boost::bind(LLOutfitGallery::onRemoveOutfit, selected_id)); registrar.add("Outfit.Create", boost::bind(&LLOutfitGalleryContextMenu::onCreate, this, _2)); registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitGalleryContextMenu::onThumbnail, this, selected_id)); + registrar.add("Outfit.Save", boost::bind(&LLOutfitGalleryContextMenu::onSave, this, selected_id)); enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitGalleryContextMenu::onEnable, this, _2)); enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitGalleryContextMenu::onVisible, this, _2)); return createFromFile("menu_gallery_outfit_tab.xml"); } -void LLOutfitGalleryContextMenu::onThumbnail(const LLUUID& outfit_cat_id) -{ - LLOutfitGallery* gallery = dynamic_cast<LLOutfitGallery*>(mOutfitList); - if (gallery && outfit_cat_id.notNull()) - { - LLSD data(outfit_cat_id); - LLFloaterReg::showInstance("change_item_thumbnail", data); - } -} - void LLOutfitGalleryContextMenu::onCreate(const LLSD& data) { LLWearableType::EType type = LLWearableType::getInstance()->typeNameToType(data.asString()); @@ -1201,7 +1190,6 @@ void LLOutfitGalleryGearMenu::onUpdateItemsVisibility() mMenu->setItemVisible("expand", FALSE); mMenu->setItemVisible("collapse", FALSE); mMenu->setItemVisible("thumbnail", have_selection); - mMenu->setItemVisible("sepatator3", TRUE); mMenu->setItemVisible("sort_folders_by_name", TRUE); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } @@ -1249,7 +1237,7 @@ void LLOutfitGallery::refreshOutfit(const LLUUID& category_id) sub_cat_array, outfit_item_array, LLInventoryModel::EXCLUDE_TRASH); - BOOST_FOREACH(LLViewerInventoryItem* outfit_item, outfit_item_array) + for (LLViewerInventoryItem* outfit_item : outfit_item_array) { LLViewerInventoryItem* linked_item = outfit_item->getLinkedItem(); LLUUID asset_id, inv_id; diff --git a/indra/newview/lloutfitgallery.h b/indra/newview/lloutfitgallery.h index f2366e6494..99371b1cec 100644 --- a/indra/newview/lloutfitgallery.h +++ b/indra/newview/lloutfitgallery.h @@ -193,17 +193,13 @@ public: friend class LLOutfitGallery; LLOutfitGalleryContextMenu(LLOutfitListBase* outfit_list) - : LLOutfitContextMenu(outfit_list), - mOutfitList(outfit_list){} + : LLOutfitContextMenu(outfit_list){} protected: /* virtual */ LLContextMenu* createMenu(); bool onEnable(LLSD::String param); bool onVisible(LLSD::String param); - void onThumbnail(const LLUUID& outfit_cat_id); void onCreate(const LLSD& data); -private: - LLOutfitListBase* mOutfitList; }; diff --git a/indra/newview/lloutfitslist.cpp b/indra/newview/lloutfitslist.cpp index 352d59a9c2..d6d222153c 100644 --- a/indra/newview/lloutfitslist.cpp +++ b/indra/newview/lloutfitslist.cpp @@ -37,6 +37,7 @@ #include "llappearancemgr.h" #include "llfloaterreg.h" #include "llfloatersidepanelcontainer.h" +#include "llinspecttexture.h" #include "llinventoryfunctions.h" #include "llinventorymodel.h" #include "llmenubutton.h" @@ -62,7 +63,7 @@ bool LLOutfitTabNameComparator::compare(const LLAccordionCtrlTab* tab1, const LL return (LLStringUtil::compareDict(name1, name2) < 0); } -struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLAccordionCtrlTab::Params> +struct outfit_accordion_tab_params : public LLInitParam::Block<outfit_accordion_tab_params, LLOutfitAccordionCtrlTab::Params> { Mandatory<LLWearableItemsList::Params> wearable_list; @@ -144,7 +145,8 @@ void LLOutfitsList::updateAddedCategory(LLUUID cat_id) std::string name = cat->getName(); outfit_accordion_tab_params tab_params(get_accordion_tab_params()); - LLAccordionCtrlTab* tab = LLUICtrlFactory::create<LLAccordionCtrlTab>(tab_params); + tab_params.cat_id = cat_id; + LLOutfitAccordionCtrlTab *tab = LLUICtrlFactory::create<LLOutfitAccordionCtrlTab>(tab_params); if (!tab) return; LLWearableItemsList* wearable_list = LLUICtrlFactory::create<LLWearableItemsList>(tab_params.wearable_list); wearable_list->setShape(tab->getLocalRect()); @@ -1064,6 +1066,8 @@ LLContextMenu* LLOutfitContextMenu::createMenu() registrar.add("Outfit.Edit", boost::bind(editOutfit)); registrar.add("Outfit.Rename", boost::bind(renameOutfit, selected_id)); registrar.add("Outfit.Delete", boost::bind(&LLOutfitListBase::removeSelected, mOutfitList)); + registrar.add("Outfit.Thumbnail", boost::bind(&LLOutfitContextMenu::onThumbnail, this, selected_id)); + registrar.add("Outfit.Save", boost::bind(&LLOutfitContextMenu::onSave, this, selected_id)); enable_registrar.add("Outfit.OnEnable", boost::bind(&LLOutfitContextMenu::onEnable, this, _2)); enable_registrar.add("Outfit.OnVisible", boost::bind(&LLOutfitContextMenu::onVisible, this, _2)); @@ -1128,6 +1132,31 @@ void LLOutfitContextMenu::renameOutfit(const LLUUID& outfit_cat_id) LLAppearanceMgr::instance().renameOutfit(outfit_cat_id); } +void LLOutfitContextMenu::onThumbnail(const LLUUID &outfit_cat_id) +{ + if (outfit_cat_id.notNull()) + { + LLSD data(outfit_cat_id); + LLFloaterReg::showInstance("change_item_thumbnail", data); + } +} + +void LLOutfitContextMenu::onSave(const LLUUID &outfit_cat_id) +{ + if (outfit_cat_id.notNull()) + { + LLNotificationsUtil::add("ConfirmOverwriteOutfit", LLSD(), LLSD(), + [outfit_cat_id](const LLSD ¬if, const LLSD &resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + LLAppearanceMgr::getInstance()->onOutfitFolderCreated(outfit_cat_id, true); + } + }); + } +} + LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist) : mOutfitList(olist), mMenu(NULL) @@ -1146,6 +1175,7 @@ LLOutfitListGearMenuBase::LLOutfitListGearMenuBase(LLOutfitListBase* olist) registrar.add("Gear.Expand", boost::bind(&LLOutfitListBase::onExpandAllFolders, mOutfitList)); registrar.add("Gear.WearAdd", boost::bind(&LLOutfitListGearMenuBase::onAdd, this)); + registrar.add("Gear.Save", boost::bind(&LLOutfitListGearMenuBase::onSave, this)); registrar.add("Gear.Thumbnail", boost::bind(&LLOutfitListGearMenuBase::onThumbnail, this)); registrar.add("Gear.SortByName", boost::bind(&LLOutfitListGearMenuBase::onChangeSortOrder, this)); @@ -1171,8 +1201,7 @@ void LLOutfitListGearMenuBase::onUpdateItemsVisibility() if (!mMenu) return; bool have_selection = getSelectedOutfitID().notNull(); - mMenu->setItemVisible("sepatator1", have_selection); - mMenu->setItemVisible("sepatator2", have_selection); + mMenu->setItemVisible("wear_separator", have_selection); mMenu->arrangeAndClear(); // update menu height } @@ -1217,6 +1246,20 @@ void LLOutfitListGearMenuBase::onAdd() } } +void LLOutfitListGearMenuBase::onSave() +{ + const LLUUID &selected_id = getSelectedOutfitID(); + LLNotificationsUtil::add("ConfirmOverwriteOutfit", LLSD(), LLSD(), + [selected_id](const LLSD ¬if, const LLSD &resp) + { + S32 opt = LLNotificationsUtil::getSelectedOption(notif, resp); + if (opt == 0) + { + LLAppearanceMgr::getInstance()->onOutfitFolderCreated(selected_id, true); + } + }); +} + void LLOutfitListGearMenuBase::onTakeOff() { // Take off selected outfit. @@ -1270,15 +1313,6 @@ bool LLOutfitListGearMenuBase::onVisible(LLSD::String param) return false; } - // *TODO This condition leads to menu item behavior inconsistent with - // "Wear" button behavior and should be modified or removed. - bool is_worn = LLAppearanceMgr::instance().getBaseOutfitUUID() == selected_outfit_id; - - if ("wear" == param) - { - return !is_worn; - } - return true; } @@ -1306,10 +1340,29 @@ void LLOutfitListGearMenu::onUpdateItemsVisibility() if (!mMenu) return; mMenu->setItemVisible("expand", TRUE); mMenu->setItemVisible("collapse", TRUE); - mMenu->setItemVisible("thumbnail", FALSE); // Never visible? - mMenu->setItemVisible("sepatator3", FALSE); + mMenu->setItemVisible("thumbnail", getSelectedOutfitID().notNull()); mMenu->setItemVisible("sort_folders_by_name", FALSE); LLOutfitListGearMenuBase::onUpdateItemsVisibility(); } +BOOL LLOutfitAccordionCtrlTab::handleToolTip(S32 x, S32 y, MASK mask) +{ + if (y >= getLocalRect().getHeight() - getHeaderHeight()) + { + LLSD params; + params["inv_type"] = LLInventoryType::IT_CATEGORY; + params["thumbnail_id"] = gInventory.getCategory(mFolderID)->getThumbnailUUID(); + params["item_id"] = mFolderID; + + LLToolTipMgr::instance().show(LLToolTip::Params() + .message(getToolTip()) + .sticky_rect(calcScreenRect()) + .delay_time(LLView::getTooltipTimeout()) + .create_callback(boost::bind(&LLInspectTextureUtil::createInventoryToolTip, _1)) + .create_params(params)); + return TRUE; + } + + return LLAccordionCtrlTab::handleToolTip(x, y, mask); +} // EOF diff --git a/indra/newview/lloutfitslist.h b/indra/newview/lloutfitslist.h index 980b9c3970..6b7f4bafad 100644 --- a/indra/newview/lloutfitslist.h +++ b/indra/newview/lloutfitslist.h @@ -31,6 +31,7 @@ #include "llpanel.h" // newview +#include "llaccordionctrltab.h" #include "llinventorymodel.h" #include "lllistcontextmenu.h" #include "llpanelappearancetab.h" @@ -161,6 +162,9 @@ protected: static void renameOutfit(const LLUUID& outfit_cat_id); + void onThumbnail(const LLUUID &outfit_cat_id); + void onSave(const LLUUID &outfit_cat_id); + private: LLOutfitListBase* mOutfitList; }; @@ -192,6 +196,7 @@ private: void onAdd(); void onTakeOff(); void onRename(); + void onSave(); void onCreate(const LLSD& data); bool onEnable(LLSD::String param); bool onVisible(LLSD::String param); @@ -207,7 +212,27 @@ protected: /*virtual*/ void onUpdateItemsVisibility(); }; -/** +class LLOutfitAccordionCtrlTab : public LLAccordionCtrlTab +{ +public: + struct Params : public LLInitParam::Block<Params, LLAccordionCtrlTab::Params> + { + Optional<LLUUID> cat_id; + Params() : cat_id("cat_id") {} + }; + + virtual BOOL handleToolTip(S32 x, S32 y, MASK mask); + + protected: + LLOutfitAccordionCtrlTab(const LLOutfitAccordionCtrlTab::Params &p) + : LLAccordionCtrlTab(p), + mFolderID(p.cat_id) + {} + friend class LLUICtrlFactory; + + LLUUID mFolderID; +}; + /** * @class LLOutfitsList * * A list of agents's outfits from "My Outfits" inventory category diff --git a/indra/newview/llpanelexperiencelisteditor.cpp b/indra/newview/llpanelexperiencelisteditor.cpp index 0fdb9a57f3..854a32621a 100644 --- a/indra/newview/llpanelexperiencelisteditor.cpp +++ b/indra/newview/llpanelexperiencelisteditor.cpp @@ -40,7 +40,6 @@ #include "lltextbox.h" #include "lltrans.h" #include "llsdutil.h" -#include <boost/foreach.hpp> static LLPanelInjector<LLPanelExperienceListEditor> t_panel_experience_list_editor("panel_experience_list_editor"); @@ -96,7 +95,7 @@ void LLPanelExperienceListEditor::addExperienceIds( const uuid_vec_t& experience void LLPanelExperienceListEditor::setExperienceIds( const LLSD& experience_ids ) { mExperienceIds.clear(); - BOOST_FOREACH(LLSD uuid, llsd::inArray(experience_ids)) + for (LLSD uuid : llsd::inArray(experience_ids)) { // Using insert(range) doesn't work here because the conversion from // LLSD to LLUUID is ambiguous: have to specify asUUID() for each entry. diff --git a/indra/newview/llpanelgroupbulkban.cpp b/indra/newview/llpanelgroupbulkban.cpp index cf1f0bc32f..2b6bf1bcd6 100644 --- a/indra/newview/llpanelgroupbulkban.cpp +++ b/indra/newview/llpanelgroupbulkban.cpp @@ -49,8 +49,6 @@ #include "lluictrlfactory.h" #include "llviewerwindow.h" -#include <boost/foreach.hpp> - LLPanelGroupBulkBan::LLPanelGroupBulkBan(const LLUUID& group_id) : LLPanelGroupBulk(group_id) { // Pass on construction of this panel to the control factory. @@ -163,8 +161,8 @@ void LLPanelGroupBulkBan::submit() // remove already banned users and yourself from request. std::vector<LLAvatarName> banned_avatar_names; std::vector<LLAvatarName> out_of_limit_names; - bool banning_self = FALSE; - std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgent.getID()); + bool banning_self{ false }; + std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), gAgentID); if (conflict != banned_agent_list.end()) { banned_agent_list.erase(conflict); @@ -172,18 +170,17 @@ void LLPanelGroupBulkBan::submit() } if (group_datap) { - BOOST_FOREACH(const LLGroupMgrGroupData::ban_list_t::value_type& group_ban_pair, group_datap->mBanList) + for (const auto& [group_ban_agent_id, group_ban_data] : group_datap->mBanList) { - const LLUUID& group_ban_agent_id = group_ban_pair.first; std::vector<LLUUID>::iterator conflict = std::find(banned_agent_list.begin(), banned_agent_list.end(), group_ban_agent_id); if (conflict != banned_agent_list.end()) { LLAvatarName av_name; LLAvatarNameCache::get(group_ban_agent_id, &av_name); - banned_avatar_names.push_back(av_name); + banned_avatar_names.emplace_back(av_name); banned_agent_list.erase(conflict); - if (banned_agent_list.size() == 0) + if (banned_agent_list.empty()) { break; } diff --git a/indra/newview/llpanellogin.h b/indra/newview/llpanellogin.h index c6254f72cf..5c4f8e9135 100644 --- a/indra/newview/llpanellogin.h +++ b/indra/newview/llpanellogin.h @@ -112,7 +112,7 @@ private: static void updateServerCombo(); private: - boost::scoped_ptr<LLPanelLoginListener> mListener; + std::unique_ptr<LLPanelLoginListener> mListener; void updateLoginButtons(); void populateUserList(LLPointer<LLCredential> credential); diff --git a/indra/newview/llpaneloutfitsinventory.h b/indra/newview/llpaneloutfitsinventory.h index 91873a427a..63f9f599f1 100644 --- a/indra/newview/llpaneloutfitsinventory.h +++ b/indra/newview/llpaneloutfitsinventory.h @@ -61,6 +61,8 @@ public: void openApearanceTab(const std::string& tab_name); + bool isCOFPanelActive() const; + protected: void updateVerbs(); @@ -72,7 +74,6 @@ private: protected: void initTabPanels(); void onTabChange(); - bool isCOFPanelActive() const; bool isOutfitsListPanelActive() const; bool isOutfitsGalleryPanelActive() const; diff --git a/indra/newview/llpanelprofileclassifieds.cpp b/indra/newview/llpanelprofileclassifieds.cpp index 3fbaad4dee..307935f45f 100644 --- a/indra/newview/llpanelprofileclassifieds.cpp +++ b/indra/newview/llpanelprofileclassifieds.cpp @@ -650,6 +650,8 @@ BOOL LLPanelProfileClassified::postBuild() mSnapshotCtrl->setOnSelectCallback(boost::bind(&LLPanelProfileClassified::onTextureSelected, this)); mSnapshotCtrl->setMouseEnterCallback(boost::bind(&LLPanelProfileClassified::onTexturePickerMouseEnter, this)); mSnapshotCtrl->setMouseLeaveCallback(boost::bind(&LLPanelProfileClassified::onTexturePickerMouseLeave, this)); + mSnapshotCtrl->setAllowLocalTexture(FALSE); + mSnapshotCtrl->setBakeTextureEnabled(FALSE); mEditIcon->setVisible(false); mMapButton->setCommitCallback(boost::bind(&LLPanelProfileClassified::onMapClick, this)); @@ -667,7 +669,7 @@ BOOL LLPanelProfileClassified::postBuild() mCategoryCombo->add(LLTrans::getString(iter->second)); } - mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this), NULL); + mClassifiedNameEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onTitleChange, this), NULL); mClassifiedDescEdit->setKeystrokeCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mCategoryCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); mContentTypeCombo->setCommitCallback(boost::bind(&LLPanelProfileClassified::onChange, this)); @@ -935,6 +937,8 @@ void LLPanelProfileClassified::onCancelClick() } else { + updateTabLabel(mClassifiedNameText->getValue()); + // Reload data to undo changes to forms LLAvatarPropertiesProcessor::getInstance()->sendClassifiedInfoRequest(getClassifiedId()); } @@ -955,7 +959,7 @@ void LLPanelProfileClassified::onSaveClick() } if(isNew() || isNewWithErrors()) { - if(gStatusBar->getBalance() < getPriceForListing()) + if(gStatusBar->getBalance() < MINIMUM_PRICE_FOR_LISTING) { LLNotificationsUtil::add("ClassifiedInsufficientFunds"); return; @@ -1403,6 +1407,12 @@ void LLPanelProfileClassified::onChange() enableSave(isDirty()); } +void LLPanelProfileClassified::onTitleChange() +{ + updateTabLabel(getClassifiedName()); + onChange(); +} + void LLPanelProfileClassified::doSave() { //*TODO: Fix all of this @@ -1428,6 +1438,14 @@ void LLPanelProfileClassified::doSave() void LLPanelProfileClassified::onPublishFloaterPublishClicked() { + if (mPublishFloater->getPrice() < MINIMUM_PRICE_FOR_LISTING) + { + LLSD args; + args["MIN_PRICE"] = MINIMUM_PRICE_FOR_LISTING; + LLNotificationsUtil::add("MinClassifiedPrice", args); + return; + } + setPriceForListing(mPublishFloater->getPrice()); doSave(); diff --git a/indra/newview/llpanelprofileclassifieds.h b/indra/newview/llpanelprofileclassifieds.h index 912819e86b..d1aa5f55e3 100644 --- a/indra/newview/llpanelprofileclassifieds.h +++ b/indra/newview/llpanelprofileclassifieds.h @@ -257,6 +257,7 @@ protected: void onSetLocationClick(); void onChange(); + void onTitleChange(); void onPublishFloaterPublishClicked(); diff --git a/indra/newview/llpanelprofilepicks.cpp b/indra/newview/llpanelprofilepicks.cpp index 9a228a1f40..b097e637a4 100644 --- a/indra/newview/llpanelprofilepicks.cpp +++ b/indra/newview/llpanelprofilepicks.cpp @@ -486,6 +486,8 @@ LLPanelProfilePick::LLPanelProfilePick() , mLocationChanged(false) , mNewPick(false) , mIsEditing(false) + , mRegionCallbackConnection() + , mParcelCallbackConnection() { } @@ -503,6 +505,15 @@ LLPanelProfilePick::~LLPanelProfilePick() { LLRemoteParcelInfoProcessor::getInstance()->removeObserver(mParcelId, this); } + + if (mRegionCallbackConnection.connected()) + { + mRegionCallbackConnection.disconnect(); + } + if (mParcelCallbackConnection.connected()) + { + mParcelCallbackConnection.disconnect(); + } } void LLPanelProfilePick::setAvatarId(const LLUUID& avatar_id) @@ -577,6 +588,8 @@ BOOL LLPanelProfilePick::postBuild() mSnapshotCtrl = getChild<LLTextureCtrl>("pick_snapshot"); mSnapshotCtrl->setCommitCallback(boost::bind(&LLPanelProfilePick::onSnapshotChanged, this)); + mSnapshotCtrl->setAllowLocalTexture(FALSE); + mSnapshotCtrl->setBakeTextureEnabled(FALSE); childSetAction("teleport_btn", boost::bind(&LLPanelProfilePick::onClickTeleport, this)); childSetAction("show_on_map_btn", boost::bind(&LLPanelProfilePick::onClickMap, this)); @@ -665,6 +678,7 @@ void LLPanelProfilePick::setSnapshotId(const LLUUID& id) void LLPanelProfilePick::setPickName(const std::string& name) { mPickName->setValue(name); + mPickNameStr = name; } const std::string LLPanelProfilePick::getPickName() @@ -747,6 +761,14 @@ BOOL LLPanelProfilePick::isDirty() const void LLPanelProfilePick::onClickSave() { + if (mRegionCallbackConnection.connected()) + { + mRegionCallbackConnection.disconnect(); + } + if (mParcelCallbackConnection.connected()) + { + mParcelCallbackConnection.disconnect(); + } sendUpdate(); mLocationChanged = false; @@ -754,6 +776,7 @@ void LLPanelProfilePick::onClickSave() void LLPanelProfilePick::onClickCancel() { + updateTabLabel(mPickNameStr); LLAvatarPropertiesProcessor::getInstance()->sendPickInfoRequest(getAvatarId(), getPickId()); mLocationChanged = false; enableSaveButton(FALSE); diff --git a/indra/newview/llpanelprofilepicks.h b/indra/newview/llpanelprofilepicks.h index 956b4c7850..90c527e0f3 100644 --- a/indra/newview/llpanelprofilepicks.h +++ b/indra/newview/llpanelprofilepicks.h @@ -138,7 +138,7 @@ public: void setParcelID(const LLUUID& parcel_id) override { mParcelId = parcel_id; } void setErrorStatus(S32 status, const std::string& reason) override {}; -protected: + protected: /** * Sends remote parcel info request to resolve parcel name from its ID. @@ -229,6 +229,10 @@ protected: LLUUID mParcelId; LLUUID mPickId; LLUUID mRequestedId; + std::string mPickNameStr; + + boost::signals2::connection mRegionCallbackConnection; + boost::signals2::connection mParcelCallbackConnection; bool mLocationChanged; bool mNewPick; diff --git a/indra/newview/llpanelteleporthistory.cpp b/indra/newview/llpanelteleporthistory.cpp index b938b30479..3ed444a5af 100644 --- a/indra/newview/llpanelteleporthistory.cpp +++ b/indra/newview/llpanelteleporthistory.cpp @@ -1067,6 +1067,12 @@ void LLTeleportHistoryPanel::onGearMenuAction(const LLSD& userdata) LLLandmarkActions::getSLURLfromPosGlobal(globalPos, boost::bind(&LLTeleportHistoryPanel::gotSLURLCallback, _1)); } + else if ("remove" == command_name) + { + LLTeleportHistoryStorage::getInstance()->removeItem(index); + LLTeleportHistoryStorage::getInstance()->save(); + showTeleportHistory(); + } } bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const @@ -1121,7 +1127,8 @@ bool LLTeleportHistoryPanel::isActionEnabled(const LLSD& userdata) const if ("teleport" == command_name || "view" == command_name || "show_on_map" == command_name - || "copy_slurl" == command_name) + || "copy_slurl" == command_name + || "remove" == command_name) { if (!mLastSelectedFlatlList) { diff --git a/indra/newview/llpathfindingmanager.cpp b/indra/newview/llpathfindingmanager.cpp index 17b8ec0683..664e240484 100644 --- a/indra/newview/llpathfindingmanager.cpp +++ b/indra/newview/llpathfindingmanager.cpp @@ -114,7 +114,7 @@ public: void handleTerrainLinksetsResult(const LLSD &pContent); void handleTerrainLinksetsError(); - typedef boost::shared_ptr<LinksetsResponder> ptr_t; + typedef std::shared_ptr<LinksetsResponder> ptr_t; protected: @@ -139,7 +139,7 @@ private: LLPathfindingObjectPtr mTerrainLinksetPtr; }; -typedef boost::shared_ptr<LinksetsResponder> LinksetsResponderPtr; +typedef std::shared_ptr<LinksetsResponder> LinksetsResponderPtr; //--------------------------------------------------------------------------- // LLPathfindingManager diff --git a/indra/newview/llpathfindingmanager.h b/indra/newview/llpathfindingmanager.h index bb44f780c8..258d0fdef7 100644 --- a/indra/newview/llpathfindingmanager.h +++ b/indra/newview/llpathfindingmanager.h @@ -107,8 +107,8 @@ private: void navMeshStatusRequestCoro(std::string url, U64 regionHandle, bool isGetStatusOnly); void navAgentStateRequestCoro(std::string url); void navMeshRebakeCoro(std::string url, rebake_navmesh_callback_t rebakeNavMeshCallback); - void linksetObjectsCoro(std::string url, boost::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; - void linksetTerrainCoro(std::string url, boost::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; + void linksetObjectsCoro(std::string url, std::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; + void linksetTerrainCoro(std::string url, std::shared_ptr<LinksetsResponder> linksetsResponsderPtr, LLSD putData) const; void charactersCoro(std::string url, request_id_t requestId, object_request_callback_t callback) const; //void handleNavMeshStatusRequest(const LLPathfindingNavMeshStatus &pNavMeshStatus, LLViewerRegion *pRegion, bool pIsGetStatusOnly); diff --git a/indra/newview/llpathfindingnavmesh.h b/indra/newview/llpathfindingnavmesh.h index 87f32b8d56..ddc886f01c 100644 --- a/indra/newview/llpathfindingnavmesh.h +++ b/indra/newview/llpathfindingnavmesh.h @@ -39,7 +39,7 @@ class LLPathfindingNavMesh; class LLUUID; -typedef boost::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr; +typedef std::shared_ptr<LLPathfindingNavMesh> LLPathfindingNavMeshPtr; class LLPathfindingNavMesh { diff --git a/indra/newview/llpathfindingnavmeshzone.h b/indra/newview/llpathfindingnavmeshzone.h index baa1cc5979..b76f4421a6 100644 --- a/indra/newview/llpathfindingnavmeshzone.h +++ b/indra/newview/llpathfindingnavmeshzone.h @@ -114,7 +114,7 @@ private: LLPathfindingNavMesh::navmesh_slot_t mNavMeshSlot; }; - typedef boost::shared_ptr<NavMeshLocation> NavMeshLocationPtr; + typedef std::shared_ptr<NavMeshLocation> NavMeshLocationPtr; typedef std::vector<NavMeshLocationPtr> NavMeshLocationPtrs; void handleNavMeshLocation(); diff --git a/indra/newview/llpathfindingobject.h b/indra/newview/llpathfindingobject.h index b8d3ca2364..0114cce3f1 100644 --- a/indra/newview/llpathfindingobject.h +++ b/indra/newview/llpathfindingobject.h @@ -41,7 +41,7 @@ class LLPathfindingObject; class LLSD; -typedef boost::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr; +typedef std::shared_ptr<LLPathfindingObject> LLPathfindingObjectPtr; class LLPathfindingObject { diff --git a/indra/newview/llpathfindingobjectlist.h b/indra/newview/llpathfindingobjectlist.h index 61580582d3..e2e0dce4da 100644 --- a/indra/newview/llpathfindingobjectlist.h +++ b/indra/newview/llpathfindingobjectlist.h @@ -36,7 +36,7 @@ class LLPathfindingObjectList; -typedef boost::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr; +typedef std::shared_ptr<LLPathfindingObjectList> LLPathfindingObjectListPtr; typedef std::map<std::string, LLPathfindingObjectPtr> LLPathfindingObjectMap; class LLPathfindingObjectList diff --git a/indra/newview/llperfstats.cpp b/indra/newview/llperfstats.cpp index 64e66d520b..8718f7e7b0 100644 --- a/indra/newview/llperfstats.cpp +++ b/indra/newview/llperfstats.cpp @@ -69,7 +69,7 @@ namespace LLPerfStats { assert_main_thread(); // these following variables are proxies for pipeline statics we do not need a two way update (no llviewercontrol handler) - if( tuningFlag & NonImpostors ){ gSavedSettings.setU32("IndirectMaxNonImpostors", nonImpostors); }; + if( tuningFlag & NonImpostors ){ gSavedSettings.setU32("RenderAvatarMaxNonImpostors", nonImpostors); }; if( tuningFlag & ReflectionDetail ){ gSavedSettings.setS32("RenderReflectionDetail", reflectionDetail); }; if( tuningFlag & FarClip ){ gSavedSettings.setF32("RenderFarClip", farClip); }; if( tuningFlag & UserMinDrawDistance ){ gSavedSettings.setF32("AutoTuneRenderFarClipMin", userMinDrawDistance); }; @@ -378,7 +378,7 @@ namespace LLPerfStats auto count = countNearbyAvatars(std::min(LLPipeline::RenderFarClip, tunables.userImpostorDistance)); if( count != tunables.nonImpostors ) { - tunables.updateNonImposters( (count < LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER)?count : LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER ); + tunables.updateNonImposters( (count < LLVOAvatar::NON_IMPOSTORS_MAX_SLIDER)?count : 0 ); LL_DEBUGS("AutoTune") << "There are " << count << "avatars within " << std::min(LLPipeline::RenderFarClip, tunables.userImpostorDistance) << "m of the camera" << LL_ENDL; } } diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp index 1c14acd843..f3455bb4f0 100644 --- a/indra/newview/llplacesinventorypanel.cpp +++ b/indra/newview/llplacesinventorypanel.cpp @@ -120,3 +120,13 @@ S32 LLPlacesInventoryPanel::notify(const LLSD& info) } return 0; } + +BOOL LLPlacesInventoryPanel::handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, + EAcceptance *accept, std::string &tooltip_msg) +{ + if (mAcceptsDragAndDrop) + { + return LLInventoryPanel::handleDragAndDrop(x, y, mask, drop, cargo_type, cargo_data, accept, tooltip_msg); + } + return FALSE; +} diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h index 3c27964ec5..81b623b045 100644 --- a/indra/newview/llplacesinventorypanel.h +++ b/indra/newview/llplacesinventorypanel.h @@ -47,11 +47,14 @@ public: LLPlacesInventoryPanel(const Params& p); ~LLPlacesInventoryPanel(); - LLFolderView * createFolderRoot(LLUUID root_id ); + LLFolderView * createFolderRoot(LLUUID root_id ) override; void saveFolderState(); void restoreFolderState(); - virtual S32 notify(const LLSD& info) ; + virtual S32 notify(const LLSD& info) override; + + BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop, EDragAndDropType cargo_type, void *cargo_data, + EAcceptance *accept, std::string &tooltip_msg) override; private: LLSaveFolderState* mSavedFolderState; diff --git a/indra/newview/llpreviewtexture.cpp b/indra/newview/llpreviewtexture.cpp index 975e2bb910..ea7d4800e0 100644 --- a/indra/newview/llpreviewtexture.cpp +++ b/indra/newview/llpreviewtexture.cpp @@ -653,7 +653,7 @@ void LLPreviewTexture::adjustAspectRatio() { // No existing ratio found, create an element that will show image at original ratio populateRatioList(); // makes sure previous custom ratio is cleared - std::string ratio = boost::lexical_cast<std::string>(num)+":" + boost::lexical_cast<std::string>(denom); + std::string ratio = std::to_string(num)+":" + std::to_string(denom); mRatiosList.push_back(ratio); combo->add(ratio); combo->setCurrentByIndex(mRatiosList.size()- 1); diff --git a/indra/newview/llsculptidsize.cpp b/indra/newview/llsculptidsize.cpp index 5d051d0ebf..bedee32213 100644 --- a/indra/newview/llsculptidsize.cpp +++ b/indra/newview/llsculptidsize.cpp @@ -66,7 +66,7 @@ void LLSculptIDSize::inc(const LLDrawable *pdrawable, int sz) if (itLU.first == itLU.second) { //register //llassert(mSizeInfo.get<tag_BY_DRAWABLE>().end() == mSizeInfo.get<tag_BY_DRAWABLE>().find(pdrawable)); - mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, boost::make_shared<SizeSum>(sz), sculptId)); + mSizeInfo.get<tag_BY_DRAWABLE>().insert(Info(pdrawable, sz, std::make_shared<SizeSum>(sz), sculptId)); total_size = sz; } else diff --git a/indra/newview/llsculptidsize.h b/indra/newview/llsculptidsize.h index 87ee417b86..679fcbd44c 100644 --- a/indra/newview/llsculptidsize.h +++ b/indra/newview/llsculptidsize.h @@ -52,7 +52,7 @@ public: struct Info { - typedef boost::shared_ptr<SizeSum> PtrSizeSum; + typedef std::shared_ptr<SizeSum> PtrSizeSum; Info(const LLDrawable *drawable, int size, PtrSizeSum sizeInfo, LLUUID sculptId) : mDrawable(drawable) diff --git a/indra/newview/llsearchableui.h b/indra/newview/llsearchableui.h index 31f11eb8ef..84fcefb835 100644 --- a/indra/newview/llsearchableui.h +++ b/indra/newview/llsearchableui.h @@ -93,7 +93,7 @@ namespace ll { struct SearchableItem; - typedef boost::shared_ptr< SearchableItem > SearchableItemPtr; + typedef std::shared_ptr< SearchableItem > SearchableItemPtr; typedef std::vector< SearchableItemPtr > tSearchableItemList; diff --git a/indra/newview/llsidepanelappearance.cpp b/indra/newview/llsidepanelappearance.cpp index aed9dba7ef..7571d361a4 100644 --- a/indra/newview/llsidepanelappearance.cpp +++ b/indra/newview/llsidepanelappearance.cpp @@ -361,6 +361,15 @@ void LLSidepanelAppearance::toggleMyOutfitsPanel(BOOL visible, const std::string } } +bool LLSidepanelAppearance::isCOFPanelVisible() +{ + if (mPanelOutfitsInventory && mPanelOutfitsInventory->getVisible()) + { + return mPanelOutfitsInventory->isCOFPanelActive(); + } + return false; +} + void LLSidepanelAppearance::toggleOutfitEditPanel(BOOL visible, BOOL disable_camera_switch) { if (!mOutfitEdit || mOutfitEdit->getVisible() == visible) diff --git a/indra/newview/llsidepanelappearance.h b/indra/newview/llsidepanelappearance.h index bb9709a2b8..e67652d6f7 100644 --- a/indra/newview/llsidepanelappearance.h +++ b/indra/newview/llsidepanelappearance.h @@ -66,6 +66,8 @@ public: void updateToVisibility( const LLSD& new_visibility ); LLPanelEditWearable* getWearable(){ return mEditWearable; } + bool isCOFPanelVisible(); + private: void onFilterEdit(const std::string& search_string); void onVisibilityChanged ( const LLSD& new_visibility ); diff --git a/indra/newview/lltoolbarview.cpp b/indra/newview/lltoolbarview.cpp index f6628293ee..9157d20f98 100644 --- a/indra/newview/lltoolbarview.cpp +++ b/indra/newview/lltoolbarview.cpp @@ -46,8 +46,6 @@ #include "llviewercontrol.h" // HACK for destinations guide on startup #include "llinventorymodel.h" // HACK to disable starter avatars button for NUX -#include <boost/foreach.hpp> - LLToolBarView* gToolBarView = NULL; static LLDefaultChildRegistry::Register<LLToolBarView> r("toolbar_view"); @@ -282,7 +280,7 @@ bool LLToolBarView::loadToolbars(bool force_default) LLToolBarEnums::ButtonType button_type = toolbar_set.left_toolbar.button_display_mode; mToolbars[LLToolBarEnums::TOOLBAR_LEFT]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.left_toolbar.commands) + for (const LLCommandId::Params& command_params : toolbar_set.left_toolbar.commands) { if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_LEFT])) { @@ -297,7 +295,7 @@ bool LLToolBarView::loadToolbars(bool force_default) LLToolBarEnums::ButtonType button_type = toolbar_set.right_toolbar.button_display_mode; mToolbars[LLToolBarEnums::TOOLBAR_RIGHT]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.right_toolbar.commands) + for (const LLCommandId::Params& command_params : toolbar_set.right_toolbar.commands) { if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_RIGHT])) { @@ -312,7 +310,7 @@ bool LLToolBarView::loadToolbars(bool force_default) LLToolBarEnums::ButtonType button_type = toolbar_set.bottom_toolbar.button_display_mode; mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM]->setButtonType(button_type); } - BOOST_FOREACH(const LLCommandId::Params& command_params, toolbar_set.bottom_toolbar.commands) + for (const LLCommandId::Params& command_params : toolbar_set.bottom_toolbar.commands) { if (!addCommandInternal(LLCommandId(command_params), mToolbars[LLToolBarEnums::TOOLBAR_BOTTOM])) { diff --git a/indra/newview/llviewerfloaterreg.cpp b/indra/newview/llviewerfloaterreg.cpp index 8353d4d1d7..1b34bed2da 100644 --- a/indra/newview/llviewerfloaterreg.cpp +++ b/indra/newview/llviewerfloaterreg.cpp @@ -87,6 +87,7 @@ #include "llfloaterimsession.h" #include "llfloaterinspect.h" #include "llfloaterinventorysettings.h" +#include "llfloaterinventorythumbnailshelper.h" #include "llfloaterjoystick.h" #include "llfloaterlagmeter.h" #include "llfloaterland.h" @@ -249,6 +250,7 @@ public: "group_picker", "hud", "incoming_call", + "inventory_thumbnails_helper", "linkreplace", "mem_leaking", "marketplace_validation", @@ -335,7 +337,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("build", "floater_tools.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterTools>); LLFloaterReg::add("build_options", "floater_build_options.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBuildOptions>); LLFloaterReg::add("bumps", "floater_bumps.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterBump>); - + LLFloaterReg::add("camera", "floater_camera.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCamera>); LLFloaterReg::add("camera_presets", "floater_camera_presets.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterCameraPresets>); LLFloaterReg::add("chat_voice", "floater_voice_chat_volume.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterChatVoiceVolume>); @@ -384,6 +386,7 @@ void LLViewerFloaterReg::registerFloaters() LLFloaterReg::add("incoming_call", "floater_incoming_call.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLIncomingCallDialog>); LLFloaterReg::add("inventory", "floater_my_inventory.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterSidePanelContainer>); LLFloaterReg::add("inspect", "floater_inspect.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInspect>); + LLFloaterReg::add("inventory_thumbnails_helper", "floater_inventory_thumbnails_helper.xml", (LLFloaterBuildFunc) &LLFloaterReg::build<LLFloaterInventoryThumbnailsHelper>); LLFloaterReg::add("item_properties", "floater_item_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>); LLFloaterReg::add("task_properties", "floater_task_properties.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterItemProperties>); LLFloaterReg::add("inventory_settings", "floater_inventory_settings.xml", (LLFloaterBuildFunc)&LLFloaterReg::build<LLFloaterInventorySettings>); diff --git a/indra/newview/llviewerinventory.cpp b/indra/newview/llviewerinventory.cpp index 0a0a19d095..b9a7c9448f 100644 --- a/indra/newview/llviewerinventory.cpp +++ b/indra/newview/llviewerinventory.cpp @@ -668,15 +668,14 @@ void LLViewerInventoryCategory::setVersion(S32 version) mVersion = version; } -bool LLViewerInventoryCategory::fetch() +bool LLViewerInventoryCategory::fetch(S32 expiry_seconds) { if((VERSION_UNKNOWN == getVersion()) && mDescendentsRequested.hasExpired()) //Expired check prevents multiple downloads. { LL_DEBUGS(LOG_INV) << "Fetching category children: " << mName << ", UUID: " << mUUID << LL_ENDL; - const F32 FETCH_TIMER_EXPIRY = 10.0f; mDescendentsRequested.reset(); - mDescendentsRequested.setTimerExpirySec(FETCH_TIMER_EXPIRY); + mDescendentsRequested.setTimerExpirySec(expiry_seconds); std::string url; if (gAgent.getRegion()) @@ -685,7 +684,7 @@ bool LLViewerInventoryCategory::fetch() } else { - LL_WARNS(LOG_INV) << "agent region is null" << LL_ENDL; + LL_WARNS_ONCE(LOG_INV) << "agent region is null" << LL_ENDL; } if (!url.empty() || AISAPI::isAvailable()) { @@ -709,7 +708,13 @@ LLViewerInventoryCategory::EFetchType LLViewerInventoryCategory::getFetching() void LLViewerInventoryCategory::setFetching(LLViewerInventoryCategory::EFetchType fetching) { - if (fetching > mFetching) // allow a switch from normal to recursive + if (fetching == FETCH_FAILED) + { + const F32 FETCH_FAILURE_EXPIRY = 60.0f; + mDescendentsRequested.setTimerExpirySec(FETCH_FAILURE_EXPIRY); + mFetching = fetching; + } + else if (fetching > mFetching) // allow a switch from normal to recursive { if (mDescendentsRequested.hasExpired() || (mFetching == FETCH_NONE)) { diff --git a/indra/newview/llviewerinventory.h b/indra/newview/llviewerinventory.h index e043285ffb..0d0ccc6643 100644 --- a/indra/newview/llviewerinventory.h +++ b/indra/newview/llviewerinventory.h @@ -209,13 +209,15 @@ public: S32 getVersion() const; void setVersion(S32 version); - // Returns true if a fetch was issued (not nessesary in progress). - bool fetch(); + // Returns true if a fetch was issued (not nessesary in progress). + // no requests will happen during expiry_seconds even if fetch completed + bool fetch(S32 expiry_seconds = 10); typedef enum { FETCH_NONE = 0, FETCH_NORMAL, FETCH_RECURSIVE, + FETCH_FAILED, // back off } EFetchType; EFetchType getFetching(); // marks as fetch being in progress or as done diff --git a/indra/newview/llviewermedia.h b/indra/newview/llviewermedia.h index ad7c4bcefa..03899b6b8f 100644 --- a/indra/newview/llviewermedia.h +++ b/indra/newview/llviewermedia.h @@ -431,7 +431,7 @@ private: private: // a single media url with some data and an impl. - boost::shared_ptr<LLPluginClassMedia> mMediaSource; + std::shared_ptr<LLPluginClassMedia> mMediaSource; LLMutex mLock; F64 mZoomFactor; LLUUID mTextureId; diff --git a/indra/newview/llviewermenu.cpp b/indra/newview/llviewermenu.cpp index c8dd65941a..e4a3bf6336 100644 --- a/indra/newview/llviewermenu.cpp +++ b/indra/newview/llviewermenu.cpp @@ -102,6 +102,7 @@ #include "llsceneview.h" #include "llscenemonitor.h" #include "llselectmgr.h" +#include "llsidepanelappearance.h" #include "llspellcheckmenuhandler.h" #include "llstatusbar.h" #include "lltextureview.h" @@ -1463,6 +1464,31 @@ class LLAdvancedCheckDebugUnicode : public view_listener_t +////////////////// +// DEBUG CAMERA // +////////////////// + + +class LLAdvancedToggleDebugCamera : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + LLView::sDebugCamera = !(LLView::sDebugCamera); + LLFloaterCamera::onDebugCameraToggled(); + return true; + } +}; + +class LLAdvancedCheckDebugCamera : public view_listener_t +{ + bool handleEvent(const LLSD& userdata) + { + return LLView::sDebugCamera; + } +}; + + + /////////////////////// // XUI NAME TOOLTIPS // /////////////////////// @@ -6709,6 +6735,13 @@ void handle_edit_outfit() void handle_now_wearing() { + LLSidepanelAppearance *panel_appearance = dynamic_cast<LLSidepanelAppearance *>(LLFloaterSidePanelContainer::getPanel("appearance")); + if (panel_appearance && panel_appearance->isInVisibleChain() && panel_appearance->isCOFPanelVisible()) + { + LLFloaterReg::findInstance("appearance")->closeFloater(); + return; + } + LLFloaterSidePanelContainer::showPanel("appearance", LLSD().with("type", "now_wearing")); } @@ -9608,6 +9641,8 @@ void initialize_menus() view_listener_t::addMenu(new LLAdvancedToggleDebugViews(), "Advanced.ToggleDebugViews"); view_listener_t::addMenu(new LLAdvancedCheckDebugUnicode(), "Advanced.CheckDebugUnicode"); view_listener_t::addMenu(new LLAdvancedToggleDebugUnicode(), "Advanced.ToggleDebugUnicode"); + view_listener_t::addMenu(new LLAdvancedCheckDebugCamera(), "Advanced.CheckDebugCamera"); + view_listener_t::addMenu(new LLAdvancedToggleDebugCamera(), "Advanced.ToggleDebugCamera"); view_listener_t::addMenu(new LLAdvancedToggleXUINameTooltips(), "Advanced.ToggleXUINameTooltips"); view_listener_t::addMenu(new LLAdvancedCheckXUINameTooltips(), "Advanced.CheckXUINameTooltips"); view_listener_t::addMenu(new LLAdvancedToggleDebugMouseEvents(), "Advanced.ToggleDebugMouseEvents"); diff --git a/indra/newview/llviewermenufile.h b/indra/newview/llviewermenufile.h index ff2ee693fd..6b9df6df28 100644 --- a/indra/newview/llviewermenufile.h +++ b/indra/newview/llviewermenufile.h @@ -145,7 +145,7 @@ public: virtual void notify(const std::vector<std::string>& filenames); private: - boost::shared_ptr<LLPluginClassMedia> mPlugin; + std::shared_ptr<LLPluginClassMedia> mPlugin; }; diff --git a/indra/newview/llviewermessage.cpp b/indra/newview/llviewermessage.cpp index ed96e11c6b..bba9c0235e 100644 --- a/indra/newview/llviewermessage.cpp +++ b/indra/newview/llviewermessage.cpp @@ -119,8 +119,6 @@ #include "llviewerregion.h" #include "llfloaterregionrestarting.h" -#include <boost/foreach.hpp> - #include "llnotificationmanager.h" // #include "llexperiencecache.h" @@ -5634,7 +5632,7 @@ void notify_cautioned_script_question(const LLSD& notification, const LLSD& resp BOOL caution = FALSE; S32 count = 0; std::string perms; - BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS) + for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS) { if ((orig_questions & script_perm.permbit) && script_perm.caution) @@ -5879,7 +5877,7 @@ void process_script_question(LLMessageSystem *msg, void **user_data) S32 known_questions = 0; bool has_not_only_debit = questions ^ SCRIPT_PERMISSIONS[SCRIPT_PERMISSION_DEBIT].permbit; // check the received permission flags against each permission - BOOST_FOREACH(script_perm_t script_perm, SCRIPT_PERMISSIONS) + for (const script_perm_t& script_perm : SCRIPT_PERMISSIONS) { if (questions & script_perm.permbit) { diff --git a/indra/newview/llviewerobjectlist.cpp b/indra/newview/llviewerobjectlist.cpp index 5bc7523be1..a53bd982d4 100644 --- a/indra/newview/llviewerobjectlist.cpp +++ b/indra/newview/llviewerobjectlist.cpp @@ -2043,6 +2043,7 @@ void LLViewerObjectList::findOrphans(LLViewerObject* objectp, U32 ip, U32 port) { LL_WARNS() << objectp->mID << " has self as parent, skipping!" << LL_ENDL; + ++iter; continue; } diff --git a/indra/newview/llviewerparcelaskplay.cpp b/indra/newview/llviewerparcelaskplay.cpp index afbe2c94de..aea06834b2 100644 --- a/indra/newview/llviewerparcelaskplay.cpp +++ b/indra/newview/llviewerparcelaskplay.cpp @@ -287,7 +287,7 @@ void LLViewerParcelAskPlay::saveSettings() if ((iter_parcel->second.mDate.secondsSinceEpoch() + (F64SecondsImplicit)U32Days(30)) > LLTimer::getTotalSeconds()) { // write unexpired parcels - std::string parcel_id = boost::lexical_cast<std::string>(iter_parcel->first); + std::string parcel_id = std::to_string(iter_parcel->first); write_llsd[key][parcel_id] = LLSD(); write_llsd[key][parcel_id]["mode"] = (LLSD::Integer)iter_parcel->second.mMode; write_llsd[key][parcel_id]["date"] = iter_parcel->second.mDate; diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp index 3225299493..2bab50300b 100644 --- a/indra/newview/llviewershadermgr.cpp +++ b/indra/newview/llviewershadermgr.cpp @@ -592,7 +592,7 @@ std::string LLViewerShaderMgr::loadBasicShaders() std::map<std::string, std::string> attribs; attribs["MAX_JOINTS_PER_MESH_OBJECT"] = - boost::lexical_cast<std::string>(LLSkinningUtil::getMaxJointCount()); + std::to_string(LLSkinningUtil::getMaxJointCount()); BOOL ssr = gSavedSettings.getBOOL("RenderScreenSpaceReflections"); diff --git a/indra/newview/llviewerwindow.h b/indra/newview/llviewerwindow.h index ccef006a07..346073b8a1 100644 --- a/indra/newview/llviewerwindow.h +++ b/indra/newview/llviewerwindow.h @@ -538,8 +538,8 @@ private: bool mStatesDirty; U32 mCurrResolutionIndex; - boost::scoped_ptr<LLWindowListener> mWindowListener; - boost::scoped_ptr<LLViewerWindowListener> mViewerWindowListener; + std::unique_ptr<LLWindowListener> mWindowListener; + std::unique_ptr<LLViewerWindowListener> mViewerWindowListener; // Object temporarily hovered over while dragging LLPointer<LLViewerObject> mDragHoveredObject; diff --git a/indra/newview/llvoavatar.cpp b/indra/newview/llvoavatar.cpp index 957ce32302..e35c090a96 100644 --- a/indra/newview/llvoavatar.cpp +++ b/indra/newview/llvoavatar.cpp @@ -4291,6 +4291,15 @@ void LLVOAvatar::updateOrientation(LLAgent& agent, F32 speed, F32 delta_time) if (mTurning) { pelvis_rot_threshold *= 0.4f; + // account for fps, assume that above value is for ~60fps + constexpr F32 default_frame_sec = 0.016f; + F32 prev_frame_sec = LLFrameTimer::getFrameDeltaTimeF32(); + if (default_frame_sec > prev_frame_sec) + { + // reduce threshold since turn rate per second is constant, + // shorter frame means shorter turn. + pelvis_rot_threshold *= prev_frame_sec/default_frame_sec; + } } // am I done turning? diff --git a/indra/newview/llvoicevivox.cpp b/indra/newview/llvoicevivox.cpp index 1b9aef193c..310c9ee297 100644 --- a/indra/newview/llvoicevivox.cpp +++ b/indra/newview/llvoicevivox.cpp @@ -5971,7 +5971,7 @@ void LLVivoxVoiceClient::filePlaybackSetMode(bool vox, float speed) } //------------------------------------------------------------------------ -std::set<LLVivoxVoiceClient::sessionState::wptr_t> LLVivoxVoiceClient::sessionState::mSession; +std::set<LLVivoxVoiceClient::sessionState::wptr_t, std::owner_less<LLVivoxVoiceClient::sessionState::wptr_t>> LLVivoxVoiceClient::sessionState::mSession; LLVivoxVoiceClient::sessionState::sessionState() : diff --git a/indra/newview/llvoicevivox.h b/indra/newview/llvoicevivox.h index ae2aec0e9c..7e1835d876 100644 --- a/indra/newview/llvoicevivox.h +++ b/indra/newview/llvoicevivox.h @@ -294,8 +294,8 @@ protected: bool mAvatarIDValid; bool mIsSelf; }; - typedef boost::shared_ptr<participantState> participantStatePtr_t; - typedef boost::weak_ptr<participantState> participantStateWptr_t; + typedef std::shared_ptr<participantState> participantStatePtr_t; + typedef std::weak_ptr<participantState> participantStateWptr_t; typedef std::map<const std::string, participantStatePtr_t> participantMap; typedef std::map<const LLUUID, participantStatePtr_t> participantUUIDMap; @@ -303,10 +303,10 @@ protected: struct sessionState { public: - typedef boost::shared_ptr<sessionState> ptr_t; - typedef boost::weak_ptr<sessionState> wptr_t; + typedef std::shared_ptr<sessionState> ptr_t; + typedef std::weak_ptr<sessionState> wptr_t; - typedef boost::function<void(const ptr_t &)> sessionFunc_t; + typedef std::function<void(const ptr_t &)> sessionFunc_t; static ptr_t createSession(); ~sessionState(); @@ -370,7 +370,7 @@ protected: private: sessionState(); - static std::set<wptr_t> mSession; // canonical list of outstanding sessions. + static std::set<wptr_t, std::owner_less<wptr_t>> mSession; // canonical list of outstanding sessions. std::set<wptr_t>::iterator mMyIterator; // used for delete static void for_eachPredicate(const wptr_t &a, sessionFunc_t func); @@ -381,7 +381,7 @@ protected: static bool testByCallerId(const LLVivoxVoiceClient::sessionState::wptr_t &a, LLUUID participantId); }; - typedef boost::shared_ptr<sessionState> sessionStatePtr_t; + typedef std::shared_ptr<sessionState> sessionStatePtr_t; typedef std::map<std::string, sessionStatePtr_t> sessionMap; diff --git a/indra/newview/llvovolume.cpp b/indra/newview/llvovolume.cpp index 57a7d6a90b..e3f2afadc5 100644 --- a/indra/newview/llvovolume.cpp +++ b/indra/newview/llvovolume.cpp @@ -4575,6 +4575,11 @@ BOOL LLVOVolume::lineSegmentIntersect(const LLVector4a& start, const LLVector4a& } } + if (getClickAction() == CLICK_ACTION_IGNORE && !LLFloater::isVisible(gFloaterTools)) + { + return FALSE; + } + BOOL ret = FALSE; LLVolume* volume = getVolume(); diff --git a/indra/newview/llwindowlistener.cpp b/indra/newview/llwindowlistener.cpp index aa8c79b0d2..0edabf358f 100644 --- a/indra/newview/llwindowlistener.cpp +++ b/indra/newview/llwindowlistener.cpp @@ -388,7 +388,7 @@ static void mouseEvent(const MouseFunc& func, const LLSD& request) LLCoordGL pos(request["x"].asInteger(), request["y"].asInteger()); bool has_pos(request.has("x") && request.has("y")); - boost::scoped_ptr<LLView::TemporaryDrilldownFunc> tempfunc; + std::unique_ptr<LLView::TemporaryDrilldownFunc> tempfunc; // Documentation for mouseDown(), mouseUp() and mouseMove() claims you // must either specify ["path"], or both of ["x"] and ["y"]. You MAY diff --git a/indra/newview/llxmlrpclistener.cpp b/indra/newview/llxmlrpclistener.cpp index b816f9a3b5..3c2c6d15c4 100644 --- a/indra/newview/llxmlrpclistener.cpp +++ b/indra/newview/llxmlrpclistener.cpp @@ -544,7 +544,7 @@ private: const std::string mMethod; const std::string mReplyPump; LLTempBoundListener mBoundListener; - boost::scoped_ptr<LLXMLRPCTransaction> mTransaction; + std::unique_ptr<LLXMLRPCTransaction> mTransaction; LLXMLRPCTransaction::EStatus mPreviousStatus; // To detect state changes. }; diff --git a/indra/newview/llxmlrpctransaction.cpp b/indra/newview/llxmlrpctransaction.cpp index ba7e8d7298..a77c31eee3 100644 --- a/indra/newview/llxmlrpctransaction.cpp +++ b/indra/newview/llxmlrpctransaction.cpp @@ -188,7 +188,7 @@ public: virtual void onCompleted(LLCore::HttpHandle handle, LLCore::HttpResponse * response); - typedef boost::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t; + typedef std::shared_ptr<LLXMLRPCTransaction::Handler> ptr_t; private: diff --git a/indra/newview/skins/default/xui/en/floater_camera.xml b/indra/newview/skins/default/xui/en/floater_camera.xml index 4655a4d394..93b306d7d7 100644 --- a/indra/newview/skins/default/xui/en/floater_camera.xml +++ b/indra/newview/skins/default/xui/en/floater_camera.xml @@ -138,13 +138,13 @@ </panel> </panel> <panel - follows="all" + follows="left|top" height="102" layout="topleft" left_pad="2" + right="-2" name="buttons_panel" - top="22" - width="212"> + top="22"> <panel_camera_item name="front_view" tool_tip="Front View" @@ -253,4 +253,22 @@ function="CameraPresets.Save"/> </button> </panel> + <panel + name="viewer_camera_info" + left="0" + top="135" + width="400" + height="150" + border="true" + visible="false" + background_visible="true"/> + <panel + name="agent_camera_info" + left="0" + top="285" + width="400" + height="150" + border="true" + visible="false" + background_visible="true"/> </floater> diff --git a/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml b/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml new file mode 100644 index 0000000000..aa3500bac2 --- /dev/null +++ b/indra/newview/skins/default/xui/en/floater_inventory_thumbnails_helper.xml @@ -0,0 +1,99 @@ +<?xml version="1.0" encoding="utf-8" standalone="yes" ?> +<floater + legacy_header_height="18" + can_resize="false" + height="600" + layout="topleft" + min_height="175" + min_width="500" + name="contents" + help_topic="contents" + title="Inventory Thumbnails Helper" + width="800"> + <scroll_list + top="20" + height="350" + draw_stripes="true" + draw_heading="true" + follows="all" + layout="topleft" + left="8" + multi_select="true" + name="inventory_thumbnails_list" + right="-8" + tool_tip="Paste items from your inventory"> + <scroll_list.columns + dynamic_width="true" + label="Inventory Item" + name="item_name" + relative_width="0.4" /> + <scroll_list.columns + dynamic_width="true" + label="Existing Texture" + name="existing_texture" + relative_width="0.3" /> + <scroll_list.columns + dynamic_width="true" + label="New Texture" + name="new_texture" + relative_width="0.3" /> + </scroll_list> + <text_editor + top="375" + height="140" + follows="all" + left="8" + right="-8" + name="output_log" + font="Monospace" + text_color="0.1 0.5 0.1 1.0" + width="480"> + </text_editor> + <button + follows="left|bottom" + height="20" + label="Paste items from Inventory" + layout="topleft" + left="10" + name="paste_items_btn" + bottom="-60" + width="235" /> + <button + follows="left|bottom" + height="20" + label="Paste textures from Inventory" + layout="topleft" + left_delta="0" + name="paste_textures_btn" + top_delta="26 " + width="235" /> + <button + follows="left|bottom" + height="20" + label="Write Thumbnails" + layout="topleft" + left_delta="0" + name="write_thumbnails_btn" + top_delta="26 " + width="235" /> + <button + follows="left|bottom" + height="20" + label="Log items with no thumbnail" + layout="bottomleft" + right="-10" + name="log_missing_thumbnails_btn" + bottom="60" + width="235" /> + <button + follows="left|bottom" + height="20" + label="Clear thumbnails from pasted items" + layout="bottomleft" + right="-10" + name="clear_thumbnails_btn" + top_delta="26" + width="235" /> + + +</floater>
\ No newline at end of file diff --git a/indra/newview/skins/default/xui/en/floater_publish_classified.xml b/indra/newview/skins/default/xui/en/floater_publish_classified.xml index 2d7d03f7a0..04840e1c64 100644 --- a/indra/newview/skins/default/xui/en/floater_publish_classified.xml +++ b/indra/newview/skins/default/xui/en/floater_publish_classified.xml @@ -25,6 +25,7 @@ Remember, Classified fees are non-refundable. </text> <spinner decimal_digits="0" + allow_digits_only="true" follows="left|top" font="SansSerif" halign="left" @@ -36,7 +37,6 @@ Remember, Classified fees are non-refundable. layout="topleft" left="15" value="50" - min_val="50" max_val="999999" name="price_for_listing" top_pad="10" diff --git a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml index 41e0183370..c11f1c88cb 100644 --- a/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_gallery_inventory.xml @@ -35,7 +35,7 @@ layout="topleft" name="Folder Wearables Separator" /> <menu_item_call - label="Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="Replace Outfit"> <menu_item_call.on_click @@ -43,7 +43,7 @@ parameter="replaceoutfit" /> </menu_item_call> <menu_item_call - label="Add To Current Outfit" + label="Add folder items" layout="topleft" name="Add To Outfit"> <menu_item_call.on_click @@ -51,7 +51,7 @@ parameter="addtooutfit" /> </menu_item_call> <menu_item_call - label="Remove From Current Outfit" + label="Take off folder items" layout="topleft" name="Remove From Outfit"> <menu_item_call.on_click diff --git a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml index 25d64ba74d..99cee83f4e 100755 --- a/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml +++ b/indra/newview/skins/default/xui/en/menu_gallery_outfit_tab.xml @@ -3,7 +3,7 @@ layout="topleft" name="Outfit"> <menu_item_call - label="Wear - Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="wear_replace"> <on_click @@ -16,7 +16,7 @@ parameter="wear_replace" /> </menu_item_call> <menu_item_call - label="Wear - Add to Current Outfit" + label="Add outfit items" layout="topleft" name="wear_add"> <on_click @@ -29,7 +29,7 @@ parameter="wear_add" /> </menu_item_call> <menu_item_call - label="Take Off - Remove from Current Outfit" + label="Take off outfit items" layout="topleft" name="take_off"> <on_click @@ -41,17 +41,60 @@ function="Outfit.OnVisible" parameter="take_off" /> </menu_item_call> + <menu_item_separator/> <menu_item_call - label="Image..." - layout="topleft" - name="thumbnail"> + label="Image..." + layout="topleft" + name="thumbnail"> + <on_click + function="Outfit.Thumbnail" /> + </menu_item_call> + <menu_item_call + label="Edit outfit" + layout="topleft" + name="edit"> + <on_click + function="Outfit.Edit" /> + <on_visible + function="Outfit.OnVisible" + parameter="edit" /> + </menu_item_call> + <menu_item_call + label="Rename outfit" + layout="topleft" + name="rename"> + <on_click + function="Outfit.Rename" /> + <on_enable + function="Outfit.OnEnable" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="Save to this outfit" + layout="topleft" + name="save"> + <on_click + function="Outfit.Save" /> + </menu_item_call> + <menu_item_separator> + <on_visible + function="Outfit.OnVisible" + parameter="delete" /> + </menu_item_separator> + <menu_item_call + label="Delete outfit" + layout="topleft" + name="delete"> <on_click - function="Outfit.Thumbnail" /> + function="Outfit.Delete" /> + <on_visible + function="Outfit.OnVisible" + parameter="delete" /> </menu_item_call> - <menu_item_separator name="sepatator1" /> + <menu_item_separator/> <menu height="175" - label="New Clothes" + label="New clothes" layout="topleft" left_delta="0" mouse_opaque="false" @@ -157,7 +200,7 @@ </menu> <menu height="85" - label="New Body Parts" + label="New body parts" layout="topleft" left_delta="0" mouse_opaque="false" @@ -197,35 +240,4 @@ parameter="eyes" /> </menu_item_call> </menu> - <menu_item_separator name="sepatator2" /> - <menu_item_call - label="Edit Outfit" - layout="topleft" - name="edit"> - <on_click - function="Outfit.Edit" /> - <on_visible - function="Outfit.OnVisible" - parameter="edit" /> - </menu_item_call> - <menu_item_call - label="Rename Outfit" - layout="topleft" - name="rename"> - <on_click - function="Outfit.Rename" /> - <on_enable - function="Outfit.OnEnable" - parameter="rename" /> - </menu_item_call> - <menu_item_call - label="Delete Outfit" - layout="topleft" - name="delete"> - <on_click - function="Outfit.Delete" /> - <on_visible - function="Outfit.OnVisible" - parameter="delete" /> - </menu_item_call> </context_menu> diff --git a/indra/newview/skins/default/xui/en/menu_inventory.xml b/indra/newview/skins/default/xui/en/menu_inventory.xml index d5c0a427fb..d8aac71dd5 100644 --- a/indra/newview/skins/default/xui/en/menu_inventory.xml +++ b/indra/newview/skins/default/xui/en/menu_inventory.xml @@ -272,7 +272,7 @@ layout="topleft" name="Folder Wearables Separator" /> <menu_item_call - label="Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="Replace Outfit"> <menu_item_call.on_click @@ -280,7 +280,7 @@ parameter="replaceoutfit" /> </menu_item_call> <menu_item_call - label="Add To Current Outfit" + label="Add folder items" layout="topleft" name="Add To Outfit"> <menu_item_call.on_click @@ -288,7 +288,7 @@ parameter="addtooutfit" /> </menu_item_call> <menu_item_call - label="Remove From Current Outfit" + label="Take off folder items" layout="topleft" name="Remove From Outfit"> <menu_item_call.on_click diff --git a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml index 85eb941e31..8f36c7a00a 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_gear.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_gear.xml @@ -4,7 +4,7 @@ visible="false" name="Gear Outfit"> <menu_item_call - label="Wear - Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="wear"> <on_click @@ -17,7 +17,7 @@ parameter="wear" /> </menu_item_call> <menu_item_call - label="Wear - Add to Current Outfit" + label="Add outfit items" layout="topleft" name="wear_add"> <on_click @@ -25,9 +25,11 @@ <on_enable function="Gear.OnEnable" parameter="wear_add" /> + <on_visible + function="Gear.OnVisible"/> </menu_item_call> <menu_item_call - label="Take Off - Remove from Current Outfit" + label="Take off outfit items" layout="topleft" name="take_off"> <on_click @@ -39,19 +41,88 @@ function="Gear.OnVisible" parameter="take_off" /> </menu_item_call> + <menu_item_separator name="wear_separator" /> <menu_item_call label="Image..." layout="topleft" name="thumbnail"> + <on_click + function="Gear.Thumbnail" /> + </menu_item_call> + <menu_item_call + label="Rename outfit" + layout="topleft" + name="rename"> + <on_click + function="Gear.Rename" /> + <on_enable + function="Gear.OnEnable" + parameter="rename" /> + <on_visible + function="Gear.OnVisible" + parameter="rename" /> + </menu_item_call> + <menu_item_call + label="Save to this outfit" + layout="topleft" + name="save"> + <on_click + function="Gear.Save" /> + <on_visible + function="Gear.OnVisible"/> + </menu_item_call> + <menu_item_separator> + <on_visible + function="Gear.OnVisible" + parameter="delete" /> + </menu_item_separator> + <menu_item_call + label="Delete outfit" + layout="topleft" + name="delete_outfit"> + <on_click + function="Gear.Delete" /> + <on_enable + function="Gear.OnEnable" + parameter="delete" /> + <on_visible + function="Gear.OnVisible" + parameter="delete" /> + </menu_item_call> + <menu_item_separator> + <on_visible + function="Gear.OnVisible"/> + </menu_item_separator> + <menu_item_check + label="Sort folders always by name" + layout="topleft" + name="sort_folders_by_name"> + <on_click + function="Gear.SortByName" /> + <on_check + function="CheckControl" + parameter="OutfitGallerySortByName" /> + </menu_item_check> + <menu_item_call + label="Expand all folders" + layout="topleft" + name="expand"> + <on_click + function="Gear.Expand" /> + </menu_item_call> + <menu_item_call + label="Collapse all folders" + layout="topleft" + name="collapse"> <on_click - function="Gear.Thumbnail" /> + function="Gear.Collapse" /> </menu_item_call> - <menu_item_separator name="sepatator1" /> + <menu_item_separator/> <!-- copied (with minor modifications) from menu_inventory_add.xml --> <!-- *TODO: generate dynamically? --> <menu height="175" - label="New Clothes" + label="New clothes" layout="topleft" left_delta="0" mouse_opaque="false" @@ -165,7 +236,7 @@ </menu> <menu height="85" - label="New Body Parts" + label="New body parts" layout="topleft" left_delta="0" mouse_opaque="false" @@ -206,57 +277,4 @@ </menu_item_call> </menu> <!-- copied from menu_inventory_add.xml --> - - <menu_item_separator name="sepatator2" /> - <menu_item_call - label="Expand all folders" - layout="topleft" - name="expand"> - <on_click - function="Gear.Expand" /> - </menu_item_call> - <menu_item_call - label="Collapse all folders" - layout="topleft" - name="collapse"> - <on_click - function="Gear.Collapse" /> - </menu_item_call> - <menu_item_call - label="Rename Outfit" - layout="topleft" - name="rename"> - <on_click - function="Gear.Rename" /> - <on_enable - function="Gear.OnEnable" - parameter="rename" /> - <on_visible - function="Gear.OnVisible" - parameter="rename" /> - </menu_item_call> - <menu_item_call - label="Delete Outfit" - layout="topleft" - name="delete_outfit"> - <on_click - function="Gear.Delete" /> - <on_enable - function="Gear.OnEnable" - parameter="delete" /> - <on_visible - function="Gear.OnVisible" - parameter="delete" /> - </menu_item_call> - <menu_item_separator name="sepatator3" /> - <menu_item_check - label="Sort Folders Always by Name" - layout="topleft" - name="sort_folders_by_name"> - <on_click - function="Gear.SortByName" /> - <on_check - function="CheckControl" - parameter="OutfitGallerySortByName" /> - </menu_item_check> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml index ae5fae864d..c6805edd63 100644 --- a/indra/newview/skins/default/xui/en/menu_outfit_tab.xml +++ b/indra/newview/skins/default/xui/en/menu_outfit_tab.xml @@ -3,7 +3,7 @@ layout="topleft" name="Outfit"> <menu_item_call - label="Wear - Replace Current Outfit" + label="Replace current outfit" layout="topleft" name="wear_replace"> <on_click @@ -16,7 +16,7 @@ parameter="wear_replace" /> </menu_item_call> <menu_item_call - label="Wear - Add to Current Outfit" + label="Add outfit items" layout="topleft" name="wear_add"> <on_click @@ -29,7 +29,7 @@ parameter="wear_add" /> </menu_item_call> <menu_item_call - label="Take Off - Remove from Current Outfit" + label="Take off outfit items" layout="topleft" name="take_off"> <on_click @@ -41,19 +41,26 @@ function="Outfit.OnVisible" parameter="take_off" /> </menu_item_call> + <menu_item_separator /> <menu_item_call - label="Edit Outfit" - layout="topleft" - name="edit"> + label="Image..." + layout="topleft" + name="thumbnail"> + <on_click + function="Outfit.Thumbnail" /> + </menu_item_call> + <menu_item_call + label="Edit outfit" + layout="topleft" + name="edit"> <on_click function="Outfit.Edit" /> <on_visible function="Outfit.OnVisible" parameter="edit" /> </menu_item_call> - <menu_item_separator /> <menu_item_call - label="Rename Outfit" + label="Rename outfit" layout="topleft" name="rename"> <on_click @@ -63,7 +70,19 @@ parameter="rename" /> </menu_item_call> <menu_item_call - label="Delete Outfit" + label="Save to this outfit" + layout="topleft" + name="save"> + <on_click + function="Outfit.Save" /> + </menu_item_call> + <menu_item_separator> + <on_visible + function="Outfit.OnVisible" + parameter="delete" /> + </menu_item_separator> + <menu_item_call + label="Delete outfit" layout="topleft" name="delete"> <on_click diff --git a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml index 910a0adc28..e4e86bb911 100644 --- a/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml +++ b/indra/newview/skins/default/xui/en/menu_teleport_history_item.xml @@ -49,4 +49,17 @@ function="TeleportHistory.GearMenu.Enable" parameter="copy_slurl" /> </menu_item_call> + <menu_item_separator + layout="topleft" /> + <menu_item_call + label="Remove from history" + layout="topleft" + name="remove_from_history"> + <on_click + function="TeleportHistory.GearMenu.Action" + parameter="remove" /> + <on_enable + function="TeleportHistory.GearMenu.Enable" + parameter="remove" /> + </menu_item_call> </toggleable_menu> diff --git a/indra/newview/skins/default/xui/en/menu_viewer.xml b/indra/newview/skins/default/xui/en/menu_viewer.xml index 3bf4015bc5..5b0ebf1110 100644 --- a/indra/newview/skins/default/xui/en/menu_viewer.xml +++ b/indra/newview/skins/default/xui/en/menu_viewer.xml @@ -3566,6 +3566,21 @@ function="World.EnvPreset" function="Advanced.WebContentTest" parameter="http://duckduckgo.com"/> </menu_item_call> + <menu_item_call + label="Inventory Thumbnails Helper" + name="Inventory Thumbnails Helper" + shortcut="control|alt|shift|X"> + <menu_item_call.on_click + function="Floater.Show" + parameter="inventory_thumbnails_helper" /> + </menu_item_call> + <menu_item_call + label="FB Connect Test" + name="FB Connect Test"> + <menu_item_call.on_click + function="Advanced.WebContentTest" + parameter="https://cryptic-ridge-1632.herokuapp.com/"/> + </menu_item_call> <menu_item_call label="Dump Fonts" name="Dump Fonts"> @@ -3655,6 +3670,14 @@ function="World.EnvPreset" function="Advanced.ToggleDebugUnicode" /> </menu_item_check> <menu_item_check + label="Debug Camera Controls" + name="Debug Camera Controls"> + <menu_item_check.on_check + function="Advanced.CheckDebugCamera" /> + <menu_item_check.on_click + function="Advanced.ToggleDebugCamera" /> + </menu_item_check> + <menu_item_check label="Debug Name Tooltips" name="Debug Name Tooltips"> <menu_item_check.on_check diff --git a/indra/newview/skins/default/xui/en/notifications.xml b/indra/newview/skins/default/xui/en/notifications.xml index a9d13dfd06..7d237c6edd 100644 --- a/indra/newview/skins/default/xui/en/notifications.xml +++ b/indra/newview/skins/default/xui/en/notifications.xml @@ -12296,6 +12296,50 @@ Would you like to save them first? notext="No" yestext="Yes"/> </notification> + + <notification + icon="alertmodal.tga" + name="ConfirmOverwriteOutfit" + type="alertmodal"> + <unique/> +This will replace the items in the +selected outfit with the items you +are wearing now. + <tag>confirm</tag> + <usetemplate + ignoretext="Confirm before overwriting outfit" + name="okcancelignore" + notext="Cancel" + yestext="Save"/> + </notification> + + <notification + icon="alertmodal.tga" + name="ClearInventoryThumbnailsWarning" + type="alertmodal"> + You are about to remove thumbnail images from the inventory items in the list. This change cannot be undone. + + Would you like to proceed? + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> + + <notification + icon="alertmodal.tga" + name="WriteInventoryThumbnailsWarning" + type="alertmodal"> + You are about to overwrite thumbnail images for some or all of the inventory items in the list. This change cannot be undone. + + Would you like to proceed? + <tag>confirm</tag> + <usetemplate + name="okcancelbuttons" + notext="No" + yestext="Yes"/> + </notification> <notification icon="notifytip.tga" diff --git a/indra/newview/skins/default/xui/en/panel_settings_water.xml b/indra/newview/skins/default/xui/en/panel_settings_water.xml index bec4f7852f..5e65b0e8a2 100644 --- a/indra/newview/skins/default/xui/en/panel_settings_water.xml +++ b/indra/newview/skins/default/xui/en/panel_settings_water.xml @@ -65,7 +65,7 @@ Density Exponent: </text> <slider - decimal_digits="1" + decimal_digits="2" follows="left|top" height="16" increment="0.01" diff --git a/indra/newview/tests/llremoteparcelrequest_test.cpp b/indra/newview/tests/llremoteparcelrequest_test.cpp index 4f7f87b6b0..4eddfb46e1 100644 --- a/indra/newview/tests/llremoteparcelrequest_test.cpp +++ b/indra/newview/tests/llremoteparcelrequest_test.cpp @@ -49,7 +49,7 @@ void LLCurl::Responder::failureResult(S32 status, const std::string& reason, con void LLCurl::Responder::successResult(const LLSD& content) { } void LLCurl::Responder::completeResult(S32 status, const std::string& reason, const LLSD& content) { } std::string LLCurl::Responder::dumpResponse() const { return "(failure)"; } -void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,boost::shared_ptr<LLBufferArray> const &) { } +void LLCurl::Responder::completedRaw(LLChannelDescriptors const &,std::shared_ptr<LLBufferArray> const &) { } void LLMessageSystem::getF32(char const *,char const *,F32 &,S32) { } void LLMessageSystem::getU8(char const *,char const *,U8 &,S32) { } void LLMessageSystem::getS32(char const *,char const *,S32 &,S32) { } @@ -110,7 +110,7 @@ namespace tut { set_test_name("observer pointer"); - boost::scoped_ptr<TestObserver> observer(new TestObserver()); + std::unique_ptr<TestObserver> observer(new TestObserver()); LLRemoteParcelInfoProcessor & processor = LLRemoteParcelInfoProcessor::instance(); processor.addObserver(LLUUID(TEST_PARCEL_ID), observer.get()); diff --git a/indra/test/io.cpp b/indra/test/io.cpp index 40243a8ad6..99b49c8b29 100644 --- a/indra/test/io.cpp +++ b/indra/test/io.cpp @@ -946,7 +946,7 @@ namespace tut typedef LLCloneIOFactory<LLPipeStringInjector> emitter_t; emitter_t* emitter = new emitter_t( new LLPipeStringInjector("suckers never play me")); - boost::shared_ptr<LLChainIOFactory> factory(emitter); + std::shared_ptr<LLChainIOFactory> factory(emitter); LLIOServerSocket* server = new LLIOServerSocket( mPool, mSocket, @@ -993,7 +993,7 @@ namespace tut LLPumpIO::chain_t chain; typedef LLCloneIOFactory<LLIOFuzz> emitter_t; emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); - boost::shared_ptr<LLChainIOFactory> factory(emitter); + std::shared_ptr<LLChainIOFactory> factory(emitter); LLIOServerSocket* server = new LLIOServerSocket( mPool, mSocket, @@ -1036,7 +1036,7 @@ namespace tut LLPumpIO::chain_t chain; typedef LLCloneIOFactory<LLIOFuzz> emitter_t; emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); - boost::shared_ptr<LLChainIOFactory> factory(emitter); + std::shared_ptr<LLChainIOFactory> factory(emitter); LLIOServerSocket* server = new LLIOServerSocket( mPool, mSocket, @@ -1079,7 +1079,7 @@ namespace tut LLPumpIO::chain_t chain; typedef LLCloneIOFactory<LLIOFuzz> emitter_t; emitter_t* emitter = new emitter_t(new LLIOFuzz(1000000)); - boost::shared_ptr<LLChainIOFactory> factory(emitter); + std::shared_ptr<LLChainIOFactory> factory(emitter); LLIOServerSocket* server = new LLIOServerSocket( mPool, mSocket, @@ -1120,7 +1120,7 @@ namespace tut LLPumpIO::chain_t chain; typedef LLCloneIOFactory<LLIOSleeper> sleeper_t; sleeper_t* sleeper = new sleeper_t(new LLIOSleeper); - boost::shared_ptr<LLChainIOFactory> factory(sleeper); + std::shared_ptr<LLChainIOFactory> factory(sleeper); LLIOServerSocket* server = new LLIOServerSocket( mPool, mSocket, diff --git a/indra/test/llevents_tut.cpp b/indra/test/llevents_tut.cpp index 17f64a4953..a38de71e48 100644 --- a/indra/test/llevents_tut.cpp +++ b/indra/test/llevents_tut.cpp @@ -368,10 +368,10 @@ void events_object::test<7>() LLEventStream bob("bob"); // should work, previous one unregistered LLEventStream bob1("bob", true);// allowed to tweak name ensure_equals("tweaked LLEventStream name", bob1.getName(), "bob1"); - std::vector<boost::shared_ptr<LLEventStream> > streams; + std::vector<std::shared_ptr<LLEventStream> > streams; for (int i = 2; i <= 10; ++i) { - streams.push_back(boost::shared_ptr<LLEventStream>(new LLEventStream("bob", true))); + streams.push_back(std::shared_ptr<LLEventStream>(new LLEventStream("bob", true))); } ensure_equals("last tweaked LLEventStream name", streams.back()->getName(), "bob10"); } diff --git a/indra/test/test.cpp b/indra/test/test.cpp index 94478a5263..f1c5991330 100644 --- a/indra/test/test.cpp +++ b/indra/test/test.cpp @@ -166,12 +166,12 @@ public: virtual void reset() { - boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset(); + std::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->reset(); } virtual void replay(std::ostream& out) { - boost::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out); + std::dynamic_pointer_cast<RecordToTempFile>(mRecorder)->replay(out); } private: @@ -185,7 +185,7 @@ class LLTestCallback : public chained_callback public: LLTestCallback(bool verbose_mode, std::ostream *stream, - boost::shared_ptr<LLReplayLog> replayer) : + std::shared_ptr<LLReplayLog> replayer) : mVerboseMode(verbose_mode), mTotalTests(0), mPassedTests(0), @@ -193,7 +193,7 @@ public: mSkippedTests(0), // By default, capture a shared_ptr to std::cout, with a no-op "deleter" // so that destroying the shared_ptr makes no attempt to delete std::cout. - mStream(boost::shared_ptr<std::ostream>(&std::cout, [](std::ostream*){})), + mStream(std::shared_ptr<std::ostream>(&std::cout, [](std::ostream*){})), mReplayer(replayer) { if (stream) @@ -207,7 +207,7 @@ public: // Allocate and assign in two separate steps, per Herb Sutter. // (Until we turn on C++11 support, have to wrap *stream with // boost::ref() due to lack of perfect forwarding.) - boost::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream))); + std::shared_ptr<std::ostream> pstream(new TeeStream(std::cout, boost::ref(*stream))); mStream = pstream; } } @@ -331,8 +331,8 @@ protected: int mPassedTests; int mFailedTests; int mSkippedTests; - boost::shared_ptr<std::ostream> mStream; - boost::shared_ptr<LLReplayLog> mReplayer; + std::shared_ptr<std::ostream> mStream; + std::shared_ptr<LLReplayLog> mReplayer; }; // TeamCity specific class which emits service messages @@ -342,7 +342,7 @@ class LLTCTestCallback : public LLTestCallback { public: LLTCTestCallback(bool verbose_mode, std::ostream *stream, - boost::shared_ptr<LLReplayLog> replayer) : + std::shared_ptr<LLReplayLog> replayer) : LLTestCallback(verbose_mode, stream, replayer) { } @@ -555,7 +555,7 @@ int main(int argc, char **argv) apr_status_t apr_err; const char* opt_arg = NULL; int opt_id = 0; - boost::scoped_ptr<llofstream> output; + std::unique_ptr<llofstream> output; const char *touch = NULL; while(true) @@ -614,7 +614,7 @@ int main(int argc, char **argv) // set up logging const char* LOGFAIL = getenv("LOGFAIL"); - boost::shared_ptr<LLReplayLog> replayer{boost::make_shared<LLReplayLog>()}; + std::shared_ptr<LLReplayLog> replayer{std::make_shared<LLReplayLog>()}; // Testing environment variables for both 'set' and 'not empty' allows a // user to suppress a pre-existing environment variable by forcing empty. diff --git a/indra/viewer_components/login/lllogin.h b/indra/viewer_components/login/lllogin.h index 051641ff59..de58ca0c29 100644 --- a/indra/viewer_components/login/lllogin.h +++ b/indra/viewer_components/login/lllogin.h @@ -121,7 +121,7 @@ public: private: class Impl; - boost::scoped_ptr<Impl> mImpl; + std::unique_ptr<Impl> mImpl; }; #endif // LL_LLLOGIN_H diff --git a/scripts/code_tools/modified_strings.py b/scripts/code_tools/modified_strings.py index e7a9d239dc..20ed1b0555 100644 --- a/scripts/code_tools/modified_strings.py +++ b/scripts/code_tools/modified_strings.py @@ -162,6 +162,8 @@ def make_translation_table(mod_tree, base_tree, lang, args): filename = mod_blob.path if mod_blob.type == "tree": # directory, skip continue + if args.files and os.path.basename(filename) not in args.files: + continue # process only the specified files if args.verbose: print(filename) @@ -325,9 +327,11 @@ if __name__ == "__main__": parser.add_argument("--deleted", action="store_true", default = False, help="show all translated entities which don't exist in english") parser.add_argument("--skip_spreadsheet", action="store_true", default = False, help="skip creating the translation spreadsheet") parser.add_argument("--rev", help="revision with modified strings, default HEAD", default="HEAD") - parser.add_argument("--rev_base", help="previous revision to compare against, default master", default="master") + parser.add_argument("--rev_base", help="previous revision to compare against, default main", default="main") parser.add_argument("--base_lang", help="base language, default en (normally leave unchanged - other values are only useful for testing)", default="en") parser.add_argument("--lang", help="target languages, or 'all_valid' or 'supported'; default is 'supported'", nargs="+", default = ["supported"]) + parser.add_argument("--files", help='list of files to process', metavar='F', type=str, nargs='*') + parser.add_argument("--outfile", help='name of the output file', type=str, nargs='?', default="SL_Translations.xlsx") args = parser.parse_args() cwd = os.getcwd() @@ -370,7 +374,7 @@ if __name__ == "__main__": print("Target language(s) are", ",".join(sorted(langs))) sys.stdout.flush() - outfile = "SL_Translations.xlsx" + outfile = args.outfile try: f = open(outfile,"a+") f.close() |