App: standard path handling

* distinguish between temp and cache location
* document's transident directory is created in the cache location
* add functions to access temp and cache location via Python
This commit is contained in:
wmayer
2021-11-15 16:26:25 +01:00
parent 7e5e0fe2fe
commit d5726bd7af
7 changed files with 76 additions and 43 deletions

View File

@@ -1684,7 +1684,7 @@ std::string Document::getTransientDirectoryName(const std::string& uuid, const s
std::stringstream s;
QCryptographicHash hash(QCryptographicHash::Sha1);
hash.addData(filename.c_str(), filename.size());
s << App::Application::getTempPath() << App::Application::getExecutableName()
s << App::Application::getUserCachePath() << App::Application::getExecutableName()
<< "_Doc_" << uuid
<< "_" << hash.result().toHex().left(6).constData()
<< "_" << QCoreApplication::applicationPid();