diff options
author | boludoz <francomaro@gmail.com> | 2023-10-17 04:50:09 +0200 |
---|---|---|
committer | boludoz <francomaro@gmail.com> | 2023-10-17 04:50:09 +0200 |
commit | fc4b45ebd344a3e3d571b8516e73cd9afe824a9b (patch) | |
tree | eaaeb45cac8c9a2db31f1f4198a9eb77d28eb514 | |
parent | More @liamwhite suggestions applied. (diff) | |
download | yuzu-fc4b45ebd344a3e3d571b8516e73cd9afe824a9b.tar yuzu-fc4b45ebd344a3e3d571b8516e73cd9afe824a9b.tar.gz yuzu-fc4b45ebd344a3e3d571b8516e73cd9afe824a9b.tar.bz2 yuzu-fc4b45ebd344a3e3d571b8516e73cd9afe824a9b.tar.lz yuzu-fc4b45ebd344a3e3d571b8516e73cd9afe824a9b.tar.xz yuzu-fc4b45ebd344a3e3d571b8516e73cd9afe824a9b.tar.zst yuzu-fc4b45ebd344a3e3d571b8516e73cd9afe824a9b.zip |
Diffstat (limited to '')
-rw-r--r-- | src/yuzu/main.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index 75fbd042a..0e0d7ef0e 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -2847,6 +2847,13 @@ bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path, const std::string& arguments, const std::string& categories, const std::string& keywords, const std::string& name) try { +#if defined(__linux__) || defined(__FreeBSD__) || defined(_WIN32) // Linux, FreeBSD and Windows + // Plus 'name' is required + if (name.empty()) { + LOG_ERROR(Frontend, "Name is empty"); + return false; + } + // Copy characters if they are not illegal in Windows filenames std::string filename = ""; const std::string illegal_chars = "<>:\"/\\|?*"; @@ -2865,17 +2872,12 @@ bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path, } std::filesystem::path shortcut_path_full = shortcut_path / filename; +#endif #if defined(__linux__) || defined(__FreeBSD__) // Linux and FreeBSD // Reference for the desktop file template: // https://specifications.freedesktop.org/desktop-entry-spec/desktop-entry-spec-1.0.html - // Plus 'Type' is required - if (name.empty()) { - LOG_ERROR(Frontend, "Name is empty"); - return false; - } - // Append .desktop extension shortcut_path_full += ".desktop"; |