Add ?local for the user's local config dir; use it for FFMS2 indexes
Originally committed to SVN as r6235.
This commit is contained in:
parent
44bc249fe8
commit
1285584e89
3 changed files with 8 additions and 4 deletions
|
@ -227,7 +227,7 @@ wxString FFmpegSourceProvider::GetCacheFilename(const wxString& _filename)
|
||||||
|
|
||||||
// Generate the filename
|
// Generate the filename
|
||||||
unsigned int *md5 = (unsigned int*) digest;
|
unsigned int *md5 = (unsigned int*) digest;
|
||||||
wxString result = wxString::Format("?user/ffms2cache/%08X%08X%08X%08X.ffindex",md5[0],md5[1],md5[2],md5[3]);
|
wxString result = wxString::Format("?local/ffms2cache/%08X%08X%08X%08X.ffindex",md5[0],md5[1],md5[2],md5[3]);
|
||||||
result = StandardPaths::DecodePath(result);
|
result = StandardPaths::DecodePath(result);
|
||||||
|
|
||||||
// Ensure that folder exists
|
// Ensure that folder exists
|
||||||
|
@ -284,7 +284,7 @@ wxThread::ExitCode FFmpegSourceCacheCleaner::Entry() {
|
||||||
return (wxThread::ExitCode)1;
|
return (wxThread::ExitCode)1;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString cachedirname = StandardPaths::DecodePath("?user/ffms2cache/");
|
wxString cachedirname = StandardPaths::DecodePath("?local/ffms2cache/");
|
||||||
wxDir cachedir;
|
wxDir cachedir;
|
||||||
if (!cachedir.Open(cachedirname)) {
|
if (!cachedir.Open(cachedirname)) {
|
||||||
LOG_D("provider/ffmpegsource/cache") << "couldn't open cache directory " << STD_STR(cachedirname);
|
LOG_D("provider/ffmpegsource/cache") << "couldn't open cache directory " << STD_STR(cachedirname);
|
||||||
|
|
|
@ -184,6 +184,7 @@ bool AegisubApp::OnInit() {
|
||||||
if (OPT_GET("App/Local Config")->GetBool()) {
|
if (OPT_GET("App/Local Config")->GetBool()) {
|
||||||
// Local config, make ?user mean ?data so all user settings are placed in install dir
|
// Local config, make ?user mean ?data so all user settings are placed in install dir
|
||||||
StandardPaths::SetPathValue("?user", StandardPaths::DecodePath("?data"));
|
StandardPaths::SetPathValue("?user", StandardPaths::DecodePath("?data"));
|
||||||
|
StandardPaths::SetPathValue("?local", StandardPaths::DecodePath("?data"));
|
||||||
config::opt->SetConfigPath(conf_local);
|
config::opt->SetConfigPath(conf_local);
|
||||||
}
|
}
|
||||||
} catch (agi::acs::AcsError const&) {
|
} catch (agi::acs::AcsError const&) {
|
||||||
|
|
|
@ -59,11 +59,14 @@ StandardPaths::StandardPaths() {
|
||||||
|
|
||||||
DoSetPathValue("?data", paths.GetDataDir());
|
DoSetPathValue("?data", paths.GetDataDir());
|
||||||
DoSetPathValue("?user", paths.GetUserDataDir());
|
DoSetPathValue("?user", paths.GetUserDataDir());
|
||||||
|
DoSetPathValue("?local", paths.GetUserLocalDataDir());
|
||||||
DoSetPathValue("?temp", paths.GetTempDir());
|
DoSetPathValue("?temp", paths.GetTempDir());
|
||||||
|
|
||||||
// Create paths if they don't exist
|
// Create paths if they don't exist
|
||||||
wxFileName folder(paths.GetUserDataDir() + "/");
|
if (!wxDirExists(paths.GetUserDataDir()))
|
||||||
if (!folder.DirExists()) folder.Mkdir(0777,wxPATH_MKDIR_FULL);
|
wxMkDir(paths.GetUserDataDir(), 0777);
|
||||||
|
if (!wxDirExists(paths.GetUserLocalDataDir()))
|
||||||
|
wxMkDir(paths.GetUserLocalDataDir(), 0777);
|
||||||
}
|
}
|
||||||
|
|
||||||
wxString StandardPaths::DoDecodePath(wxString path) {
|
wxString StandardPaths::DoDecodePath(wxString path) {
|
||||||
|
|
Loading…
Reference in a new issue