summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-08-25 23:56:34 -0700
committerMerov Linden <merov@lindenlab.com>2014-08-25 23:56:34 -0700
commitd6defce1a1cad39c3a65e4ea1674f34c276d0aeb (patch)
tree424511f99069d685552e79ce1a2ab15318e8cb11 /indra/newview/llinventoryfunctions.cpp
parent4d752d31aa7c86631bd12e9fdd5d37c541d78929 (diff)
DD-19 : Print errors in bold, sort folders alphabetically, simplify log text when no errors
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 55333923f9..58a10fe180 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1353,6 +1353,11 @@ bool move_folder_to_marketplacelistings(LLInventoryCategory* inv_cat, const LLUU
// This function does no deletion of listings but a mere audit and raises issues to the user (through the
// optional callback cb). It also returns a boolean, true if things validate, false if issues are raised.
// The only inventory changes that are done is to move and sort folders containing no-copy items to stock folders.
+bool sort_alpha(const LLViewerInventoryCategory* cat1, const LLViewerInventoryCategory* cat2)
+{
+ return cat1->getName().compare(cat2->getName()) < 0;
+}
+
bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_t cb)
{
// Folder is valid unless issue is raised
@@ -1569,7 +1574,9 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
// Recursion : Perform the same validation on each nested folder
LLInventoryModel::cat_array_t cat_array_copy = *cat_array;
-
+ // Sort the folders in alphabetical order first
+ std::sort(cat_array_copy.begin(), cat_array_copy.end(), sort_alpha);
+
for (LLInventoryModel::cat_array_t::iterator iter = cat_array_copy.begin(); iter != cat_array_copy.end(); iter++)
{
LLInventoryCategory* category = *iter;