Update title manager when clearing MLC path in settings (#319)

This commit is contained in:
goeiecool9999 2022-10-20 13:18:44 +02:00 committed by GitHub
parent 9df1325d14
commit dd1cb1cccf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 34 additions and 18 deletions

View file

@ -280,15 +280,16 @@ uint32_t GetPhysicalCoreCount()
bool TestWriteAccess(const fs::path& p)
{
std::error_code ec;
// must be path and must exist
if (!fs::exists(p) || !fs::is_directory(p))
if (!fs::exists(p, ec) || !fs::is_directory(p, ec))
return false;
// retry 3 times
for (int i = 0; i < 3; ++i)
{
const auto filename = p / fmt::format("_{}.tmp", GenerateRandomString(8));
if (fs::exists(filename))
if (fs::exists(filename, ec))
continue;
std::ofstream file(filename);
@ -297,7 +298,6 @@ bool TestWriteAccess(const fs::path& p)
file.close();
std::error_code ec;
fs::remove(filename, ec);
return true;
}