forked from eden-emu/eden
* save the option on a external file because settings are loaded AFTER Qt window is created and then the graphics backend is already applied Signed-off-by: Caio Oliveira <caiooliveirafarias0@gmail.com>
25 lines
738 B
C++
25 lines
738 B
C++
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
#include "gui_settings.h"
|
|
#include "common/fs/fs.h"
|
|
#include "common/fs/path_util.h"
|
|
|
|
namespace FS = Common::FS;
|
|
|
|
namespace GraphicsBackend {
|
|
|
|
QString GuiConfigPath() {
|
|
return QString::fromStdString(FS::PathToUTF8String(FS::GetEdenPath(FS::EdenPath::ConfigDir) / "gui_config.ini"));
|
|
}
|
|
|
|
void SetForceX11(bool state) {
|
|
(void)FS::CreateParentDir(GuiConfigPath().toStdString());
|
|
QSettings(GuiConfigPath(), QSettings::IniFormat).setValue("gui_force_x11", state);
|
|
}
|
|
|
|
bool GetForceX11() {
|
|
return QSettings(GuiConfigPath(), QSettings::IniFormat).value("gui_force_x11", false).toBool();
|
|
}
|
|
|
|
} // namespace GraphicsBackend
|