1
0
mirror of synced 2024-11-28 09:30:51 +01:00

fix: Never create an imgui.ini file

#1166
This commit is contained in:
WerWolv 2023-07-07 09:20:33 +02:00
parent 14bb98a519
commit 3e797eeea2

View File

@ -996,6 +996,7 @@ namespace hex {
handler.UserData = this; handler.UserData = this;
ImGui::GetCurrentContext()->SettingsHandlers.push_back(handler); ImGui::GetCurrentContext()->SettingsHandlers.push_back(handler);
io.IniFilename = nullptr;
for (const auto &dir : fs::getDefaultPaths(fs::ImHexPath::Config)) { for (const auto &dir : fs::getDefaultPaths(fs::ImHexPath::Config)) {
if (std::fs::exists(dir) && (fs::isPathWritable(dir))) { if (std::fs::exists(dir) && (fs::isPathWritable(dir))) {
s_imguiSettingsPath = dir / "interface.ini"; s_imguiSettingsPath = dir / "interface.ini";
@ -1004,7 +1005,6 @@ namespace hex {
} }
if (!s_imguiSettingsPath.empty() && wolv::io::fs::exists(s_imguiSettingsPath)) { if (!s_imguiSettingsPath.empty() && wolv::io::fs::exists(s_imguiSettingsPath)) {
io.IniFilename = nullptr;
ImGui::LoadIniSettingsFromDisk(wolv::util::toUTF8String(s_imguiSettingsPath).c_str()); ImGui::LoadIniSettingsFromDisk(wolv::util::toUTF8String(s_imguiSettingsPath).c_str());
} }
} }