summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar unknown2019-02-08 14:18:41 +0100
committerGravatar unknown2019-02-08 14:18:41 +0100
commitf27c65eb91b6afe91995e957979f1164444c6edc (patch)
treef7552be0169ac404af837250a58ab87c870caf67
parentUse constexpr char array instead of string where applicable (diff)
downloadyuzu-f27c65eb91b6afe91995e957979f1164444c6edc.tar.gz
yuzu-f27c65eb91b6afe91995e957979f1164444c6edc.tar.xz
yuzu-f27c65eb91b6afe91995e957979f1164444c6edc.zip
Use QString instead of std::string where applicable
Diffstat (limited to '')
-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
1071void GMainWindow::OnTransferableShaderCacheOpenFile(u64 program_id) { 1071void GMainWindow::OnTransferableShaderCacheOpenFile(u64 program_id) {
1072 ASSERT(program_id != 0); 1072 ASSERT(program_id != 0);
1073 1073
1074 std::string transferable_shader_cache_file_path;
1075 constexpr char open_target[] = "Transferable Shader Cache"; 1074 constexpr char open_target[] = "Transferable Shader Cache";
1076 const std::string tranferable_shader_cache_folder = 1075 const QString tranferable_shader_cache_folder_path =
1077 FileUtil::GetUserPath(FileUtil::UserPath::ShaderDir) + "opengl" + DIR_SEP "transferable"; 1076 QString::fromStdString(FileUtil::GetUserPath(FileUtil::UserPath::ShaderDir)) + "opengl" +
1077 DIR_SEP + "transferable";
1078 1078
1079 transferable_shader_cache_file_path.append(tranferable_shader_cache_folder); 1079 const QString transferable_shader_cache_file_path =
1080 transferable_shader_cache_file_path.append(DIR_SEP); 1080 tranferable_shader_cache_folder_path + DIR_SEP +
1081 transferable_shader_cache_file_path.append(fmt::format("{:016X}", program_id)); 1081 QString::fromStdString(fmt::format("{:016X}", program_id)) + ".bin";
1082 transferable_shader_cache_file_path.append(".bin");
1083 1082
1084 const QString qpath_transferable_shader_cache_file = 1083 if (!QFile(transferable_shader_cache_file_path).exists()) {
1085 QString::fromStdString(transferable_shader_cache_file_path);
1086
1087 const QFile qfile(qpath_transferable_shader_cache_file);
1088 if (!qfile.exists()) {
1089 QMessageBox::warning(this, 1084 QMessageBox::warning(this,
1090 tr("Error Opening %1 File").arg(QString::fromStdString(open_target)), 1085 tr("Error Opening %1 File").arg(QString::fromStdString(open_target)),
1091 tr("File does not exist!")); 1086 tr("File does not exist!"));
@@ -1099,14 +1094,13 @@ void GMainWindow::OnTransferableShaderCacheOpenFile(u64 program_id) {
1099#if defined(Q_OS_WIN) 1094#if defined(Q_OS_WIN)
1100 const QString explorer = "explorer"; 1095 const QString explorer = "explorer";
1101 QStringList param; 1096 QStringList param;
1102 if (!QFileInfo(qpath_transferable_shader_cache_file).isDir()) 1097 if (!QFileInfo(transferable_shader_cache_file_path).isDir()) {
1103 param << QLatin1String("/select,"); 1098 param << QLatin1String("/select,");
1104 param << QDir::toNativeSeparators(qpath_transferable_shader_cache_file); 1099 }
1100 param << QDir::toNativeSeparators(transferable_shader_cache_file_path);
1105 QProcess::startDetached(explorer, param); 1101 QProcess::startDetached(explorer, param);
1106#else 1102#else
1107 const QString qpath_transferable_shader_cache_folder = 1103 QDesktopServices::openUrl(QUrl::fromLocalFile(tranferable_shader_cache_folder_path));
1108 QString::fromStdString(tranferable_shader_cache_folder);
1109 QDesktopServices::openUrl(QUrl::fromLocalFile(qpath_transferable_shader_cache_folder));
1110#endif 1104#endif
1111} 1105}
1112 1106