From 8d2f7a526545a10cd3669bf837a0b6f02cf5fe71 Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Mon, 15 Oct 2012 19:43:35 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system converted all remaining LLViewerStats to lltrace --- indra/newview/llgesturemgr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 66ca76bfb0..63ef8c3d21 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -1137,7 +1137,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, } else { - LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); + //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) -- cgit v1.2.3 From a52d203a4f1d2988e8ffba16258f3f132f22f56d Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Wed, 17 Oct 2012 20:00:07 -0700 Subject: SH-3405 WIP convert existing stats to lltrace system started conversion of llviewerassetstats removed old, dead LLViewerStats code made units tracing require units declaration clean up of units handling --- indra/newview/llgesturemgr.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 63ef8c3d21..27a29d3ace 100644 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -1137,8 +1137,6 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, } else { - //LLViewerStats::getInstance()->incStat( LLViewerStats::ST_DOWNLOAD_FAILED ); - if( LL_ERR_ASSET_REQUEST_NOT_IN_DATABASE == status || LL_ERR_FILE_EMPTY == status) { -- cgit v1.2.3 From e340009fc59d59e59b2e8d903a884acb76b178eb Mon Sep 17 00:00:00 2001 From: Richard Linden Date: Fri, 9 Aug 2013 17:11:19 -0700 Subject: second phase summer cleaning replace llinfos, lldebugs, etc with new LL_INFOS(), LL_DEBUGS(), etc. --- indra/newview/llgesturemgr.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index 876db96085..0b10fbb03f 100755 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -257,19 +257,19 @@ void LLGestureMgr::activateGestureWithAsset(const LLUUID& item_id, if( !gAssetStorage ) { - llwarns << "LLGestureMgr::activateGestureWithAsset without valid gAssetStorage" << llendl; + LL_WARNS() << "LLGestureMgr::activateGestureWithAsset without valid gAssetStorage" << LL_ENDL; return; } // If gesture is already active, nothing to do. if (isGestureActive(item_id)) { - llwarns << "Tried to loadGesture twice " << item_id << llendl; + LL_WARNS() << "Tried to loadGesture twice " << item_id << LL_ENDL; return; } // if (asset_id.isNull()) // { -// llwarns << "loadGesture() - gesture has no asset" << llendl; +// LL_WARNS() << "loadGesture() - gesture has no asset" << LL_ENDL; // return; // } @@ -305,7 +305,7 @@ void LLGestureMgr::deactivateGesture(const LLUUID& item_id) item_map_t::iterator it = mActive.find(base_item_id); if (it == mActive.end()) { - llwarns << "deactivateGesture for inactive gesture " << item_id << llendl; + LL_WARNS() << "deactivateGesture for inactive gesture " << item_id << LL_ENDL; return; } @@ -469,7 +469,7 @@ void LLGestureMgr::replaceGesture(const LLUUID& item_id, LLMultiGesture* new_ges item_map_t::iterator it = mActive.find(base_item_id); if (it == mActive.end()) { - llwarns << "replaceGesture for inactive gesture " << base_item_id << llendl; + LL_WARNS() << "replaceGesture for inactive gesture " << base_item_id << LL_ENDL; return; } @@ -511,7 +511,7 @@ void LLGestureMgr::replaceGesture(const LLUUID& item_id, const LLUUID& new_asset item_map_t::iterator it = LLGestureMgr::instance().mActive.find(base_item_id); if (it == mActive.end()) { - llwarns << "replaceGesture for inactive gesture " << base_item_id << llendl; + LL_WARNS() << "replaceGesture for inactive gesture " << base_item_id << LL_ENDL; return; } @@ -586,7 +586,7 @@ void LLGestureMgr::playGesture(LLMultiGesture* gesture) } default: { - llwarns << "Unknown gesture step type: " << step->getType() << llendl; + LL_WARNS() << "Unknown gesture step type: " << step->getType() << LL_ENDL; } } } @@ -907,8 +907,8 @@ void LLGestureMgr::stepGesture(LLMultiGesture* gesture) else if (gesture->mWaitTimer.getElapsedTimeF32() > MAX_WAIT_ANIM_SECS) { // we've waited too long for an animation - llinfos << "Waited too long for animations to stop, continuing gesture." - << llendl; + LL_INFOS() << "Waited too long for animations to stop, continuing gesture." + << LL_ENDL; gesture->mWaitingAnimations = FALSE; gesture->mCurrentStep++; } @@ -1129,7 +1129,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, } else { - llwarns << "Unable to load gesture" << llendl; + LL_WARNS() << "Unable to load gesture" << LL_ENDL; self.mActive.erase(item_id); @@ -1149,7 +1149,7 @@ void LLGestureMgr::onLoadComplete(LLVFS *vfs, LLDelayedGestureError::gestureFailedToLoad( item_id ); } - llwarns << "Problem loading gesture: " << status << llendl; + LL_WARNS() << "Problem loading gesture: " << status << LL_ENDL; LLGestureMgr::instance().mActive.erase(item_id); } @@ -1185,7 +1185,7 @@ void LLGestureMgr::onAssetLoadComplete(LLVFS *vfs, } default: { - llwarns << "Unexpected asset type: " << type << llendl; + LL_WARNS() << "Unexpected asset type: " << type << LL_ENDL; // We don't want to return from this callback without // an animation or sound callback being fired @@ -1240,7 +1240,7 @@ bool LLGestureMgr::hasLoadingAssets(LLMultiGesture* gesture) } default: { - llwarns << "Unknown gesture step type: " << step->getType() << llendl; + LL_WARNS() << "Unknown gesture step type: " << step->getType() << LL_ENDL; } } } @@ -1322,7 +1322,7 @@ void LLGestureMgr::removeObserver(LLGestureManagerObserver* observer) // from the list. void LLGestureMgr::notifyObservers() { - lldebugs << "LLGestureMgr::notifyObservers" << llendl; + LL_DEBUGS() << "LLGestureMgr::notifyObservers" << LL_ENDL; for(std::vector::iterator iter = mObservers.begin(); iter != mObservers.end(); -- cgit v1.2.3 From ec8bac9c2616e3612d2dffe4d90fef308934347e Mon Sep 17 00:00:00 2001 From: "maxim@mnikolenko" Date: Thu, 23 Jan 2014 12:01:16 +0200 Subject: MAINT-3119 FIXED Return common chars for triggers that matches the prefix. --- indra/newview/llgesturemgr.cpp | 62 ++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 59 insertions(+), 3 deletions(-) (limited to 'indra/newview/llgesturemgr.cpp') diff --git a/indra/newview/llgesturemgr.cpp b/indra/newview/llgesturemgr.cpp index b56c34573d..2ae13b1b2f 100755 --- a/indra/newview/llgesturemgr.cpp +++ b/indra/newview/llgesturemgr.cpp @@ -1339,6 +1339,7 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str) { S32 in_len = in_str.length(); + //return whole trigger, if received text equals to it item_map_t::iterator it; for (it = mActive.begin(); it != mActive.end(); ++it) { @@ -1346,7 +1347,24 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str) if (gesture) { const std::string& trigger = gesture->getTrigger(); - + if (!LLStringUtil::compareInsensitive(in_str, trigger)) + { + *out_str = trigger; + return TRUE; + } + } + } + + //return common chars, if more than one trigger matches the prefix + std::string rest_of_match = ""; + std::string buf = ""; + for (it = mActive.begin(); it != mActive.end(); ++it) + { + LLMultiGesture* gesture = (*it).second; + if (gesture) + { + const std::string& trigger = gesture->getTrigger(); + if (in_len > (S32)trigger.length()) { // too short, bail out @@ -1357,11 +1375,49 @@ BOOL LLGestureMgr::matchPrefix(const std::string& in_str, std::string* out_str) LLStringUtil::truncate(trigger_trunc, in_len); if (!LLStringUtil::compareInsensitive(in_str, trigger_trunc)) { - *out_str = trigger; - return TRUE; + if (rest_of_match.compare("") == 0) + { + rest_of_match = trigger.substr(in_str.size()); + } + std::string cur_rest_of_match = trigger.substr(in_str.size()); + buf = ""; + S32 i=0; + + while (i