From d6e88a07b08585d6a6f151d34a07d8bca78711ea Mon Sep 17 00:00:00 2001 From: krzys-h Date: Mon, 27 Oct 2014 21:15:14 +0100 Subject: Support for %lvl% in TerrainInitTextures + cleanup cleanup: * Removed CProfile::SetUserPath (unused) * Removed CProfile::GetUserBasedPath (unused) * Removed CProfile::CopyFileToTemp (i have no idea why it even existed) * Removed CopyFileListToTemp (it did the same as CopyFileToTemp but for multiple files, wasn't even fully implemented) --- src/common/profile.cpp | 49 ------------------------------------------------- 1 file changed, 49 deletions(-) (limited to 'src/common/profile.cpp') diff --git a/src/common/profile.cpp b/src/common/profile.cpp index 92fc1d6..75ab135 100644 --- a/src/common/profile.cpp +++ b/src/common/profile.cpp @@ -247,52 +247,3 @@ std::vector< std::string > CProfile::GetSection(std::string section, std::string return ret_list; } - -void CProfile::SetUserDir(std::string dir) -{ - m_userDirectory = dir; -} - - -std::string CProfile::GetUserBasedPath(std::string dir, std::string defaultDir) -{ - std::string path = dir; - boost::replace_all(path, "\\", "/"); - if (dir.find("/") == std::string::npos) - { - path = defaultDir + "/" + dir; - } - - if (m_userDirectory.length() > 0) - { - boost::replace_all(path, "%user%", m_userDirectory); - } - else - { - boost::replace_all(path, "%user%", defaultDir); - } - - return fs::path(path).make_preferred().string(); -} - - -bool CProfile::CopyFileToTemp(std::string filename) -{ - std::string src, dst; - std::string tmp_user_dir = m_userDirectory; - - src = GetUserBasedPath(filename, "textures"); - SetUserDir("temp"); - dst = GetUserBasedPath(filename, "textures"); - SetUserDir(tmp_user_dir); - - fs::create_directory(fs::path(dst).parent_path().make_preferred().string()); - fs::copy_file(src, dst, fs::copy_option::overwrite_if_exists); - if (fs::exists(dst)) - { - return true; - } - - return false; -} - -- cgit v1.2.3-1-g7c22