Silly git, that's not how merges work!
Fix automatic merge errors Also fix some other compile errors
This commit is contained in:
@@ -530,15 +530,6 @@ LLUpdateAppearanceOnDestroy::~LLUpdateAppearanceOnDestroy()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LLRequestServerAppearanceUpdateOnDestroy::~LLRequestServerAppearanceUpdateOnDestroy()
|
|
||||||
{
|
|
||||||
LL_DEBUGS("Avatar") << "ATT requesting server appearance update" << LL_ENDL;
|
|
||||||
if (!LLApp::isExiting())
|
|
||||||
{
|
|
||||||
LLAppearanceMgr::instance().requestServerAppearanceUpdate();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
U32 LLUpdateAppearanceOnDestroy::sActiveCallbacks = 0;
|
U32 LLUpdateAppearanceOnDestroy::sActiveCallbacks = 0;
|
||||||
|
|
||||||
LLUpdateAppearanceAndEditWearableOnDestroy::LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id):
|
LLUpdateAppearanceAndEditWearableOnDestroy::LLUpdateAppearanceAndEditWearableOnDestroy(const LLUUID& item_id):
|
||||||
|
|||||||
@@ -321,15 +321,6 @@ private:
|
|||||||
nullary_func_t mPostUpdateFunc;
|
nullary_func_t mPostUpdateFunc;
|
||||||
};
|
};
|
||||||
|
|
||||||
class LLRequestServerAppearanceUpdateOnDestroy: public LLInventoryCallback
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
LLRequestServerAppearanceUpdateOnDestroy() {}
|
|
||||||
~LLRequestServerAppearanceUpdateOnDestroy();
|
|
||||||
|
|
||||||
/* virtual */ void fire(const LLUUID& item_id) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.1)
|
// [SL:KB] - Patch: Appearance-SyncAttach | Checked: 2010-08-31 (Catznip-2.1)
|
||||||
class LLUpdateAppearanceAndEditWearableOnDestroy: public LLInventoryCallback
|
class LLUpdateAppearanceAndEditWearableOnDestroy: public LLInventoryCallback
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -693,12 +693,12 @@ struct LLAttachObject : public inventory_panel_listener_t
|
|||||||
|
|
||||||
void init_object_inventory_panel_actions(LLPanelObjectInventory *panel)
|
void init_object_inventory_panel_actions(LLPanelObjectInventory *panel)
|
||||||
{
|
{
|
||||||
(new LLBindMemberListener(panel, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLPanelObjectInventory::getRootFolder, panel), _2)));
|
(new LLBindMemberListener(panel, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLPanelObjectInventory::getRootFolder, panel), _2, true)));
|
||||||
}
|
}
|
||||||
|
|
||||||
void init_inventory_actions(LLPanelMainInventory *floater)
|
void init_inventory_actions(LLPanelMainInventory *floater)
|
||||||
{
|
{
|
||||||
(new LLBindMemberListener(floater, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLPanelMainInventory::getRootFolder, floater), _2)));
|
(new LLBindMemberListener(floater, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLPanelMainInventory::getRootFolder, floater), _2, true)));
|
||||||
(new LLBindMemberListener(floater, "Inventory.CloseAllFolders", boost::bind(&LLInventoryPanel::closeAllFolders, boost::bind(&LLPanelMainInventory::getPanel, floater))));
|
(new LLBindMemberListener(floater, "Inventory.CloseAllFolders", boost::bind(&LLInventoryPanel::closeAllFolders, boost::bind(&LLPanelMainInventory::getPanel, floater))));
|
||||||
(new LLBindMemberListener(floater, "Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "", LLFolderType::FT_TRASH)));
|
(new LLBindMemberListener(floater, "Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "", LLFolderType::FT_TRASH)));
|
||||||
(new LLBindMemberListener(floater, "Inventory.DoCreate", boost::bind(&do_create, &gInventory, boost::bind(&LLPanelMainInventory::getPanel, floater), _2, (LLFolderBridge*)0)));
|
(new LLBindMemberListener(floater, "Inventory.DoCreate", boost::bind(&do_create, &gInventory, boost::bind(&LLPanelMainInventory::getPanel, floater), _2, (LLFolderBridge*)0)));
|
||||||
@@ -711,7 +711,7 @@ void init_inventory_actions(LLPanelMainInventory *floater)
|
|||||||
|
|
||||||
void init_inventory_panel_actions(LLInventoryPanel *panel)
|
void init_inventory_panel_actions(LLInventoryPanel *panel)
|
||||||
{
|
{
|
||||||
(new LLBindMemberListener(panel, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLInventoryPanel::getRootFolder, panel), _2)));
|
(new LLBindMemberListener(panel, "Inventory.DoToSelected", boost::bind(&LLInventoryAction::doToSelected, boost::bind(&LLInventoryPanel::getRootFolder, panel), _2, true)));
|
||||||
(new LLAttachObject())->registerListener(panel, "Inventory.AttachObject");
|
(new LLAttachObject())->registerListener(panel, "Inventory.AttachObject");
|
||||||
(new LLBindMemberListener(panel, "Inventory.CloseAllFolders", boost::bind(&LLInventoryPanel::closeAllFolders, panel)));
|
(new LLBindMemberListener(panel, "Inventory.CloseAllFolders", boost::bind(&LLInventoryPanel::closeAllFolders, panel)));
|
||||||
(new LLBindMemberListener(panel, "Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH)));
|
(new LLBindMemberListener(panel, "Inventory.EmptyTrash", boost::bind(&LLInventoryModel::emptyFolderType, &gInventory, "ConfirmEmptyTrash", LLFolderType::FT_TRASH)));
|
||||||
|
|||||||
@@ -1203,13 +1203,13 @@ LLInventoryObject* LLInvFVBridge::getInventoryObject() const
|
|||||||
LLInventoryModel* LLInvFVBridge::getInventoryModel() const
|
LLInventoryModel* LLInvFVBridge::getInventoryModel() const
|
||||||
{
|
{
|
||||||
LLInventoryPanel* panel = mInventoryPanel.get();
|
LLInventoryPanel* panel = mInventoryPanel.get();
|
||||||
return panel ? panel->getModel() : NULL;
|
return panel ? panel->getModel() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
LLInventoryFilter* LLInvFVBridge::getInventoryFilter() const
|
LLInventoryFilter* LLInvFVBridge::getInventoryFilter() const
|
||||||
{
|
{
|
||||||
LLInventoryPanel* panel = mInventoryPanel.get();
|
LLInventoryPanel* panel = mInventoryPanel.get();
|
||||||
return panel ? panel->getFilter() : NULL;
|
return panel ? &panel->getFilter() : nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOL LLInvFVBridge::isItemInTrash() const
|
BOOL LLInvFVBridge::isItemInTrash() const
|
||||||
@@ -3621,7 +3621,7 @@ void LLFolderBridge::perform_pasteFromClipboard(bool only_copies)
|
|||||||
// move_inventory_item() is not enough, as we have to update inventory locally too
|
// move_inventory_item() is not enough, as we have to update inventory locally too
|
||||||
if (LLAssetType::AT_CATEGORY == obj->getType())
|
if (LLAssetType::AT_CATEGORY == obj->getType())
|
||||||
{
|
{
|
||||||
LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *) model->getCategory(item_id);
|
LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *)model->getCategory(item_id);
|
||||||
llassert(vicat);
|
llassert(vicat);
|
||||||
if (vicat)
|
if (vicat)
|
||||||
{
|
{
|
||||||
@@ -3673,7 +3673,7 @@ void LLFolderBridge::perform_pasteFromClipboard(bool only_copies)
|
|||||||
// Do a "copy" to "paste" a regular copy clipboard
|
// Do a "copy" to "paste" a regular copy clipboard
|
||||||
if (LLAssetType::AT_CATEGORY == obj->getType())
|
if (LLAssetType::AT_CATEGORY == obj->getType())
|
||||||
{
|
{
|
||||||
LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *) model->getCategory(item_id);
|
LLViewerInventoryCategory* vicat = (LLViewerInventoryCategory *)model->getCategory(item_id);
|
||||||
llassert(vicat);
|
llassert(vicat);
|
||||||
if (vicat)
|
if (vicat)
|
||||||
{
|
{
|
||||||
@@ -3687,7 +3687,7 @@ void LLFolderBridge::perform_pasteFromClipboard(bool only_copies)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// [SL:KB] - Patch: Inventory-Links | Checked: 2010-04-12 (Catznip-2.2.0a) | Added: Catznip-2.0.0a
|
// [SL:KB] - Patch: Inventory-Links | Checked: 2010-04-12 (Catznip-2.2.0a) | Added: Catznip-2.0.0a
|
||||||
else if (!move_is_into_marketplacelistings && !only_copies && LLAssetType::lookupIsLinkType(item->getActualType()))
|
else if (!move_is_into_marketplacelistings && !only_copies && LLAssetType::lookupIsLinkType(item->getActualType()))
|
||||||
{
|
{
|
||||||
link_inventory_object(
|
link_inventory_object(
|
||||||
@@ -3695,7 +3695,7 @@ void LLFolderBridge::perform_pasteFromClipboard(bool only_copies)
|
|||||||
item,
|
item,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
// [/SL:KB]
|
// [/SL:KB]
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
LLViewerInventoryItem* viitem = dynamic_cast<LLViewerInventoryItem*>(item);
|
LLViewerInventoryItem* viitem = dynamic_cast<LLViewerInventoryItem*>(item);
|
||||||
@@ -3723,6 +3723,8 @@ void LLFolderBridge::perform_pasteFromClipboard(bool only_copies)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
// Change mode to copy for next paste
|
// Change mode to copy for next paste
|
||||||
LLInventoryClipboard::instance().setCutMode(false);
|
LLInventoryClipboard::instance().setCutMode(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -49,18 +49,18 @@
|
|||||||
#include "lltrans.h"
|
#include "lltrans.h"
|
||||||
|
|
||||||
LLInventoryFilter::FilterOps::FilterOps(const Params& p)
|
LLInventoryFilter::FilterOps::FilterOps(const Params& p)
|
||||||
: mFilterObjectTypes(p.object_types),
|
: mFilterTypes(p.types),
|
||||||
mFilterCategoryTypes(p.category_types),
|
mFilterObjectTypes(p.object_types),
|
||||||
mFilterWearableTypes(p.wearable_types),
|
mFilterWearableTypes(p.wearable_types),
|
||||||
|
mFilterCategoryTypes(p.category_types),
|
||||||
|
mFilterLinks(p.links),
|
||||||
|
mFilterUUID(p.uuid),
|
||||||
mMinDate(p.date_range.min_date),
|
mMinDate(p.date_range.min_date),
|
||||||
mMaxDate(p.date_range.max_date),
|
mMaxDate(p.date_range.max_date),
|
||||||
mHoursAgo(p.hours_ago),
|
mHoursAgo(p.hours_ago),
|
||||||
mDateSearchDirection(p.date_search_direction),
|
mDateSearchDirection(p.date_search_direction),
|
||||||
mShowFolderState(p.show_folder_state),
|
mShowFolderState(p.show_folder_state),
|
||||||
mPermissions(p.permissions),
|
mPermissions(p.permissions),
|
||||||
mFilterTypes(p.types),
|
|
||||||
mFilterUUID(p.uuid),
|
|
||||||
mFilterLinks(p.links),
|
|
||||||
mFilterWornItems(p.worn_items)
|
mFilterWornItems(p.worn_items)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -69,13 +69,10 @@ LLInventoryFilter::FilterOps::FilterOps(const Params& p)
|
|||||||
/// Class LLInventoryFilter
|
/// Class LLInventoryFilter
|
||||||
///----------------------------------------------------------------------------
|
///----------------------------------------------------------------------------
|
||||||
LLInventoryFilter::LLInventoryFilter(const Params& p)
|
LLInventoryFilter::LLInventoryFilter(const Params& p)
|
||||||
: mName(p.name),
|
: mFilterOps(p.filter_ops),
|
||||||
mFilterBehavior(FILTER_NONE),
|
|
||||||
mFilterOps(p.filter_ops),
|
|
||||||
mFilterSubString(p.substring),
|
mFilterSubString(p.substring),
|
||||||
|
mName(p.name),
|
||||||
mFilterModified(FILTER_NONE),
|
mFilterModified(FILTER_NONE),
|
||||||
mFilterOps(),
|
|
||||||
mFilterSubString(),
|
|
||||||
mCurrentGeneration(0),
|
mCurrentGeneration(0),
|
||||||
mFirstRequiredGeneration(0),
|
mFirstRequiredGeneration(0),
|
||||||
mFirstSuccessGeneration(0)
|
mFirstSuccessGeneration(0)
|
||||||
@@ -1305,18 +1302,6 @@ bool LLInventoryFilter::showAllResults() const
|
|||||||
return hasFilterString();
|
return hasFilterString();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool LLInventoryFilter::areDateLimitsSet()
|
|
||||||
{
|
|
||||||
return mFilterOps.mMinDate != time_min()
|
|
||||||
|| mFilterOps.mMaxDate != time_max()
|
|
||||||
|| mFilterOps.mHoursAgo != 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool LLInventoryFilter::showAllResults() const
|
|
||||||
{
|
|
||||||
return hasFilterString();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
bool LLInventoryFilter::FilterOps::DateRange::validateBlock( bool emit_errors /*= true*/ ) const
|
bool LLInventoryFilter::FilterOps::DateRange::validateBlock( bool emit_errors /*= true*/ ) const
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ public:
|
|||||||
mMaxDate;
|
mMaxDate;
|
||||||
U32 mHoursAgo;
|
U32 mHoursAgo;
|
||||||
U32 mDateSearchDirection;
|
U32 mDateSearchDirection;
|
||||||
|
|
||||||
EFolderShow mShowFolderState;
|
EFolderShow mShowFolderState;
|
||||||
PermissionMask mPermissions;
|
PermissionMask mPermissions;
|
||||||
|
|
||||||
|
|||||||
@@ -165,8 +165,8 @@ LLUUID getStartFolder(const std::string& start_folder)
|
|||||||
const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(start_folder);
|
const LLFolderType::EType preferred_type = LLViewerFolderType::lookupTypeFromNewCategoryName(start_folder);
|
||||||
|
|
||||||
return (preferred_type != LLFolderType::FT_NONE)
|
return (preferred_type != LLFolderType::FT_NONE)
|
||||||
? gInventory.findCategoryUUIDForType(preferred_type, false, false)
|
? gInventory.findCategoryUUIDForType(preferred_type, false)
|
||||||
: gInventory.getCategory(static_cast<LLUUID>(start_folder)) ? static_cast<LLUUID>(mStartFolder) // Singu Note: if start folder is an id of a folder, use it
|
: gInventory.getCategory(static_cast<LLUUID>(start_folder)) ? static_cast<LLUUID>(start_folder) // Singu Note: if start folder is an id of a folder, use it
|
||||||
: LLUUID::null;
|
: LLUUID::null;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -443,7 +443,7 @@ void LLInventoryPanel::setFilterSubString(const std::string& string)
|
|||||||
if (string.empty())
|
if (string.empty())
|
||||||
{
|
{
|
||||||
// Unlike v3, do not clear other filters. Text is independent.
|
// Unlike v3, do not clear other filters. Text is independent.
|
||||||
getFilter()->setFilterSubString(LLStringUtil::null);
|
getFilter().setFilterSubString(LLStringUtil::null);
|
||||||
getRootFolder()->restoreFolderState();
|
getRootFolder()->restoreFolderState();
|
||||||
LLOpenFoldersWithSelection opener;
|
LLOpenFoldersWithSelection opener;
|
||||||
getRootFolder()->applyFunctorRecursively(opener);
|
getRootFolder()->applyFunctorRecursively(opener);
|
||||||
@@ -1296,7 +1296,7 @@ void LLInventoryPanel::updateSelection()
|
|||||||
|
|
||||||
namespace LLInventoryAction
|
namespace LLInventoryAction
|
||||||
{
|
{
|
||||||
bool doToSelected(LLFolderView* root, std::string action);
|
bool doToSelected(LLFolderView* root, std::string action, BOOL user_confirm = TRUE);
|
||||||
}
|
}
|
||||||
|
|
||||||
void LLInventoryPanel::doToSelected(const LLSD& userdata)
|
void LLInventoryPanel::doToSelected(const LLSD& userdata)
|
||||||
|
|||||||
@@ -44,8 +44,7 @@
|
|||||||
#include "llviewerregion.h"
|
#include "llviewerregion.h"
|
||||||
#include "hippogridmanager.h"
|
#include "hippogridmanager.h"
|
||||||
|
|
||||||
#include "json/reader.h" // JSON
|
#include "llsdutil.h"
|
||||||
#include "json/writer.h" // JSON
|
|
||||||
|
|
||||||
//
|
//
|
||||||
// Helpers
|
// Helpers
|
||||||
@@ -248,11 +247,10 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value root;
|
LLSD result;
|
||||||
Json::Reader reader;
|
if (LLSDSerialize::fromNotation(result, strstrm, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
|
||||||
if (!reader.parse(body, root))
|
|
||||||
{
|
{
|
||||||
log_SLM_warning("Get /listings", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body);
|
log_SLM_warning("Get /listings", getStatus(), "Json parsing failed", LLStringUtil::null, body);
|
||||||
LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_FAILED);
|
LLMarketplaceData::instance().setSLMDataFetched(MarketplaceFetchCodes::MARKET_FETCH_FAILED);
|
||||||
update_marketplace_category(mExpectedFolderId, false);
|
update_marketplace_category(mExpectedFolderId, false);
|
||||||
gInventory.notifyObservers();
|
gInventory.notifyObservers();
|
||||||
@@ -262,18 +260,18 @@ public:
|
|||||||
log_SLM_infos("Get /listings", getStatus(), body);
|
log_SLM_infos("Get /listings", getStatus(), body);
|
||||||
|
|
||||||
// Extract the info from the Json string
|
// Extract the info from the Json string
|
||||||
Json::ValueIterator it = root["listings"].begin();
|
auto it = result["listings"].beginArray();
|
||||||
|
|
||||||
while (it != root["listings"].end())
|
while (it != result["listings"].endArray())
|
||||||
{
|
{
|
||||||
Json::Value listing = *it;
|
auto listing = *it;
|
||||||
|
|
||||||
int listing_id = listing["id"].asInt();
|
int listing_id = listing["id"].asInteger();
|
||||||
bool is_listed = listing["is_listed"].asBool();
|
bool is_listed = listing["is_listed"].asBoolean();
|
||||||
std::string edit_url = listing["edit_url"].asString();
|
std::string edit_url = listing["edit_url"].asString();
|
||||||
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
||||||
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
||||||
int count = listing["inventory_info"]["count_on_hand"].asInt();
|
int count = listing["inventory_info"]["count_on_hand"].asInteger();
|
||||||
|
|
||||||
LLUUID folder_id(folder_uuid_string);
|
LLUUID folder_id(folder_uuid_string);
|
||||||
LLUUID version_id(version_uuid_string);
|
LLUUID version_id(version_uuid_string);
|
||||||
@@ -322,11 +320,10 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value root;
|
LLSD result;
|
||||||
Json::Reader reader;
|
if (LLSDSerialize::fromNotation(result, strstrm, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
|
||||||
if (!reader.parse(body, root))
|
|
||||||
{
|
{
|
||||||
log_SLM_warning("Post /listings", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body);
|
log_SLM_warning("Post /listings", getStatus(), "Json parsing failed", LLStringUtil::null, body);
|
||||||
update_marketplace_category(mExpectedFolderId, false);
|
update_marketplace_category(mExpectedFolderId, false);
|
||||||
gInventory.notifyObservers();
|
gInventory.notifyObservers();
|
||||||
return;
|
return;
|
||||||
@@ -335,18 +332,18 @@ public:
|
|||||||
log_SLM_infos("Post /listings", getStatus(), body);
|
log_SLM_infos("Post /listings", getStatus(), body);
|
||||||
|
|
||||||
// Extract the info from the Json string
|
// Extract the info from the Json string
|
||||||
Json::ValueIterator it = root["listings"].begin();
|
auto it = result["listings"].beginArray();
|
||||||
|
|
||||||
while (it != root["listings"].end())
|
while (it != result["listings"].endArray())
|
||||||
{
|
{
|
||||||
Json::Value listing = *it;
|
auto listing = *it;
|
||||||
|
|
||||||
int listing_id = listing["id"].asInt();
|
int listing_id = listing["id"].asInteger();
|
||||||
bool is_listed = listing["is_listed"].asBool();
|
bool is_listed = listing["is_listed"].asBoolean();
|
||||||
std::string edit_url = listing["edit_url"].asString();
|
std::string edit_url = listing["edit_url"].asString();
|
||||||
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
||||||
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
||||||
int count = listing["inventory_info"]["count_on_hand"].asInt();
|
int count = listing["inventory_info"]["count_on_hand"].asInteger();
|
||||||
|
|
||||||
LLUUID folder_id(folder_uuid_string);
|
LLUUID folder_id(folder_uuid_string);
|
||||||
LLUUID version_id(version_uuid_string);
|
LLUUID version_id(version_uuid_string);
|
||||||
@@ -397,11 +394,10 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value root;
|
LLSD result;
|
||||||
Json::Reader reader;
|
if (LLSDSerialize::fromNotation(result, strstrm, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
|
||||||
if (!reader.parse(body, root))
|
|
||||||
{
|
{
|
||||||
log_SLM_warning("Get /listing", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body);
|
log_SLM_warning("Get /listing", getStatus(), "Json parsing failed", LLStringUtil::null, body);
|
||||||
update_marketplace_category(mExpectedFolderId, false);
|
update_marketplace_category(mExpectedFolderId, false);
|
||||||
gInventory.notifyObservers();
|
gInventory.notifyObservers();
|
||||||
return;
|
return;
|
||||||
@@ -410,18 +406,18 @@ public:
|
|||||||
log_SLM_infos("Get /listing", getStatus(), body);
|
log_SLM_infos("Get /listing", getStatus(), body);
|
||||||
|
|
||||||
// Extract the info from the Json string
|
// Extract the info from the Json string
|
||||||
Json::ValueIterator it = root["listings"].begin();
|
auto it = result["listings"].beginArray();
|
||||||
|
|
||||||
while (it != root["listings"].end())
|
while (it != result["listings"].endArray())
|
||||||
{
|
{
|
||||||
Json::Value listing = *it;
|
auto listing = *it;
|
||||||
|
|
||||||
int listing_id = listing["id"].asInt();
|
int listing_id = listing["id"].asInteger();
|
||||||
bool is_listed = listing["is_listed"].asBool();
|
bool is_listed = listing["is_listed"].asBoolean();
|
||||||
std::string edit_url = listing["edit_url"].asString();
|
std::string edit_url = listing["edit_url"].asString();
|
||||||
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
||||||
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
||||||
int count = listing["inventory_info"]["count_on_hand"].asInt();
|
int count = listing["inventory_info"]["count_on_hand"].asInteger();
|
||||||
|
|
||||||
LLUUID folder_id(folder_uuid_string);
|
LLUUID folder_id(folder_uuid_string);
|
||||||
LLUUID version_id(version_uuid_string);
|
LLUUID version_id(version_uuid_string);
|
||||||
@@ -473,11 +469,10 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value root;
|
LLSD result;
|
||||||
Json::Reader reader;
|
if (LLSDSerialize::fromNotation(result, strstrm, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
|
||||||
if (!reader.parse(body, root))
|
|
||||||
{
|
{
|
||||||
log_SLM_warning("Put /listing", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body);
|
log_SLM_warning("Put /listing", getStatus(), "Json parsing failed", LLStringUtil::null, body);
|
||||||
update_marketplace_category(mExpectedFolderId, false);
|
update_marketplace_category(mExpectedFolderId, false);
|
||||||
gInventory.notifyObservers();
|
gInventory.notifyObservers();
|
||||||
return;
|
return;
|
||||||
@@ -486,18 +481,18 @@ public:
|
|||||||
log_SLM_infos("Put /listing", getStatus(), body);
|
log_SLM_infos("Put /listing", getStatus(), body);
|
||||||
|
|
||||||
// Extract the info from the Json string
|
// Extract the info from the Json string
|
||||||
Json::ValueIterator it = root["listings"].begin();
|
auto it = result["listings"].beginArray();
|
||||||
|
|
||||||
while (it != root["listings"].end())
|
while (it != result["listings"].endArray())
|
||||||
{
|
{
|
||||||
Json::Value listing = *it;
|
auto listing = *it;
|
||||||
|
|
||||||
int listing_id = listing["id"].asInt();
|
int listing_id = listing["id"].asInteger();
|
||||||
bool is_listed = listing["is_listed"].asBool();
|
bool is_listed = listing["is_listed"].asBoolean();
|
||||||
std::string edit_url = listing["edit_url"].asString();
|
std::string edit_url = listing["edit_url"].asString();
|
||||||
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
||||||
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
||||||
int count = listing["inventory_info"]["count_on_hand"].asInt();
|
int count = listing["inventory_info"]["count_on_hand"].asInteger();
|
||||||
|
|
||||||
LLUUID folder_id(folder_uuid_string);
|
LLUUID folder_id(folder_uuid_string);
|
||||||
LLUUID version_id(version_uuid_string);
|
LLUUID version_id(version_uuid_string);
|
||||||
@@ -561,11 +556,10 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value root;
|
LLSD result;
|
||||||
Json::Reader reader;
|
if (LLSDSerialize::fromNotation(result, strstrm, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
|
||||||
if (!reader.parse(body, root))
|
|
||||||
{
|
{
|
||||||
log_SLM_warning("Put /associate_inventory", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body);
|
log_SLM_warning("Put /associate_inventory", getStatus(), "Json parsing failed", LLStringUtil::null, body);
|
||||||
update_marketplace_category(mExpectedFolderId, false);
|
update_marketplace_category(mExpectedFolderId, false);
|
||||||
update_marketplace_category(mSourceFolderId, false);
|
update_marketplace_category(mSourceFolderId, false);
|
||||||
gInventory.notifyObservers();
|
gInventory.notifyObservers();
|
||||||
@@ -575,18 +569,18 @@ public:
|
|||||||
log_SLM_infos("Put /associate_inventory", getStatus(), body);
|
log_SLM_infos("Put /associate_inventory", getStatus(), body);
|
||||||
|
|
||||||
// Extract the info from the Json string
|
// Extract the info from the Json string
|
||||||
Json::ValueIterator it = root["listings"].begin();
|
auto it = result["listings"].beginArray();
|
||||||
|
|
||||||
while (it != root["listings"].end())
|
while (it != result["listings"].endArray())
|
||||||
{
|
{
|
||||||
Json::Value listing = *it;
|
auto listing = *it;
|
||||||
|
|
||||||
int listing_id = listing["id"].asInt();
|
int listing_id = listing["id"].asInteger();
|
||||||
bool is_listed = listing["is_listed"].asBool();
|
bool is_listed = listing["is_listed"].asBoolean();
|
||||||
std::string edit_url = listing["edit_url"].asString();
|
std::string edit_url = listing["edit_url"].asString();
|
||||||
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
std::string folder_uuid_string = listing["inventory_info"]["listing_folder_id"].asString();
|
||||||
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
std::string version_uuid_string = listing["inventory_info"]["version_folder_id"].asString();
|
||||||
int count = listing["inventory_info"]["count_on_hand"].asInt();
|
int count = listing["inventory_info"]["count_on_hand"].asInteger();
|
||||||
|
|
||||||
LLUUID folder_id(folder_uuid_string);
|
LLUUID folder_id(folder_uuid_string);
|
||||||
LLUUID version_id(version_uuid_string);
|
LLUUID version_id(version_uuid_string);
|
||||||
@@ -648,11 +642,11 @@ public:
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Json::Value root;
|
|
||||||
Json::Reader reader;
|
LLSD result;
|
||||||
if (!reader.parse(body, root))
|
if (LLSDSerialize::fromNotation(result, strstrm, LLSDSerialize::SIZE_UNLIMITED) == LLSDParser::PARSE_FAILURE)
|
||||||
{
|
{
|
||||||
log_SLM_warning("Delete /listing", getStatus(), "Json parsing failed", reader.getFormatedErrorMessages(), body);
|
log_SLM_warning("Delete /listing", getStatus(), "Json parsing failed", LLStringUtil::null, body);
|
||||||
update_marketplace_category(mExpectedFolderId, false);
|
update_marketplace_category(mExpectedFolderId, false);
|
||||||
gInventory.notifyObservers();
|
gInventory.notifyObservers();
|
||||||
return;
|
return;
|
||||||
@@ -661,13 +655,13 @@ public:
|
|||||||
log_SLM_infos("Delete /listing", getStatus(), body);
|
log_SLM_infos("Delete /listing", getStatus(), body);
|
||||||
|
|
||||||
// Extract the info from the Json string
|
// Extract the info from the Json string
|
||||||
Json::ValueIterator it = root["listings"].begin();
|
auto it = result["listings"].beginArray();
|
||||||
|
|
||||||
while (it != root["listings"].end())
|
while (it != result["listings"].endArray())
|
||||||
{
|
{
|
||||||
Json::Value listing = *it;
|
auto listing = *it;
|
||||||
|
|
||||||
int listing_id = listing["id"].asInt();
|
int listing_id = listing["id"].asInteger();
|
||||||
LLUUID folder_id = LLMarketplaceData::instance().getListingFolder(listing_id);
|
LLUUID folder_id = LLMarketplaceData::instance().getListingFolder(listing_id);
|
||||||
LLMarketplaceData::instance().deleteListing(folder_id);
|
LLMarketplaceData::instance().deleteListing(folder_id);
|
||||||
|
|
||||||
@@ -1328,20 +1322,23 @@ void LLMarketplaceData::createSLMListing(const LLUUID& folder_id, const LLUUID&
|
|||||||
headers.addHeader("Accept", "application/json");
|
headers.addHeader("Accept", "application/json");
|
||||||
headers.addHeader("Content-Type", "application/json");
|
headers.addHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
// Build the json message
|
|
||||||
Json::Value root;
|
|
||||||
Json::FastWriter writer;
|
|
||||||
|
|
||||||
LLViewerInventoryCategory* category = gInventory.getCategory(folder_id);
|
LLViewerInventoryCategory* category = gInventory.getCategory(folder_id);
|
||||||
root["listing"]["name"] = category->getName();
|
LLSD invInfo;
|
||||||
root["listing"]["inventory_info"]["listing_folder_id"] = folder_id.asString();
|
invInfo["listing_folder_id"] = folder_id;
|
||||||
root["listing"]["inventory_info"]["version_folder_id"] = version_id.asString();
|
invInfo["version_folder_id"] = version_id;
|
||||||
root["listing"]["inventory_info"]["count_on_hand"] = count;
|
invInfo["count_on_hand"] = count;
|
||||||
|
LLSD listing;
|
||||||
|
listing["name"] = category->getName();
|
||||||
|
listing["inventory_info"] = invInfo;
|
||||||
|
LLSD postData;
|
||||||
|
postData["listing"] = listing;
|
||||||
|
|
||||||
std::string json_str = writer.write(root);
|
std::stringstream json;
|
||||||
|
LLSDSerialize::toPrettyNotation(postData, json);
|
||||||
|
auto json_str = json.str();
|
||||||
|
|
||||||
// postRaw() takes ownership of the buffer and releases it later.
|
// postRaw() takes ownership of the buffer and releases it later.
|
||||||
size_t size = json_str.size();
|
size_t size = json_str.length();
|
||||||
U8* data = new U8[size];
|
U8* data = new U8[size];
|
||||||
memcpy(data, (U8*)(json_str.c_str()), size);
|
memcpy(data, (U8*)(json_str.c_str()), size);
|
||||||
|
|
||||||
@@ -1358,9 +1355,6 @@ void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id
|
|||||||
headers.addHeader("Accept", "application/json");
|
headers.addHeader("Accept", "application/json");
|
||||||
headers.addHeader("Content-Type", "application/json");
|
headers.addHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
Json::Value root;
|
|
||||||
Json::FastWriter writer;
|
|
||||||
|
|
||||||
// Note : auto unlist if the count is 0 (out of stock)
|
// Note : auto unlist if the count is 0 (out of stock)
|
||||||
if (is_listed && (count == 0))
|
if (is_listed && (count == 0))
|
||||||
{
|
{
|
||||||
@@ -1368,14 +1362,20 @@ void LLMarketplaceData::updateSLMListing(const LLUUID& folder_id, S32 listing_id
|
|||||||
LLNotificationsUtil::add("AlertMerchantStockFolderEmpty");
|
LLNotificationsUtil::add("AlertMerchantStockFolderEmpty");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Note : we're assuming that sending unchanged info won't break anything server side...
|
LLSD invInfo;
|
||||||
root["listing"]["id"] = listing_id;
|
invInfo["listing_folder_id"] = folder_id;
|
||||||
root["listing"]["is_listed"] = is_listed;
|
invInfo["version_folder_id"] = version_id;
|
||||||
root["listing"]["inventory_info"]["listing_folder_id"] = folder_id.asString();
|
invInfo["count_on_hand"] = count;
|
||||||
root["listing"]["inventory_info"]["version_folder_id"] = version_id.asString();
|
LLSD listing;
|
||||||
root["listing"]["inventory_info"]["count_on_hand"] = count;
|
listing["inventory_info"] = invInfo;
|
||||||
|
listing["id"] = listing_id;
|
||||||
|
listing["is_listed"] = is_listed;
|
||||||
|
LLSD postData;
|
||||||
|
postData["listing"] = listing;
|
||||||
|
|
||||||
std::string json_str = writer.write(root);
|
std::stringstream json;
|
||||||
|
LLSDSerialize::toPrettyNotation(postData, json);
|
||||||
|
auto json_str = json.str();
|
||||||
|
|
||||||
// postRaw() takes ownership of the buffer and releases it later.
|
// postRaw() takes ownership of the buffer and releases it later.
|
||||||
size_t size = json_str.size();
|
size_t size = json_str.size();
|
||||||
@@ -1395,15 +1395,18 @@ void LLMarketplaceData::associateSLMListing(const LLUUID& folder_id, S32 listing
|
|||||||
headers.addHeader("Accept", "application/json");
|
headers.addHeader("Accept", "application/json");
|
||||||
headers.addHeader("Content-Type", "application/json");
|
headers.addHeader("Content-Type", "application/json");
|
||||||
|
|
||||||
Json::Value root;
|
LLSD invInfo;
|
||||||
Json::FastWriter writer;
|
invInfo["listing_folder_id"] = folder_id;
|
||||||
|
invInfo["version_folder_id"] = version_id;
|
||||||
|
LLSD listing;
|
||||||
|
listing["id"] = listing_id;
|
||||||
|
listing["inventory_info"] = invInfo;
|
||||||
|
LLSD postData;
|
||||||
|
postData["listing"] = listing;
|
||||||
|
|
||||||
// Note : we're assuming that sending unchanged info won't break anything server side...
|
std::stringstream json;
|
||||||
root["listing"]["id"] = listing_id;
|
LLSDSerialize::toPrettyNotation(postData, json);
|
||||||
root["listing"]["inventory_info"]["listing_folder_id"] = folder_id.asString();
|
auto json_str = json.str();
|
||||||
root["listing"]["inventory_info"]["version_folder_id"] = version_id.asString();
|
|
||||||
|
|
||||||
std::string json_str = writer.write(root);
|
|
||||||
|
|
||||||
// postRaw() takes ownership of the buffer and releases it later.
|
// postRaw() takes ownership of the buffer and releases it later.
|
||||||
size_t size = json_str.size();
|
size_t size = json_str.size();
|
||||||
|
|||||||
@@ -1094,7 +1094,7 @@ void LLFloaterInventoryFinder::draw()
|
|||||||
filtered_by_all_types = FALSE;
|
filtered_by_all_types = FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!filtered_by_all_types || (mInventoryView->getPanel()->getFilter().getFilterTypes() & LLInventoryFilter::FILTERTYPE_DATE))
|
if (!filtered_by_all_types || (mPanelMainInventory->getPanel()->getFilter().getFilterTypes() & LLInventoryFilter::FILTERTYPE_DATE))
|
||||||
{
|
{
|
||||||
// don't include folders in filter, unless I've selected everything or filtering by date
|
// don't include folders in filter, unless I've selected everything or filtering by date
|
||||||
filter &= ~(0x1 << LLInventoryType::IT_CATEGORY);
|
filter &= ~(0x1 << LLInventoryType::IT_CATEGORY);
|
||||||
|
|||||||
Reference in New Issue
Block a user