From c70a951abd0993c85aa96a930a54ff89c93cd03a Mon Sep 17 00:00:00 2001
From: Gilbert Gonzales <gilbert@lindenlab.com>
Date: Mon, 25 Feb 2013 11:41:22 -0800
Subject: [PATCH] CHUI-778: Pushing a quick fix that only pertains to CHUI-778
 so we can close out this issue.

---
 indra/newview/llfloaterpreference.cpp | 32 +++++++++++++++++++--------
 indra/newview/llfloaterpreference.h   |  1 +
 2 files changed, 24 insertions(+), 9 deletions(-)

diff --git a/indra/newview/llfloaterpreference.cpp b/indra/newview/llfloaterpreference.cpp
index 3d8d0e15ecf..688d4537893 100755
--- a/indra/newview/llfloaterpreference.cpp
+++ b/indra/newview/llfloaterpreference.cpp
@@ -646,9 +646,6 @@ void LLFloaterPreference::cancel()
 		LLFloaterPathfindingConsole* pPathfindingConsole = pathfindingConsoleHandle.get();
 		pPathfindingConsole->onRegionBoundaryCross();
 	}
-
-	std::string dir_name(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
-	updateLogLocation(dir_name);
 }
 
 void LLFloaterPreference::onOpen(const LLSD& key)
@@ -798,6 +795,14 @@ void LLFloaterPreference::onBtnOK()
 		apply();
 		closeFloater(false);
 
+		//Conversation transcript and log path changed so reload conversations based on new location
+		if(mPriorInstantMessageLogPath.length())
+		{
+			std::string dir_name(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
+			updateLogLocation(dir_name);
+			mPriorInstantMessageLogPath.clear();
+		}
+
 		LLUIColorTable::instance().saveUserSettings();
 		gSavedSettings.saveToFile(gSavedSettings.getString("ClientSettingsFile"), TRUE);
 	}
@@ -1436,19 +1441,28 @@ void LLFloaterPreference::setAllIgnored()
 
 void LLFloaterPreference::onClickLogPath()
 {
-	std::string proposed_name(gSavedPerAccountSettings.getString("InstantMessageLogPath"));	 
-	
+	std::string proposed_name(gSavedPerAccountSettings.getString("InstantMessageLogPath"));
+	mPriorInstantMessageLogPath.clear();
+
 	LLDirPicker& picker = LLDirPicker::instance();
+	//Launches a directory picker and waits for feedback
 	if (!picker.getDir(&proposed_name ) )
 	{
 		return; //Canceled!
 	}
 
+	//Gets the path from the directory picker
 	std::string dir_name = picker.getDirName();
-	gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name);
-	
-	// enable/disable 'Delete transcripts button
-	updateDeleteTranscriptsButton();
+
+	//Path changed
+	if(proposed_name != dir_name)
+	{
+		gSavedPerAccountSettings.setString("InstantMessageLogPath", dir_name);
+		mPriorInstantMessageLogPath = proposed_name;
+
+		// enable/disable 'Delete transcripts button
+		updateDeleteTranscriptsButton();
+	}
 }
 
 void LLFloaterPreference::updateLogLocation(const std::string& dir_name)
diff --git a/indra/newview/llfloaterpreference.h b/indra/newview/llfloaterpreference.h
index dbd87f74a19..31c1e2d9e51 100644
--- a/indra/newview/llfloaterpreference.h
+++ b/indra/newview/llfloaterpreference.h
@@ -187,6 +187,7 @@ class LLFloaterPreference : public LLFloater, public LLAvatarPropertiesObserver,
 	bool mOriginalIMViaEmail;
 	bool mLanguageChanged;
 	bool mAvatarDataInitialized;
+	std::string mPriorInstantMessageLogPath;
 	
 	bool mOriginalHideOnlineStatus;
 	std::string mDirectoryVisibility;
-- 
GitLab