From e1504d8c562d11d538bcbafc6ffd22d56ff38491 Mon Sep 17 00:00:00 2001
From: Mnikolenko Productengine <mnikolenko@productengine.com>
Date: Tue, 5 May 2020 19:08:55 +0300
Subject: [PATCH] SL-13178 Improve initial opening time of the landmarks
 floater

---
 doc/contributions.txt                    |  1 +
 indra/newview/llinventorypanel.cpp       | 34 --------------
 indra/newview/llinventorypanel.h         | 59 ++++++++++++++++++++++++
 indra/newview/llplacesinventorypanel.cpp |  3 +-
 indra/newview/llplacesinventorypanel.h   |  8 ++--
 5 files changed, 66 insertions(+), 39 deletions(-)

diff --git a/doc/contributions.txt b/doc/contributions.txt
index 2153e108882..a1127f4a8eb 100755
--- a/doc/contributions.txt
+++ b/doc/contributions.txt
@@ -829,6 +829,7 @@ Khyota Wulluf
 Kimar Coba
 Kithrak Kirkorian
 Kitty Barnett
+	BUG-228665
 	VWR-19699
 	STORM-288
 	STORM-799
diff --git a/indra/newview/llinventorypanel.cpp b/indra/newview/llinventorypanel.cpp
index 689ce7e66b9..277dfe9e280 100644
--- a/indra/newview/llinventorypanel.cpp
+++ b/indra/newview/llinventorypanel.cpp
@@ -1836,41 +1836,7 @@ LLInventoryRecentItemsPanel::LLInventoryRecentItemsPanel( const Params& params)
 
 /************************************************************************/
 /* Asset Pre-Filtered Inventory Panel related class                     */
-/* Exchanges filter's flexibility for speed of generation and           */
-/* improved performance                                                 */
 /************************************************************************/
-class LLAssetFilteredInventoryPanel : public LLInventoryPanel
-{
-public:
-    struct Params
-        : public LLInitParam::Block<Params, LLInventoryPanel::Params>
-    {
-        Mandatory<std::string>	filter_asset_type;
-
-        Params() : filter_asset_type("filter_asset_type") {}
-    };
-
-    void initFromParams(const Params& p);
-protected:
-    LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) {}
-    friend class LLUICtrlFactory;
-public:
-    ~LLAssetFilteredInventoryPanel() {}
-
-    /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
-                                       EDragAndDropType cargo_type,
-                                       void* cargo_data,
-                                       EAcceptance* accept,
-                                       std::string& tooltip_msg) override;
-
-protected:
-    /*virtual*/ bool				typedViewsFilter(const LLUUID& id, LLInventoryObject const* objectp) override;
-    /*virtual*/ void				itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override;
-
-private:
-    LLAssetType::EType mAssetType;
-};
-
 
 void LLAssetFilteredInventoryPanel::initFromParams(const Params& p)
 {
diff --git a/indra/newview/llinventorypanel.h b/indra/newview/llinventorypanel.h
index adca8ad3e23..cd504392e65 100644
--- a/indra/newview/llinventorypanel.h
+++ b/indra/newview/llinventorypanel.h
@@ -353,4 +353,63 @@ class LLInventoryPanel : public LLPanel
 	bool				mViewsInitialized; // Views have been generated
 };
 
+
+class LLInventoryFavoriteItemsPanel : public LLInventoryPanel
+{
+public:
+    struct Params : public LLInitParam::Block<Params, LLInventoryPanel::Params>
+    {};
+
+    void initFromParams(const Params& p);
+    bool isSelectionRemovable() { return false; }
+    void setSelectCallback(const boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)>& cb);
+
+protected:
+    LLInventoryFavoriteItemsPanel(const Params& params);
+    ~LLInventoryFavoriteItemsPanel() { mFolderChangedSignal.disconnect(); }
+    void updateFavoritesRootFolder();
+
+    boost::signals2::connection mFolderChangedSignal;
+    boost::function<void(const std::deque<LLFolderViewItem*>& items, BOOL user_action)> mSelectionCallback;
+    friend class LLUICtrlFactory;
+};
+
+/************************************************************************/
+/* Asset Pre-Filtered Inventory Panel related class                     */
+/* Exchanges filter's flexibility for speed of generation and           */
+/* improved performance                                                 */
+/************************************************************************/
+
+class LLAssetFilteredInventoryPanel : public LLInventoryPanel
+{
+public:
+    struct Params
+        : public LLInitParam::Block<Params, LLInventoryPanel::Params>
+    {
+        Mandatory<std::string>	filter_asset_type;
+
+        Params() : filter_asset_type("filter_asset_type") {}
+    };
+
+    void initFromParams(const Params& p);
+protected:
+    LLAssetFilteredInventoryPanel(const Params& p) : LLInventoryPanel(p) {}
+    friend class LLUICtrlFactory;
+public:
+    ~LLAssetFilteredInventoryPanel() {}
+
+    /*virtual*/ BOOL handleDragAndDrop(S32 x, S32 y, MASK mask, BOOL drop,
+        EDragAndDropType cargo_type,
+        void* cargo_data,
+        EAcceptance* accept,
+        std::string& tooltip_msg) override;
+
+protected:
+    /*virtual*/ LLFolderViewItem*	buildNewViews(const LLUUID& id) override;
+    /*virtual*/ void				itemChanged(const LLUUID& item_id, U32 mask, const LLInventoryObject* model_item) override;
+
+private:
+    LLAssetType::EType mAssetType;
+};
+
 #endif // LL_LLINVENTORYPANEL_H
diff --git a/indra/newview/llplacesinventorypanel.cpp b/indra/newview/llplacesinventorypanel.cpp
index a23830e8e17..1c14acd8434 100644
--- a/indra/newview/llplacesinventorypanel.cpp
+++ b/indra/newview/llplacesinventorypanel.cpp
@@ -43,9 +43,8 @@ static LLDefaultChildRegistry::Register<LLPlacesInventoryPanel> r("places_invent
 static const LLPlacesInventoryBridgeBuilder PLACES_INVENTORY_BUILDER;
 
 LLPlacesInventoryPanel::LLPlacesInventoryPanel(const Params& p) : 
-	LLInventoryPanel(p),
+    LLAssetFilteredInventoryPanel(p),
 	mSavedFolderState(NULL)
-
 {
 	mInvFVBridgeBuilder = &PLACES_INVENTORY_BUILDER;
 	mSavedFolderState = new LLSaveFolderState();
diff --git a/indra/newview/llplacesinventorypanel.h b/indra/newview/llplacesinventorypanel.h
index 27d9b83bd17..56294384151 100644
--- a/indra/newview/llplacesinventorypanel.h
+++ b/indra/newview/llplacesinventorypanel.h
@@ -32,14 +32,16 @@
 class LLLandmarksPanel;
 class LLFolderView;
 
-class LLPlacesInventoryPanel : public LLInventoryPanel
+class LLPlacesInventoryPanel : public LLAssetFilteredInventoryPanel
 {
 public:
 	struct Params 
-		:	public LLInitParam::Block<Params, LLInventoryPanel::Params>
+		:	public LLInitParam::Block<Params, LLAssetFilteredInventoryPanel::Params>
 	{
 		Params()
-		{}
+		{
+           filter_asset_type = "landmark";
+       }
 	};
 
 	LLPlacesInventoryPanel(const Params& p);
-- 
GitLab