2026-03-10 05:37:45 +01:00
|
|
|
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
2025-10-29 13:16:57 +01:00
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
|
|
|
|
|
#include "common/fs/fs.h"
|
|
|
|
|
#include "common/fs/path_util.h"
|
2026-03-10 06:51:08 +01:00
|
|
|
#include "gui_settings.h"
|
2025-10-29 13:16:57 +01:00
|
|
|
|
|
|
|
|
namespace FS = Common::FS;
|
|
|
|
|
|
|
|
|
|
namespace GraphicsBackend {
|
|
|
|
|
|
|
|
|
|
QString GuiConfigPath() {
|
2026-03-10 06:51:08 +01:00
|
|
|
return QString::fromStdString(
|
|
|
|
|
FS::PathToUTF8String(FS::GetEdenPath(FS::EdenPath::ConfigDir) / "gui_config.ini"));
|
2025-10-29 13:16:57 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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
|