mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Add seperate cache path
This is set to the XDG cache path where possible. It's set to the app's cache path on Android.
This commit is contained in:
parent
51e8c2b277
commit
ea2964f5a1
8 changed files with 118 additions and 30 deletions
12
src/main.cpp
12
src/main.cpp
|
@ -164,7 +164,13 @@ int main(int argc, char *argv[])
|
|||
setup_log_params(cmd_args);
|
||||
|
||||
porting::signal_handler_init();
|
||||
|
||||
#ifdef __ANDROID__
|
||||
porting::initAndroid();
|
||||
porting::initializePathsAndroid();
|
||||
#else
|
||||
porting::initializePaths();
|
||||
#endif
|
||||
|
||||
if (!create_userdata_path()) {
|
||||
errorstream << "Cannot create user data directory" << std::endl;
|
||||
|
@ -422,9 +428,6 @@ static bool create_userdata_path()
|
|||
bool success;
|
||||
|
||||
#ifdef __ANDROID__
|
||||
porting::initAndroid();
|
||||
|
||||
porting::setExternalStorageDir(porting::jnienv);
|
||||
if (!fs::PathExists(porting::path_user)) {
|
||||
success = fs::CreateDir(porting::path_user);
|
||||
} else {
|
||||
|
@ -436,9 +439,6 @@ static bool create_userdata_path()
|
|||
success = fs::CreateDir(porting::path_user);
|
||||
#endif
|
||||
|
||||
infostream << "path_share = " << porting::path_share << std::endl;
|
||||
infostream << "path_user = " << porting::path_user << std::endl;
|
||||
|
||||
return success;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue