[qt_common] reorg, move more stuff out of main

Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
crueter 2025-08-30 19:48:13 -04:00
parent 75f18095e0
commit ca349ad7b0
Signed by: crueter
GPG key ID: 425ACD2D4830EBC6
20 changed files with 923 additions and 680 deletions

View file

@ -7,17 +7,22 @@
#include <QUrl>
#include "common/fs/fs.h"
#include "common/fs/path_util.h"
#include "qt_common/qt_frontend_util.h"
#include <fmt/format.h>
bool QtCommon::PathUtil::OpenShaderCache(u64 program_id)
namespace QtCommon::Path {
bool OpenShaderCache(u64 program_id, QObject *parent)
{
const auto shader_cache_dir = Common::FS::GetEdenPath(Common::FS::EdenPath::ShaderDir);
const auto shader_cache_folder_path{shader_cache_dir / fmt::format("{:016x}", program_id)};
if (!Common::FS::CreateDirs(shader_cache_folder_path)) {
return false;
QtCommon::Frontend::ShowMessage(QMessageBox::Warning, "Error Opening Shader Cache", "Failed to create or open shader cache for this title, ensure your app data directory has write permissions.", QMessageBox::Ok, parent);
}
const auto shader_path_string{Common::FS::PathToUTF8String(shader_cache_folder_path)};
const auto qt_shader_cache_path = QString::fromStdString(shader_path_string);
return QDesktopServices::openUrl(QUrl::fromLocalFile(qt_shader_cache_path));
}
}