summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorMnikolenko ProductEngine <mnikolenko@productengine.com>2014-07-10 11:22:18 +0300
committerMnikolenko ProductEngine <mnikolenko@productengine.com>2014-07-10 11:22:18 +0300
commitb17199f283bcb3278c1238b9ccec96a1723db442 (patch)
treeb8c53441780c4fab9bb9e8fd8572924e5b387fd7 /indra
parent5af3c90a9e2eac10f78008c0e7af50c85726265b (diff)
MAINT-2855 FIXED Use separate xml files (saved as stored_favorites_<grid>.xml) for each grid.
Diffstat (limited to 'indra')
-rwxr-xr-xindra/newview/llfavoritesbar.cpp19
-rwxr-xr-xindra/newview/llpanellogin.cpp21
2 files changed, 31 insertions, 9 deletions
diff --git a/indra/newview/llfavoritesbar.cpp b/indra/newview/llfavoritesbar.cpp
index 98f2ac614b..6c5b5be720 100755
--- a/indra/newview/llfavoritesbar.cpp
+++ b/indra/newview/llfavoritesbar.cpp
@@ -40,7 +40,6 @@
#include "llagent.h"
#include "llavatarnamecache.h"
#include "llclipboard.h"
-#include "llclipboard.h"
#include "llinventorybridge.h"
#include "llinventoryfunctions.h"
#include "llfloatersidepanelcontainer.h"
@@ -51,7 +50,7 @@
#include "lltoggleablemenu.h"
#include "llviewerinventory.h"
#include "llviewermenu.h"
-#include "llviewermenu.h"
+#include "llviewernetwork.h"
#include "lltooldraganddrop.h"
#include "llsdserialize.h"
@@ -1453,6 +1452,18 @@ void LLFavoritesOrderStorage::getSLURL(const LLUUID& asset_id)
void LLFavoritesOrderStorage::destroyClass()
{
LLFavoritesOrderStorage::instance().cleanup();
+
+
+ std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ llifstream file;
+ file.open(old_filename);
+ if (file.is_open())
+ {
+ std::string new_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
+ LLFile::copy(old_filename,new_filename);
+ LLFile::remove(old_filename);
+ }
+
if (gSavedPerAccountSettings.getBOOL("ShowFavoritesOnLogin"))
{
LLFavoritesOrderStorage::instance().saveFavoritesSLURLs();
@@ -1499,7 +1510,7 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
return;
}
- std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
llifstream in_file;
in_file.open(filename);
LLSD fav_llsd;
@@ -1547,7 +1558,7 @@ void LLFavoritesOrderStorage::saveFavoritesSLURLs()
void LLFavoritesOrderStorage::removeFavoritesRecordOfUser()
{
- std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
LLSD fav_llsd;
llifstream file;
file.open(filename);
diff --git a/indra/newview/llpanellogin.cpp b/indra/newview/llpanellogin.cpp
index 5869855918..abdfa89f50 100755
--- a/indra/newview/llpanellogin.cpp
+++ b/indra/newview/llpanellogin.cpp
@@ -225,11 +225,16 @@ void LLPanelLogin::addUsersWithFavoritesToUsername()
{
LLComboBox* combo = getChild<LLComboBox>("username_combo");
if (!combo) return;
- std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
+ std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
LLSD fav_llsd;
llifstream file;
file.open(filename);
- if (!file.is_open()) return;
+ if (!file.is_open())
+ {
+ file.open(old_filename);
+ if (!file.is_open()) return;
+ }
LLSDSerialize::fromXML(fav_llsd, file);
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
@@ -252,11 +257,16 @@ void LLPanelLogin::addFavoritesToStartLocation()
// Load favorites into the combo.
std::string user_defined_name = getChild<LLComboBox>("username_combo")->getSimple();
std::replace(user_defined_name.begin(), user_defined_name.end(), '.', ' ');
- std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
+ std::string filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites_" + LLGridManager::getInstance()->getGrid() + ".xml");
+ std::string old_filename = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, "stored_favorites.xml");
LLSD fav_llsd;
llifstream file;
file.open(filename);
- if (!file.is_open()) return;
+ if (!file.is_open())
+ {
+ file.open(old_filename);
+ if (!file.is_open()) return;
+ }
LLSDSerialize::fromXML(fav_llsd, file);
for (LLSD::map_const_iterator iter = fav_llsd.beginMap();
iter != fav_llsd.endMap(); ++iter)
@@ -955,11 +965,12 @@ void LLPanelLogin::onSelectServer()
// The user twiddled with the grid choice ui.
// apply the selection to the grid setting.
LLPointer<LLCredential> credential;
-
+
LLComboBox* server_combo = getChild<LLComboBox>("server_combo");
LLSD server_combo_val = server_combo->getSelectedValue();
LL_INFOS("AppInit") << "grid "<<server_combo_val.asString()<< LL_ENDL;
LLGridManager::getInstance()->setGridChoice(server_combo_val.asString());
+ addFavoritesToStartLocation();
/*
* Determine whether or not the value in the start_location_combo makes sense