summaryrefslogtreecommitdiff
path: root/indra/newview/llteleporthistorystorage.cpp
diff options
context:
space:
mode:
authorSteven Bennetts <steve@lindenlab.com>2009-10-21 04:58:23 +0000
committerSteven Bennetts <steve@lindenlab.com>2009-10-21 04:58:23 +0000
commit6f41747bc4d8afcb2b19ac02295575031bcf9021 (patch)
tree1e83d8fcf7af6b9416b49bb46cb9e7cf15abffbc /indra/newview/llteleporthistorystorage.cpp
parent57fca109cae3105b6bc1319e9886c16631bc7374 (diff)
Merging revisions 2112-2128 of https://svn.aws.productengine.com/secondlife/pe/stable-2 into P:\svn\viewer-2.0.0, respecting ancestry
* Bugs: EXT-1605 EXT-1506 EXT-1663 EXT-1616 EXT-1599 EXT-1587 * Dev: EXT-748 EXT-1447 * IM Cleanup
Diffstat (limited to 'indra/newview/llteleporthistorystorage.cpp')
-rw-r--r--indra/newview/llteleporthistorystorage.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/indra/newview/llteleporthistorystorage.cpp b/indra/newview/llteleporthistorystorage.cpp
index a588153ca2..d3bbda1c72 100644
--- a/indra/newview/llteleporthistorystorage.cpp
+++ b/indra/newview/llteleporthistorystorage.cpp
@@ -93,14 +93,12 @@ void LLTeleportHistoryStorage::onTeleportHistoryChange()
addItem(item.mTitle, item.mGlobalPos);
save();
-
- mHistoryChangedSignal();
}
void LLTeleportHistoryStorage::purgeItems()
{
mItems.clear();
- mHistoryChangedSignal();
+ mHistoryChangedSignal(-1);
}
void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d& global_pos)
@@ -116,15 +114,16 @@ bool LLTeleportHistoryStorage::compareByTitleAndGlobalPos(const LLTeleportHistor
void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d& global_pos, const LLDate& date)
{
-
LLTeleportHistoryPersistentItem item(title, global_pos, date);
slurl_list_t::iterator item_iter = std::find_if(mItems.begin(), mItems.end(),
boost::bind(&LLTeleportHistoryStorage::compareByTitleAndGlobalPos, this, _1, item));
// If there is such item already, remove it, since new item is more recent
+ S32 removed_index = -1;
if (item_iter != mItems.end())
{
+ removed_index = item_iter - mItems.begin();
mItems.erase(item_iter);
}
@@ -141,9 +140,12 @@ void LLTeleportHistoryStorage::addItem(const std::string title, const LLVector3d
// If second to last item is more recent than last, then resort items
if (item_iter->mDate > item.mDate)
{
+ removed_index = -1;
std::sort(mItems.begin(), mItems.end(), LLSortItemsByDate());
}
}
+
+ mHistoryChangedSignal(removed_index);
}
void LLTeleportHistoryStorage::removeItem(S32 idx)
@@ -211,6 +213,8 @@ void LLTeleportHistoryStorage::load()
file.close();
std::sort(mItems.begin(), mItems.end(), LLSortItemsByDate());
+
+ mHistoryChangedSignal(-1);
}
void LLTeleportHistoryStorage::dump() const
@@ -234,7 +238,6 @@ boost::signals2::connection LLTeleportHistoryStorage::setHistoryChangedCallback(
}
void LLTeleportHistoryStorage::goToItem(S32 idx)
-
{
// Validate specified index.
if (idx < 0 || idx >= (S32)mItems.size())