summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorunknown <FreddyFunk@users.noreply.github.com>2019-02-08 14:18:41 +0100
committerunknown <FreddyFunk@users.noreply.github.com>2019-02-08 14:18:41 +0100
commitf27c65eb91b6afe91995e957979f1164444c6edc (patch)
treef7552be0169ac404af837250a58ab87c870caf67
parentUse constexpr char array instead of string where applicable (diff)
downloadyuzu-f27c65eb91b6afe91995e957979f1164444c6edc.tar
yuzu-f27c65eb91b6afe91995e957979f1164444c6edc.tar.gz
yuzu-f27c65eb91b6afe91995e957979f1164444c6edc.tar.bz2
yuzu-f27c65eb91b6afe91995e957979f1164444c6edc.tar.lz
yuzu-f27c65eb91b6afe91995e957979f1164444c6edc.tar.xz
yuzu-f27c65eb91b6afe91995e957979f1164444c6edc.tar.zst
yuzu-f27c65eb91b6afe91995e957979f1164444c6edc.zip
-rw-r--r--src/yuzu/main.cpp28
1 files changed, 11 insertions, 17 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 6d42bc67f..beba519b4 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -1071,21 +1071,16 @@ void GMainWindow::OnGameListOpenFolder(u64 program_id, GameListOpenTarget target
void GMainWindow::OnTransferableShaderCacheOpenFile(u64 program_id) {
ASSERT(program_id != 0);
- std::string transferable_shader_cache_file_path;
constexpr char open_target[] = "Transferable Shader Cache";
- const std::string tranferable_shader_cache_folder =
- FileUtil::GetUserPath(FileUtil::UserPath::ShaderDir) + "opengl" + DIR_SEP "transferable";
+ const QString tranferable_shader_cache_folder_path =
+ QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::ShaderDir)) + "opengl" +
+ DIR_SEP + "transferable";
- transferable_shader_cache_file_path.append(tranferable_shader_cache_folder);
- transferable_shader_cache_file_path.append(DIR_SEP);
- transferable_shader_cache_file_path.append(fmt::format("{:016X}", program_id));
- transferable_shader_cache_file_path.append(".bin");
+ const QString transferable_shader_cache_file_path =
+ tranferable_shader_cache_folder_path + DIR_SEP +
+ QString::fromStdString(fmt::format("{:016X}", program_id)) + ".bin";
- const QString qpath_transferable_shader_cache_file =
- QString::fromStdString(transferable_shader_cache_file_path);
-
- const QFile qfile(qpath_transferable_shader_cache_file);
- if (!qfile.exists()) {
+ if (!QFile(transferable_shader_cache_file_path).exists()) {
QMessageBox::warning(this,
tr("Error Opening %1 File").arg(QString::fromStdString(open_target)),
tr("File does not exist!"));
@@ -1099,14 +1094,13 @@ void GMainWindow::OnTransferableShaderCacheOpenFile(u64 program_id) {
#if defined(Q_OS_WIN)
const QString explorer = "explorer";
QStringList param;
- if (!QFileInfo(qpath_transferable_shader_cache_file).isDir())
+ if (!QFileInfo(transferable_shader_cache_file_path).isDir()) {
param << QLatin1String("/select,");
- param << QDir::toNativeSeparators(qpath_transferable_shader_cache_file);
+ }
+ param << QDir::toNativeSeparators(transferable_shader_cache_file_path);
QProcess::startDetached(explorer, param);
#else
- const QString qpath_transferable_shader_cache_folder =
- QString::fromStdString(tranferable_shader_cache_folder);
- QDesktopServices::openUrl(QUrl::fromLocalFile(qpath_transferable_shader_cache_folder));
+ QDesktopServices::openUrl(QUrl::fromLocalFile(tranferable_shader_cache_folder_path));
#endif
}