summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
Diffstat (limited to 'indra')
-rwxr-xr-xindra/llui/llurlentry.cpp5
-rwxr-xr-xindra/llui/llurlregistry.cpp4
-rwxr-xr-xindra/llui/tests/llurlentry_test.cpp14
-rwxr-xr-xindra/newview/llfavoritesbar.cpp25
-rwxr-xr-xindra/newview/llfavoritesbar.h1
5 files changed, 36 insertions, 13 deletions
diff --git a/indra/llui/llurlentry.cpp b/indra/llui/llurlentry.cpp
index 7f6cc22e90..576fff5fb2 100755
--- a/indra/llui/llurlentry.cpp
+++ b/indra/llui/llurlentry.cpp
@@ -449,7 +449,10 @@ std::string LLUrlEntrySLURL::getLocation(const std::string &url) const
//
LLUrlEntrySecondlifeURL::LLUrlEntrySecondlifeURL()
{
- mPattern = boost::regex("https?://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?\\/\\S*",
+ mPattern = boost::regex("((http://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com)"
+ "|"
+ "(https://([-\\w\\.]*\\.)?(secondlife|lindenlab)\\.com(:\\d{1,5})?))"
+ "\\/\\S*",
boost::regex::perl|boost::regex::icase);
mIcon = "Hand";
diff --git a/indra/llui/llurlregistry.cpp b/indra/llui/llurlregistry.cpp
index 4f389a0c12..23c6d5a954 100755
--- a/indra/llui/llurlregistry.cpp
+++ b/indra/llui/llurlregistry.cpp
@@ -215,7 +215,6 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
// did we find a match? if so, return its details in the match object
if (match_entry)
{
-
// Skip if link is an email with an empty username (starting with @). See MAINT-5371.
if (match_start > 0 && text.substr(match_start - 1, 1) == "@")
return false;
@@ -224,7 +223,8 @@ bool LLUrlRegistry::findUrl(const std::string &text, LLUrlMatch &match, const LL
std::string url = text.substr(match_start, match_end - match_start + 1);
LLUrlEntryBase *stripped_entry = NULL;
- if(match_entry != mUrlEntryNoLink && LLStringUtil::containsNonprintable(url))
+ if((match_entry != mUrlEntryNoLink) && (match_entry != mUrlEntryHTTPLabel) && (match_entry !=mUrlEntrySLLabel)
+ && LLStringUtil::containsNonprintable(url))
{
LLStringUtil::stripNonprintable(url);
diff --git a/indra/llui/tests/llurlentry_test.cpp b/indra/llui/tests/llurlentry_test.cpp
index 96e94c0f80..dde54c78c4 100755
--- a/indra/llui/tests/llurlentry_test.cpp
+++ b/indra/llui/tests/llurlentry_test.cpp
@@ -838,17 +838,21 @@ namespace tut
"search something https://marketplace.secondlife.com/products/search on marketplace and test the https",
"https://marketplace.secondlife.com/products/search");
- testRegex("match urls with port", url,
- "let's specify some port http://secondlife.com:888/status",
- "http://secondlife.com:888/status");
+ testRegex("match HTTPS urls with port", url,
+ "let's specify some port https://secondlife.com:888/status",
+ "https://secondlife.com:888/status");
+
+ testRegex("don't match HTTP urls with port", url,
+ "let's specify some port for HTTP http://secondlife.com:888/status",
+ "");
testRegex("don't match urls w/o protocol", url,
"looks like an url something www.marketplace.secondlife.com/products but no https prefix",
"");
testRegex("but with a protocol www is fine", url,
- "so let's add a protocol http://www.marketplace.secondlife.com:8888/products",
- "http://www.marketplace.secondlife.com:8888/products");
+ "so let's add a protocol https://www.marketplace.secondlife.com:8888/products",
+ "https://www.marketplace.secondlife.com:8888/products");
testRegex("don't match urls w/o protocol", url,
"and even no www something secondlife.com/status",
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 8f3eaaa207..d6b86cd746 100755
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -655,11 +655,12 @@ void LLFavoritesBarCtrl::changed(U32 mask)
LLInventoryModel::cat_array_t cats;
LLIsType is_type(LLAssetType::AT_LANDMARK);
gInventory.collectDescendentsIf(mFavoriteFolderId, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
-
+
for (LLInventoryModel::item_array_t::iterator i = items.begin(); i != items.end(); ++i)
{
LLFavoritesOrderStorage::instance().getSLURL((*i)->getAssetUUID());
}
+
updateButtons();
if (!mItemsChangedTimer.getStarted())
{
@@ -751,7 +752,11 @@ void LLFavoritesBarCtrl::updateButtons()
if(mGetPrevItems)
{
- LLFavoritesOrderStorage::instance().mPrevFavorites = mItems;
+ for (LLInventoryModel::item_array_t::iterator it = mItems.begin(); it != mItems.end(); it++)
+ {
+ LLFavoritesOrderStorage::instance().mFavoriteNames[(*it)->getUUID()]= (*it)->getName();
+ }
+ LLFavoritesOrderStorage::instance().mPrevFavorites = mItems;
mGetPrevItems = false;
}
@@ -778,7 +783,7 @@ void LLFavoritesBarCtrl::updateButtons()
const LLViewerInventoryItem *item = mItems[first_changed_item_index].get();
if (item)
{
- // an child's order and mItems should be same
+ // an child's order and mItems should be same
if (button->getLandmarkId() != item->getUUID() // sort order has been changed
|| button->getLabelSelected() != item->getName() // favorite's name has been changed
|| button->getRect().mRight < rightest_point) // favbar's width has been changed
@@ -1783,10 +1788,20 @@ BOOL LLFavoritesOrderStorage::saveFavoritesRecord(bool pref_changed)
gInventory.collectDescendentsIf(favorite_folder, cats, items, LLInventoryModel::EXCLUDE_TRASH, is_type);
std::sort(items.begin(), items.end(), LLFavoritesSort());
+ bool name_changed = false;
+
+ for (LLInventoryModel::item_array_t::iterator it = items.begin(); it != items.end(); it++)
+ {
+ if(mFavoriteNames[(*it)->getUUID()] != ((*it)->getName()))
+ {
+ mFavoriteNames[(*it)->getUUID()] = (*it)->getName();
+ name_changed = true;
+ }
+ }
- if((items != mPrevFavorites) || pref_changed)
+ if((items != mPrevFavorites) || name_changed || pref_changed)
{
- std::string filename = getStoredFavoritesFilename();
+ std::string filename = getStoredFavoritesFilename();
if (!filename.empty())
{
llifstream in_file;
diff --git a/indra/newview/llfavoritesbar.h b/indra/newview/llfavoritesbar.h
index 66fc8b2ae7..846d62227a 100755
--- a/indra/newview/llfavoritesbar.h
+++ b/indra/newview/llfavoritesbar.h
@@ -218,6 +218,7 @@ public:
const static S32 NO_INDEX;
static bool mSaveOnExit;
bool mUpdateRequired;
+ std::map<LLUUID,std::string> mFavoriteNames;
private:
friend class LLSingleton<LLFavoritesOrderStorage>;