mirror of https://github.com/PCSX2/pcsx2.git
Qt: Add logging of early directory setup
Makes debugging this stuff easier in the future.
This commit is contained in:
parent
2928837b76
commit
dc4ef1163f
|
@ -56,6 +56,7 @@ static constexpr u32 SETTINGS_SAVE_DELAY = 1000;
|
||||||
namespace QtHost {
|
namespace QtHost {
|
||||||
static bool InitializeConfig();
|
static bool InitializeConfig();
|
||||||
static bool ShouldUsePortableMode();
|
static bool ShouldUsePortableMode();
|
||||||
|
static void SetAppRoot();
|
||||||
static void SetResourcesDirectory();
|
static void SetResourcesDirectory();
|
||||||
static void SetDataDirectory();
|
static void SetDataDirectory();
|
||||||
static void HookSignals();
|
static void HookSignals();
|
||||||
|
@ -115,10 +116,15 @@ void QtHost::Shutdown()
|
||||||
|
|
||||||
bool QtHost::SetCriticalFolders()
|
bool QtHost::SetCriticalFolders()
|
||||||
{
|
{
|
||||||
EmuFolders::AppRoot = Path::Canonicalize(Path::GetDirectory(FileSystem::GetProgramPath()));
|
SetAppRoot();
|
||||||
SetResourcesDirectory();
|
SetResourcesDirectory();
|
||||||
SetDataDirectory();
|
SetDataDirectory();
|
||||||
|
|
||||||
|
// logging of directories in case something goes wrong super early
|
||||||
|
Console.WriteLn("AppRoot Directory: %s", EmuFolders::AppRoot.c_str());
|
||||||
|
Console.WriteLn("DataRoot Directory: %s", EmuFolders::DataRoot.c_str());
|
||||||
|
Console.WriteLn("Resources Directory: %s", EmuFolders::Resources.c_str());
|
||||||
|
|
||||||
// allow SetDataDirectory() to change settings directory (if we want to split config later on)
|
// allow SetDataDirectory() to change settings directory (if we want to split config later on)
|
||||||
if (EmuFolders::Settings.empty())
|
if (EmuFolders::Settings.empty())
|
||||||
EmuFolders::Settings = Path::Combine(EmuFolders::DataRoot, "inis");
|
EmuFolders::Settings = Path::Combine(EmuFolders::DataRoot, "inis");
|
||||||
|
@ -143,6 +149,14 @@ bool QtHost::ShouldUsePortableMode()
|
||||||
return FileSystem::FileExists(Path::Combine(EmuFolders::AppRoot, "portable.ini").c_str());
|
return FileSystem::FileExists(Path::Combine(EmuFolders::AppRoot, "portable.ini").c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void QtHost::SetAppRoot()
|
||||||
|
{
|
||||||
|
std::string program_path(FileSystem::GetProgramPath());
|
||||||
|
Console.WriteLn("Program Path: %s", program_path.c_str());
|
||||||
|
|
||||||
|
EmuFolders::AppRoot = Path::Canonicalize(Path::GetDirectory(program_path));
|
||||||
|
}
|
||||||
|
|
||||||
void QtHost::SetResourcesDirectory()
|
void QtHost::SetResourcesDirectory()
|
||||||
{
|
{
|
||||||
#ifndef __APPLE__
|
#ifndef __APPLE__
|
||||||
|
@ -227,6 +241,7 @@ bool QtHost::InitializeConfig()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
const std::string path(Path::Combine(EmuFolders::Settings, "PCSX2.ini"));
|
const std::string path(Path::Combine(EmuFolders::Settings, "PCSX2.ini"));
|
||||||
|
Console.WriteLn("Loading config from %s.", path.c_str());
|
||||||
s_base_settings_interface = std::make_unique<INISettingsInterface>(std::move(path));
|
s_base_settings_interface = std::make_unique<INISettingsInterface>(std::move(path));
|
||||||
Host::Internal::SetBaseSettingsLayer(s_base_settings_interface.get());
|
Host::Internal::SetBaseSettingsLayer(s_base_settings_interface.get());
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue