cleanups
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / linux (push) Successful in 2m22s
tests / macos (push) Successful in 2m29s
tests / windows (push) Successful in 4m31s
tests / package-smoke-linux (push) Skipped
tests / package-smoke-windows (push) Skipped
tests / package-smoke-macos (push) Skipped
tests / linux (push) Successful in 2m22s
tests / macos (push) Successful in 2m29s
tests / windows (push) Successful in 4m31s
Signed-off-by: galeon <dertiellis@gmail.com>
This commit is contained in:
1 parent
5635dcc558
commit
98344a1870
15 files changed
+38
-480
No files matched your search
+2
-7
@@ -9,18 +9,16 @@ namespace {
|
||||
|
||||
const QString kFolderName = QStringLiteral("BiLauncher");
|
||||
|
||||
// Домашняя папка, от которой строятся все пути (см. LauncherPaths::homeOverride()).
|
||||
QString homeBase()
|
||||
{
|
||||
const QString overridden = LauncherPaths::homeOverride();
|
||||
return overridden.isEmpty() ? QDir::homePath() : overridden;
|
||||
}
|
||||
|
||||
} // namespace
|
||||
}
|
||||
|
||||
QString LauncherPaths::homeOverride()
|
||||
{
|
||||
// Относительный путь зависел бы от текущей папки процесса — такой не принимаем.
|
||||
const QString value = QDir::fromNativeSeparators(qEnvironmentVariable("BILAUNCHER_HOME"));
|
||||
if (value.isEmpty() || !QDir::isAbsolutePath(value))
|
||||
return QString();
|
||||
@@ -33,7 +31,7 @@ QString LauncherPaths::containerDir()
|
||||
return homeBase() + QStringLiteral("/AppData/Roaming");
|
||||
#elif defined(Q_OS_MACOS)
|
||||
return homeBase() + QStringLiteral("/Library/Application Support");
|
||||
#else // Linux и прочие Unix-системы
|
||||
#else
|
||||
return homeBase();
|
||||
#endif
|
||||
}
|
||||
@@ -46,7 +44,6 @@ QString LauncherPaths::rootDir()
|
||||
QString LauncherPaths::defaultMinecraftDir()
|
||||
{
|
||||
#if defined(Q_OS_MACOS)
|
||||
// На macOS папка игры исторически без точки.
|
||||
return containerDir() + QStringLiteral("/minecraft");
|
||||
#else
|
||||
return containerDir() + QStringLiteral("/.minecraft");
|
||||
@@ -145,8 +142,6 @@ bool LauncherPaths::ensureRootExists(QString *error)
|
||||
return false;
|
||||
}
|
||||
|
||||
// mkpath отвечает true и для существующего каталога, в который нельзя писать,
|
||||
// и для подсунутого вместо папки файла — тогда все сохранения провалились бы молча.
|
||||
const QFileInfo info(path);
|
||||
if (!info.isDir() || !info.isWritable()) {
|
||||
if (error)
|
||||
|
||||
Reference in new issue
Block a user