diff options
Diffstat (limited to 'indra/llvfs')
28 files changed, 26 insertions, 8 deletions
diff --git a/indra/llvfs/CMakeLists.txt b/indra/llvfs/CMakeLists.txt index 3c68b279f7..67dce8c073 100644..100755 --- a/indra/llvfs/CMakeLists.txt +++ b/indra/llvfs/CMakeLists.txt @@ -8,6 +8,7 @@ include(UnixInstall) include_directories( ${LLCOMMON_INCLUDE_DIRS} + ${LLCOMMON_SYSTEM_INCLUDE_DIRS} ) set(llvfs_SOURCE_FILES @@ -44,12 +45,12 @@ if (LINUX) LIST(APPEND llvfs_SOURCE_FILES lldir_linux.cpp) LIST(APPEND llvfs_HEADER_FILES lldir_linux.h) - if (VIEWER AND INSTALL) + if (INSTALL) set_source_files_properties(lldir_linux.cpp PROPERTIES COMPILE_FLAGS "-DAPP_RO_DATA_DIR=\\\"${APP_SHARE_DIR}\\\"" ) - endif (VIEWER AND INSTALL) + endif (INSTALL) endif (LINUX) if (WINDOWS) @@ -70,6 +71,7 @@ set(vfs_BOOST_LIBRARIES ) target_link_libraries(llvfs + ${LLCOMMON_LIBRARIES} ${vfs_BOOST_LIBRARIES} ) diff --git a/indra/llvfs/lldir.cpp b/indra/llvfs/lldir.cpp index 5e5aeefba1..6899e9a44a 100644..100755 --- a/indra/llvfs/lldir.cpp +++ b/indra/llvfs/lldir.cpp @@ -90,7 +90,8 @@ LLDir::LLDir() mCAFile(""), mTempDir(""), mDirDelimiter("/"), // fallback to forward slash if not overridden - mLanguage("en") + mLanguage("en"), + mUserName("undefined") { } @@ -346,6 +347,11 @@ const std::string &LLDir::getLLPluginDir() const return mLLPluginDir; } +const std::string &LLDir::getUserName() const +{ + return mUserName; +} + static std::string ELLPathToString(ELLPath location) { typedef std::map<ELLPath, const char*> ELLPathMap; @@ -814,6 +820,11 @@ void LLDir::setChatLogsDir(const std::string &path) } } +void LLDir::updatePerAccountChatLogsDir() +{ + mPerAccountChatLogsDir = add(getChatLogsDir(), mUserName); +} + void LLDir::setPerAccountChatLogsDir(const std::string &username) { // if both first and last aren't set, assume we're grabbing the cached dir @@ -824,13 +835,14 @@ void LLDir::setPerAccountChatLogsDir(const std::string &username) std::string userlower(username); LLStringUtil::toLower(userlower); LLStringUtil::replaceChar(userlower, ' ', '_'); - mPerAccountChatLogsDir = add(getChatLogsDir(), userlower); + + mUserName = userlower; + updatePerAccountChatLogsDir(); } else { llerrs << "NULL name for LLDir::setPerAccountChatLogsDir" << llendl; } - } void LLDir::setSkinFolder(const std::string &skin_folder, const std::string& language) diff --git a/indra/llvfs/lldir.h b/indra/llvfs/lldir.h index 300ff1eef6..cc10ed5bbd 100644..100755 --- a/indra/llvfs/lldir.h +++ b/indra/llvfs/lldir.h @@ -104,6 +104,7 @@ class LLDir const std::string &getUserSkinDir() const; // User-specified skin folder with user modifications. e.g. c:\documents and settings\username\application data\second life\skins\curskin const std::string getSkinBaseDir() const; // folder that contains all installed skins (not user modifications). e.g. c:\program files\second life\skins const std::string &getLLPluginDir() const; // Directory containing plugins and plugin shell + const std::string &getUserName() const; // Expanded filename std::string getExpandedFilename(ELLPath location, const std::string &filename) const; @@ -186,6 +187,7 @@ class LLDir virtual std::string getSkinFolder() const; virtual std::string getLanguage() const; virtual bool setCacheDir(const std::string &path); + virtual void updatePerAccountChatLogsDir(); virtual void dumpCurrentDirectories(); @@ -243,6 +245,7 @@ protected: std::vector<std::string> mSearchSkinDirs; std::string mLanguage; // Current viewer language std::string mLLPluginDir; // Location for plugins and plugin shell + std::string mUserName; // Current user name }; void dir_exists_or_crash(const std::string &dir_name); diff --git a/indra/llvfs/lldir_linux.cpp b/indra/llvfs/lldir_linux.cpp index 4edd078640..4edd078640 100644..100755 --- a/indra/llvfs/lldir_linux.cpp +++ b/indra/llvfs/lldir_linux.cpp diff --git a/indra/llvfs/lldir_linux.h b/indra/llvfs/lldir_linux.h index e83a020ba4..e83a020ba4 100644..100755 --- a/indra/llvfs/lldir_linux.h +++ b/indra/llvfs/lldir_linux.h diff --git a/indra/llvfs/lldir_mac.cpp b/indra/llvfs/lldir_mac.cpp index c5041d434c..c5041d434c 100644..100755 --- a/indra/llvfs/lldir_mac.cpp +++ b/indra/llvfs/lldir_mac.cpp diff --git a/indra/llvfs/lldir_mac.h b/indra/llvfs/lldir_mac.h index 558727ebbc..558727ebbc 100644..100755 --- a/indra/llvfs/lldir_mac.h +++ b/indra/llvfs/lldir_mac.h diff --git a/indra/llvfs/lldir_solaris.cpp b/indra/llvfs/lldir_solaris.cpp index a97d72d539..a97d72d539 100644..100755 --- a/indra/llvfs/lldir_solaris.cpp +++ b/indra/llvfs/lldir_solaris.cpp diff --git a/indra/llvfs/lldir_solaris.h b/indra/llvfs/lldir_solaris.h index c6dac57e14..c6dac57e14 100644..100755 --- a/indra/llvfs/lldir_solaris.h +++ b/indra/llvfs/lldir_solaris.h diff --git a/indra/llvfs/lldir_win32.cpp b/indra/llvfs/lldir_win32.cpp index 462d1cce06..462d1cce06 100644..100755 --- a/indra/llvfs/lldir_win32.cpp +++ b/indra/llvfs/lldir_win32.cpp diff --git a/indra/llvfs/lldir_win32.h b/indra/llvfs/lldir_win32.h index 450efaf9da..450efaf9da 100644..100755 --- a/indra/llvfs/lldir_win32.h +++ b/indra/llvfs/lldir_win32.h diff --git a/indra/llvfs/lldirguard.h b/indra/llvfs/lldirguard.h index 4330095ad0..4330095ad0 100644..100755 --- a/indra/llvfs/lldirguard.h +++ b/indra/llvfs/lldirguard.h diff --git a/indra/llvfs/lldiriterator.cpp b/indra/llvfs/lldiriterator.cpp index 460d2a8b4f..460d2a8b4f 100644..100755 --- a/indra/llvfs/lldiriterator.cpp +++ b/indra/llvfs/lldiriterator.cpp diff --git a/indra/llvfs/lldiriterator.h b/indra/llvfs/lldiriterator.h index 0b48be41b3..0b48be41b3 100644..100755 --- a/indra/llvfs/lldiriterator.h +++ b/indra/llvfs/lldiriterator.h diff --git a/indra/llvfs/lllfsthread.cpp b/indra/llvfs/lllfsthread.cpp index 073b1af2a1..073b1af2a1 100644..100755 --- a/indra/llvfs/lllfsthread.cpp +++ b/indra/llvfs/lllfsthread.cpp diff --git a/indra/llvfs/lllfsthread.h b/indra/llvfs/lllfsthread.h index cdb5c75946..cdb5c75946 100644..100755 --- a/indra/llvfs/lllfsthread.h +++ b/indra/llvfs/lllfsthread.h diff --git a/indra/llvfs/llpidlock.cpp b/indra/llvfs/llpidlock.cpp index 0424f2379e..0424f2379e 100644..100755 --- a/indra/llvfs/llpidlock.cpp +++ b/indra/llvfs/llpidlock.cpp diff --git a/indra/llvfs/llpidlock.h b/indra/llvfs/llpidlock.h index d3295f4911..d3295f4911 100644..100755 --- a/indra/llvfs/llpidlock.h +++ b/indra/llvfs/llpidlock.h diff --git a/indra/llvfs/llvfile.cpp b/indra/llvfs/llvfile.cpp index ca749c5eaf..03d2cc25e3 100644..100755 --- a/indra/llvfs/llvfile.cpp +++ b/indra/llvfs/llvfile.cpp @@ -32,6 +32,7 @@ #include "llthread.h" #include "llstat.h" #include "llvfs.h" +#include "llmemory.h" const S32 LLVFile::READ = 0x00000001; const S32 LLVFile::WRITE = 0x00000002; @@ -134,13 +135,13 @@ U8* LLVFile::readFile(LLVFS *vfs, const LLUUID &uuid, LLAssetType::EType type, S data = NULL; } else - { - data = new U8[file_size]; + { + data = (U8*) ll_aligned_malloc_16(file_size); file.read(data, file_size); /* Flawfinder: ignore */ if (file.getLastBytesRead() != (S32)file_size) { - delete[] data; + ll_aligned_free(data); data = NULL; file_size = 0; } diff --git a/indra/llvfs/llvfile.h b/indra/llvfs/llvfile.h index 7e9d9f73e5..7e9d9f73e5 100644..100755 --- a/indra/llvfs/llvfile.h +++ b/indra/llvfs/llvfile.h diff --git a/indra/llvfs/llvfs.cpp b/indra/llvfs/llvfs.cpp index 82c926620a..82c926620a 100644..100755 --- a/indra/llvfs/llvfs.cpp +++ b/indra/llvfs/llvfs.cpp diff --git a/indra/llvfs/llvfs.h b/indra/llvfs/llvfs.h index 63f0f28933..63f0f28933 100644..100755 --- a/indra/llvfs/llvfs.h +++ b/indra/llvfs/llvfs.h diff --git a/indra/llvfs/llvfs_objc.h b/indra/llvfs/llvfs_objc.h index 90101eb2e9..90101eb2e9 100644..100755 --- a/indra/llvfs/llvfs_objc.h +++ b/indra/llvfs/llvfs_objc.h diff --git a/indra/llvfs/llvfs_objc.mm b/indra/llvfs/llvfs_objc.mm index 4f9e2f81e9..4f9e2f81e9 100644..100755 --- a/indra/llvfs/llvfs_objc.mm +++ b/indra/llvfs/llvfs_objc.mm diff --git a/indra/llvfs/llvfsthread.cpp b/indra/llvfs/llvfsthread.cpp index a57e2b15ab..a57e2b15ab 100644..100755 --- a/indra/llvfs/llvfsthread.cpp +++ b/indra/llvfs/llvfsthread.cpp diff --git a/indra/llvfs/llvfsthread.h b/indra/llvfs/llvfsthread.h index 95f3c857c6..95f3c857c6 100644..100755 --- a/indra/llvfs/llvfsthread.h +++ b/indra/llvfs/llvfsthread.h diff --git a/indra/llvfs/tests/lldir_test.cpp b/indra/llvfs/tests/lldir_test.cpp index 3cff622a4b..3cff622a4b 100644..100755 --- a/indra/llvfs/tests/lldir_test.cpp +++ b/indra/llvfs/tests/lldir_test.cpp diff --git a/indra/llvfs/tests/lldiriterator_test.cpp b/indra/llvfs/tests/lldiriterator_test.cpp index 505d86faa7..505d86faa7 100644..100755 --- a/indra/llvfs/tests/lldiriterator_test.cpp +++ b/indra/llvfs/tests/lldiriterator_test.cpp |