From bab3a57d86cfb9e190f6356237e3c2c6233b7763 Mon Sep 17 00:00:00 2001 From: capitalistspz Date: Sun, 23 Jul 2023 15:03:02 +0000 Subject: [PATCH 1/3] Update wxGameList.cpp {:?} --- src/gui/components/wxGameList.cpp | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/gui/components/wxGameList.cpp b/src/gui/components/wxGameList.cpp index 4f3165ab9..6475e4ddd 100644 --- a/src/gui/components/wxGameList.cpp +++ b/src/gui/components/wxGameList.cpp @@ -21,6 +21,8 @@ #include #include +#include + #include "config/ActiveSettings.h" #include "config/LaunchSettings.h" #include "Cafe/TitleList/GameInfo.h" @@ -1291,16 +1293,16 @@ void wxGameList::CreateShortcut(GameInfo2& gameInfo) { fmt::format("[Desktop Entry]\n" "Name={}\n" "Comment=Play {} on Cemu\n" - "Exec={} --title-id {:016x}\n" - "Icon={}\n" + "Exec={:?} --title-id {:016x}\n" + "Icon={:?}\n" "Terminal=false\n" "Type=Application\n" "Categories=Game;", title_name, title_name, - _pathToUtf8(exe_path), + exe_path, title_id, - _pathToUtf8(icon_path.value_or(""))); + icon_path.value_or("")); std::ofstream output_stream(output_path); if (!output_stream.good()) @@ -1339,4 +1341,4 @@ void wxGameList::CreateShortcut(GameInfo2& gameInfo) { } #endif } -#endif \ No newline at end of file +#endif From e1c488f0e37af6ec49c701294b2efb55797c1b40 Mon Sep 17 00:00:00 2001 From: capitalistspz Date: Thu, 27 Jul 2023 20:08:06 +0000 Subject: [PATCH 2/3] Update wxGameList.cpp --- src/gui/components/wxGameList.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/gui/components/wxGameList.cpp b/src/gui/components/wxGameList.cpp index 6475e4ddd..f9858afa2 100644 --- a/src/gui/components/wxGameList.cpp +++ b/src/gui/components/wxGameList.cpp @@ -1289,20 +1289,21 @@ void wxGameList::CreateShortcut(GameInfo2& gameInfo) { } } } + // 'Icon' accepts spaces in file name, does not accept quoted file paths + // 'Exec' does not accept non-escaped spaces, and can accept quoted file paths const auto desktop_entry_string = fmt::format("[Desktop Entry]\n" - "Name={}\n" - "Comment=Play {} on Cemu\n" - "Exec={:?} --title-id {:016x}\n" - "Icon={:?}\n" + "Name={0}\n" + "Comment=Play {0} on Cemu\n" + "Exec={1:?} --title-id {2:016x}\n" + "Icon={3}\n" "Terminal=false\n" "Type=Application\n" "Categories=Game;", title_name, - title_name, - exe_path, + _pathToUtf8(exe_path), title_id, - icon_path.value_or("")); + _pathToUtf8(icon_path.value_or(""))); std::ofstream output_stream(output_path); if (!output_stream.good()) From 1da720f79d2d350f0efe2843a22fe70e63995df2 Mon Sep 17 00:00:00 2001 From: capitalistspz Date: Sat, 29 Jul 2023 21:13:31 +0000 Subject: [PATCH 3/3] Update wxGameList.cpp remove `fmt/std.h` include --- src/gui/components/wxGameList.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/components/wxGameList.cpp b/src/gui/components/wxGameList.cpp index f9858afa2..69f748700 100644 --- a/src/gui/components/wxGameList.cpp +++ b/src/gui/components/wxGameList.cpp @@ -21,8 +21,6 @@ #include #include -#include - #include "config/ActiveSettings.h" #include "config/LaunchSettings.h" #include "Cafe/TitleList/GameInfo.h"