more common funcs
Signed-off-by: crueter <crueter@eden-emu.dev>
This commit is contained in:
parent
d03ce976b2
commit
b1b338d9ae
11 changed files with 332 additions and 218 deletions
20
src/qt_common/qt_path_util.cpp
Normal file
20
src/qt_common/qt_path_util.cpp
Normal file
|
@ -0,0 +1,20 @@
|
|||
#include "qt_path_util.h"
|
||||
#include <QDesktopServices>
|
||||
#include <QString>
|
||||
#include <QUrl>
|
||||
#include "common/fs/fs.h"
|
||||
#include "common/fs/path_util.h"
|
||||
#include <fmt/format.h>
|
||||
|
||||
bool QtCommon::PathUtil::OpenShaderCache(u64 program_id)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
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));
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue