From 75d368f45239a292b2090fead991caaab6383f7b Mon Sep 17 00:00:00 2001 From: Angeldark Raymaker Date: Mon, 13 Jan 2025 20:04:35 +0000 Subject: [PATCH] FIRE-34968: Fix user pose directory creation --- indra/newview/fsfloaterposer.cpp | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/indra/newview/fsfloaterposer.cpp b/indra/newview/fsfloaterposer.cpp index 634630092e..75dbb830e1 100644 --- a/indra/newview/fsfloaterposer.cpp +++ b/indra/newview/fsfloaterposer.cpp @@ -341,8 +341,8 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded() std::string userPath = gDirUtilp->getExpandedFilename(LL_PATH_USER_SETTINGS, POSE_SAVE_SUBDIRECTORY); - userPath = userPath + gDirUtilp->getDirDelimiter() + std::string(POSE_PRESETS_HANDS_SUBDIRECTORY); - if (gDirUtilp->fileExists(userPath)) + std::string userHandPresetsPath = userPath + gDirUtilp->getDirDelimiter() + std::string(POSE_PRESETS_HANDS_SUBDIRECTORY); + if (gDirUtilp->fileExists(userHandPresetsPath)) return; try @@ -353,8 +353,11 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded() LLFile::mkdir(userPath); } - LL_WARNS("Poser") << "Couldn't find folder: " << userPath << " - creating one." << LL_ENDL; - LLFile::mkdir(userPath); + if (!gDirUtilp->fileExists(userHandPresetsPath)) + { + LL_WARNS("Poser") << "Couldn't find folder: " << userHandPresetsPath << " - creating one." << LL_ENDL; + LLFile::mkdir(userHandPresetsPath); + } std::string sourcePresetPath = gDirUtilp->getExpandedFilename(LL_PATH_EXECUTABLE, POSE_SAVE_SUBDIRECTORY, std::string(POSE_PRESETS_HANDS_SUBDIRECTORY)); @@ -366,10 +369,10 @@ void FSFloaterPoser::createUserPoseDirectoryIfNeeded() for (auto pose : posesToCopy) { std::string source = sourcePresetPath + gDirUtilp->getDirDelimiter() + pose; - std::string destination = userPath + gDirUtilp->getDirDelimiter() + pose; + std::string destination = userHandPresetsPath + gDirUtilp->getDirDelimiter() + pose; if (!LLFile::copy(source, destination)) - LL_WARNS("LLDiskCache") << "Failed to copy " << source << " to " << destination << LL_ENDL; + LL_WARNS("Poser") << "Failed to copy " << source << " to " << destination << LL_ENDL; } } catch (const std::exception& e)