Update app_init.cpp, remove commented code

This commit is contained in:
CrmC 2024-04-12 16:52:06 +08:00 committed by GitHub
parent e0a0b6b6a2
commit 1965e8db20
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -213,12 +213,9 @@ void init_paths(Root &root_paths) {
root_paths.set_shared_path(storage_path);
root_paths.set_cache_path(storage_path / "cache" / "");
auto fscheck = storage_path / "vita3k.log";
if(fs::exists(fscheck) && !fs::is_empty(fscheck)){
if(fs::exists(fscheck) && !fs::is_empty(fscheck))
fs::copy_file(fscheck , storage_path / "vita3k.log.old", fs::copy_options::overwrite_existing);
// LOG_INFO("Old log moved");
}else{
// LOG_INFO("Log empty, skip copy");
}
#else
auto sdl_base_path = SDL_GetBasePath();
auto base_path = fs_utils::utf8_to_path(sdl_base_path);
@ -371,38 +368,21 @@ bool init(EmuEnvState &state, const Root &root_paths) {
#ifdef ANDROID
fs::create_directories(root_paths.get_shared_path() / "lang");
fs::create_directories(root_paths.get_shared_path() / "lang" / "user");
// fs::create_directories(state.cfg.get_pref_path() / "vita");
fs::create_directories(state.cfg.get_pref_path() / "logs");
fs::create_directories(state.cfg.get_pref_path() / "shared");
auto fscheck = fs::path(root_paths.get_base_path()) / "vita3k.log.old";
state.log_path = fs::path(state.cfg.get_pref_path() / "logs" / "");
state.shared_path = fs::path(state.cfg.get_pref_path() / "shared" / "");
// state.pref_path = fs::path(state.cfg.get_pref_path() / "vita" / "");
state.log_path = fs::path(state.cfg.get_pref_path() / "logs" / ""); // log stored in here
state.shared_path = fs::path(state.cfg.get_pref_path() / "shared" / ""); // for custom languange or texture
if(fs::exists(fscheck)){
// LOG_INFO("Vita3k.log exist!");
if(!fs::equivalent(state.log_path, root_paths.get_base_path())){
fs::copy_file(fscheck , state.log_path / "vita3k.log.txt", fs::copy_options::overwrite_existing);
fs::remove(fscheck);
LOG_INFO("Last Vita3k.log stored at: {}", state.log_path);
}else{
LOG_INFO("Vita3K.Log not copied because it's using default folder!");
}
}else{
// LOG_INFO("Vita3k.log is empty!");
}
#endif
/* LOG_INFO("Base path: {}", state.base_path);
// #if defined(__linux__) && defined(__ANDROID__) && !defined(__APPLE__)
#if !defined(__APPLE__)
LOG_INFO("Static assets path: {}", state.static_assets_path);
LOG_INFO("Shared path: {}", state.shared_path);
LOG_INFO("Log path: {}", state.log_path);
LOG_INFO("User config path: {}", state.config_path);
LOG_INFO("User cache path: {}", state.cache_path);
#endif
*/ //no need
LOG_INFO("User pref path: {}", state.pref_path);
if (ImGui::GetCurrentContext() == NULL) {