From 9f95dcdb78b7675a5ef97eb0d354f4be86f9d6be Mon Sep 17 00:00:00 2001 From: dec05eba Date: Wed, 26 May 2021 14:50:58 +0200 Subject: Fix room avatar getting corrupt after returning from watching media Also dont save file manager path to disk. Save it to ram only --- src/plugins/FileManager.cpp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/FileManager.cpp b/src/plugins/FileManager.cpp index 2207c65..42c2f9e 100644 --- a/src/plugins/FileManager.cpp +++ b/src/plugins/FileManager.cpp @@ -8,9 +8,9 @@ namespace QuickMedia { static std::filesystem::path last_accessed_dir; static Path last_accessed_dir_path; static void set_last_accessed_dir(const std::filesystem::path &path) { - if(last_accessed_dir_path.data.empty()) - last_accessed_dir_path = get_storage_dir().join("file-manager").join("last_accessed_dir"); - file_overwrite_atomic(last_accessed_dir_path, path.string()); + //if(last_accessed_dir_path.data.empty()) + // last_accessed_dir_path = get_storage_dir().join("file-manager").join("last_accessed_dir"); + //file_overwrite_atomic(last_accessed_dir_path, path.string()); last_accessed_dir = path; } @@ -157,12 +157,12 @@ namespace QuickMedia { // static std::filesystem::path& FileManagerPage::get_last_accessed_directory(std::filesystem::path &fallback) { - if(!last_accessed_dir_loaded) { - last_accessed_dir_loaded = true; - std::string last_accessed_dir_str; - file_get_content(get_storage_dir().join("file-manager").join("last_accessed_dir"), last_accessed_dir_str); - last_accessed_dir = std::move(last_accessed_dir_str); - } + //if(!last_accessed_dir_loaded) { + // last_accessed_dir_loaded = true; + // std::string last_accessed_dir_str; + // file_get_content(get_storage_dir().join("file-manager").join("last_accessed_dir"), last_accessed_dir_str); + // last_accessed_dir = std::move(last_accessed_dir_str); + //} if(last_accessed_dir.empty()) return fallback; -- cgit v1.2.3