summaryrefslogtreecommitdiff
path: root/indra/newview/llinventoryfunctions.cpp
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-08-22 00:18:00 -0700
committerMerov Linden <merov@lindenlab.com>2014-08-22 00:18:00 -0700
commit6ab1e773d55b9dbe4a0af161ac194536a5892904 (patch)
treeed2b04c7898fb2516b511dc2d9a5f71da531016b /indra/newview/llinventoryfunctions.cpp
parent51e8b7fae6ff14c58bf32ef740a60386bc15baee (diff)
DD-122 : WIP : Raise error when trying to list something that is empty or has empty stock folders.
Diffstat (limited to 'indra/newview/llinventoryfunctions.cpp')
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp35
1 files changed, 29 insertions, 6 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index 8ea8e5998e..59fdb19d90 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -1454,17 +1454,40 @@ bool validate_marketplacelistings(LLInventoryCategory* cat, validation_callback_
type = (LLInventoryType::EType)(i);
}
}
- // If we have no items in there (only folders) -> all OK
+ // If we have no items in there (only folders or empty), analyze a bit further
if (count == 0)
{
- // We warn if there's really nothing in the folder (may be it's a mistake or an under construction listing)
- if ((cat_array->size() == 0) && cb)
+ if (cat_array->size() == 0)
{
- std::string message = indent + LLTrans::getString("Marketplace Validation Warning Empty") + cat->getName();
- cb(message,LLError::LEVEL_WARN);
+ // If this is an empty version folder (not even folders), raise an error
+ if (depth == 2)
+ {
+ result = false;
+ if (cb)
+ {
+ std::string message = indent + LLTrans::getString("Marketplace Validation Error Empty Version") + cat->getName();
+ cb(message,LLError::LEVEL_ERROR);
+ }
+ }
+ // If this is a legit but empty stock folder, raise an error
+ else if ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (depth > 2))
+ {
+ result = false;
+ if (cb)
+ {
+ std::string message = indent + LLTrans::getString("Marketplace Validation Error Empty Stock") + cat->getName();
+ cb(message,LLError::LEVEL_ERROR);
+ }
+ }
+ else if (cb)
+ {
+ // We warn if there's nothing in a regular folder (may be it's an under construction listing)
+ std::string message = indent + LLTrans::getString("Marketplace Validation Warning Empty") + cat->getName();
+ cb(message,LLError::LEVEL_WARN);
+ }
}
}
- // If we have one kind only, in the correct folder type at the right depth -> all OK
+ // If we have a single type of items of the right type in the right place, we're done
else if ((count == 1) && (((type == LLInventoryType::IT_COUNT) && (depth > 1)) || ((folder_type == LLFolderType::FT_MARKETPLACE_STOCK) && (depth > 2))))
{
// Done with that folder!