From c58af954101ea23f38f7fca6a1d5fd4ed4139e31 Mon Sep 17 00:00:00 2001
From: Merov Linden <merov@lindenlab.com>
Date: Sun, 19 Oct 2014 21:53:07 -0700
Subject: DD-170 : Set the import callback for Merchant Outbox only when
 clicking the import button

---
 indra/newview/llfloateroutbox.cpp        |  4 +++-
 indra/newview/llmarketplacefunctions.cpp | 12 ++++++------
 2 files changed, 9 insertions(+), 7 deletions(-)

(limited to 'indra')

diff --git a/indra/newview/llfloateroutbox.cpp b/indra/newview/llfloateroutbox.cpp
index 772f73867a..0c4b58e501 100755
--- a/indra/newview/llfloateroutbox.cpp
+++ b/indra/newview/llfloateroutbox.cpp
@@ -303,7 +303,6 @@ void LLFloaterOutbox::initializeMarketPlace()
     {
         importer.setInitializationErrorCallback(boost::bind(&LLFloaterOutbox::initializationReportError, this, _1, _2));
         importer.setStatusChangedCallback(boost::bind(&LLFloaterOutbox::importStatusChanged, this, _1));
-        importer.setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2));
         importer.initialize();
     }
 }
@@ -516,6 +515,9 @@ void LLFloaterOutbox::onImportButtonClicked()
     {
         mOutboxInventoryPanel.get()->clearSelection();
     }
+    
+	LLMarketplaceInventoryImporter& importer = LLMarketplaceInventoryImporter::instance();
+    importer.setStatusReportCallback(boost::bind(&LLFloaterOutbox::importReportResults, this, _1, _2));
 
 	mImportBusy = LLMarketplaceInventoryImporter::instance().triggerImport();
 }
diff --git a/indra/newview/llmarketplacefunctions.cpp b/indra/newview/llmarketplacefunctions.cpp
index fbfddd09a5..b4a2921f8c 100755
--- a/indra/newview/llmarketplacefunctions.cpp
+++ b/indra/newview/llmarketplacefunctions.cpp
@@ -1030,13 +1030,13 @@ void LLMarketplaceInventoryImporter::updateImport()
                 }
             }
 		}
-
-		// Make sure we trigger the status change with the final state (in case of auto trigger after initialize)
-		if (mStatusChangedSignal)
-		{
-			(*mStatusChangedSignal)(mImportInProgress);
-		}
 	}
+    
+    // Make sure we trigger the status change with the final state (in case of auto trigger after initialize)
+    if (mStatusChangedSignal)
+    {
+        (*mStatusChangedSignal)(mImportInProgress);
+    }
 }
 
 //
-- 
cgit v1.2.3