summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMerov Linden <merov@lindenlab.com>2014-03-14 13:52:42 -0700
committerMerov Linden <merov@lindenlab.com>2014-03-14 13:52:42 -0700
commitf93f860e9b565213089f945ee0d88dedf3dcd9c0 (patch)
treefe1ad366ae8be0f45bce5bf1de2eafabaa7e7940
parent705d4182c8a84728e7f00cf48110c8f9720e4c29 (diff)
DD-43, DD-44 : implement update_marketplace_category() and get it called swhen appropriate
-rwxr-xr-xindra/newview/llinventoryfunctions.cpp10
-rwxr-xr-xindra/newview/llinventoryfunctions.h3
-rwxr-xr-xindra/newview/llmarketplacefunctions.cpp7
3 files changed, 20 insertions, 0 deletions
diff --git a/indra/newview/llinventoryfunctions.cpp b/indra/newview/llinventoryfunctions.cpp
index f1a4889f5a..203eb4ec4e 100755
--- a/indra/newview/llinventoryfunctions.cpp
+++ b/indra/newview/llinventoryfunctions.cpp
@@ -111,6 +111,16 @@ void append_path(const LLUUID& id, std::string& path)
path.append(temp);
}
+void update_marketplace_category(const LLUUID& cat_id)
+{
+ // When changing the marketplace status of a folder, the only thing that needs to happen is
+ // for all observers of the folder to, possibly, change the display label of said folder.
+ // At least that's the status for the moment so, even if that function seems small, we
+ // prefer to encapsulate that behavior here.
+ gInventory.addChangedMask(LLInventoryObserver::LABEL, cat_id);
+ gInventory.notifyObservers();
+}
+
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name)
{
LLViewerInventoryCategory* cat;
diff --git a/indra/newview/llinventoryfunctions.h b/indra/newview/llinventoryfunctions.h
index f1066a4dc9..1443c186cf 100755
--- a/indra/newview/llinventoryfunctions.h
+++ b/indra/newview/llinventoryfunctions.h
@@ -58,6 +58,9 @@ void show_task_item_profile(const LLUUID& item_uuid, const LLUUID& object_id);
void show_item_original(const LLUUID& item_uuid);
void reset_inventory_filter();
+// Just nudge the category in the global inventory to signal that its marketplace status changed
+void update_marketplace_category(const LLUUID& cat_id);
+
void rename_category(LLInventoryModel* model, const LLUUID& cat_id, const std::string& new_name);
void copy_inventory_category(LLInventoryModel* model, LLViewerInventoryCategory* cat, const LLUUID& parent_id, const LLUUID& root_copy_id = LLUUID::null);
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index b39889c721..6f35cc217d 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -30,6 +30,7 @@
#include "llagent.h"
#include "llhttpclient.h"
+#include "llinventoryfunctions.h"
#include "llsdserialize.h"
#include "lltimer.h"
#include "lltrans.h"
@@ -596,6 +597,7 @@ bool LLMarketplaceData::setListingID(const LLUUID& folder_id, std::string listin
else
{
(it->second).mListingId = listing_id;
+ update_marketplace_category(folder_id);
return true;
}
}
@@ -609,6 +611,7 @@ bool LLMarketplaceData::setVersionFolderID(const LLUUID& folder_id, const LLUUID
else
{
(it->second).mActiveVersionFolderId = version_id;
+ update_marketplace_category(folder_id);
return true;
}
}
@@ -622,6 +625,7 @@ bool LLMarketplaceData::setActivation(const LLUUID& folder_id, bool activate)
else
{
(it->second).mIsActive = activate;
+ update_marketplace_category(folder_id);
return true;
}
}
@@ -631,12 +635,15 @@ void LLMarketplaceData::addTestItem(const LLUUID& folder_id)
{
llinfos << "Merov : addTestItem, id = " << folder_id << llendl;
mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id);
+ update_marketplace_category(folder_id);
}
void LLMarketplaceData::addTestItem(const LLUUID& folder_id, const LLUUID& version_id)
{
llinfos << "Merov : addTestItem, id = " << folder_id << ", version = " << version_id << llendl;
mMarketplaceItems[folder_id] = LLMarketplaceTuple(folder_id);
setVersionFolderID(folder_id, version_id);
+ update_marketplace_category(folder_id);
+ update_marketplace_category(version_id);
}