diff options
| author | 2023-10-15 03:16:29 -0300 | |
|---|---|---|
| committer | 2023-10-15 03:16:29 -0300 | |
| commit | 0a75519ab590e250c94dc04b3f6072a69ef7e96b (patch) | |
| tree | 54deace8df1a942d1c7f04a80b13c56714a59ff7 /src | |
| parent | Improved shortcut: add games in applist for Windows, question for start game ... (diff) | |
| download | yuzu-0a75519ab590e250c94dc04b3f6072a69ef7e96b.tar.gz yuzu-0a75519ab590e250c94dc04b3f6072a69ef7e96b.tar.xz yuzu-0a75519ab590e250c94dc04b3f6072a69ef7e96b.zip | |
Fixes and improvements
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/fs/path_util.cpp | 35 | ||||
| -rw-r--r-- | src/yuzu/main.h | 2 | ||||
| -rw-r--r-- | src/yuzu/util/util.cpp | 4 |
3 files changed, 30 insertions, 11 deletions
diff --git a/src/common/fs/path_util.cpp b/src/common/fs/path_util.cpp index a461161ed..f030939ce 100644 --- a/src/common/fs/path_util.cpp +++ b/src/common/fs/path_util.cpp | |||
| @@ -363,13 +363,28 @@ fs::path GetDesktopPath() { | |||
| 363 | LOG_ERROR(Common_Filesystem, | 363 | LOG_ERROR(Common_Filesystem, |
| 364 | "[GetDesktopPath] Failed to get the path to the desktop directory"); | 364 | "[GetDesktopPath] Failed to get the path to the desktop directory"); |
| 365 | } | 365 | } |
| 366 | return fs::path{}; | ||
| 366 | #else | 367 | #else |
| 367 | fs::path shortcut_path = GetHomeDirectory() / "Desktop"; | 368 | fs::path shortcut_path{}; |
| 368 | if (fs::exists(shortcut_path)) { | 369 | |
| 369 | return shortcut_path; | 370 | // Array of possible desktop |
| 371 | std::vector<std::string> desktop_paths = { | ||
| 372 | "Desktop", "Escritorio", "Bureau", "Skrivebord", "Plocha", | ||
| 373 | "Skrivbord", "Desktop", "Рабочий стол", "Pulpit", "Área de Trabalho", | ||
| 374 | "Робочий стіл", "Bureaublad", "デスクトップ", "桌面", "Pöytä", | ||
| 375 | "바탕 화면", "바탕 화면", "سطح المكتب", "دسکتاپ", "שולחן עבודה"}; | ||
| 376 | |||
| 377 | for (auto& path : desktop_paths) { | ||
| 378 | if (fs::exists(GetHomeDirectory() / path)) { | ||
| 379 | return path; | ||
| 380 | } | ||
| 370 | } | 381 | } |
| 382 | |||
| 383 | LOG_ERROR(Common_Filesystem, | ||
| 384 | "[GetDesktopPath] Failed to get the path to the desktop directory"); | ||
| 385 | |||
| 386 | return shortcut_path; | ||
| 371 | #endif | 387 | #endif |
| 372 | return fs::path{}; | ||
| 373 | } | 388 | } |
| 374 | 389 | ||
| 375 | fs::path GetAppsShortcutsPath() { | 390 | fs::path GetAppsShortcutsPath() { |
| @@ -387,16 +402,20 @@ fs::path GetAppsShortcutsPath() { | |||
| 387 | LOG_ERROR(Common_Filesystem, | 402 | LOG_ERROR(Common_Filesystem, |
| 388 | "[GetAppsShortcutsPath] Failed to get the path to the App Shortcuts directory"); | 403 | "[GetAppsShortcutsPath] Failed to get the path to the App Shortcuts directory"); |
| 389 | } | 404 | } |
| 405 | |||
| 406 | return fs::path{}; | ||
| 390 | #else | 407 | #else |
| 391 | fs::path shortcut_path = GetHomeDirectory() / ".local/share/applications"; | 408 | fs::path shortcut_path = GetHomeDirectory() / ".local/share/applications"; |
| 392 | if (!fs::exists(shortcut_path)) { | 409 | if (!fs::exists(shortcut_path)) { |
| 393 | shortcut_path = std::filesystem::path("/usr/share/applications"); | 410 | shortcut_path = std::filesystem::path("/usr/share/applications"); |
| 394 | return shortcut_path; | 411 | if (!fs::exists(shortcut_path)) { |
| 395 | } else { | 412 | LOG_ERROR(Common_Filesystem, |
| 396 | return shortcut_path; | 413 | "[GetAppsShortcutsPath] Failed to get the path to the App Shortcuts " |
| 414 | "directory"); | ||
| 415 | } | ||
| 397 | } | 416 | } |
| 398 | #endif | ||
| 399 | return fs::path{}; | 417 | return fs::path{}; |
| 418 | #endif | ||
| 400 | } | 419 | } |
| 401 | 420 | ||
| 402 | // vvvvvvvvvv Deprecated vvvvvvvvvv // | 421 | // vvvvvvvvvv Deprecated vvvvvvvvvv // |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index bf6756b48..d7426607f 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -152,7 +152,7 @@ class GMainWindow : public QMainWindow { | |||
| 152 | UI_EMU_STOPPING, | 152 | UI_EMU_STOPPING, |
| 153 | }; | 153 | }; |
| 154 | 154 | ||
| 155 | const enum { | 155 | enum { |
| 156 | CREATE_SHORTCUT_MSGBOX_FULLSCREEN_YES, | 156 | CREATE_SHORTCUT_MSGBOX_FULLSCREEN_YES, |
| 157 | CREATE_SHORTCUT_MSGBOX_SUCCESS, | 157 | CREATE_SHORTCUT_MSGBOX_SUCCESS, |
| 158 | CREATE_SHORTCUT_MSGBOX_ERROR, | 158 | CREATE_SHORTCUT_MSGBOX_ERROR, |
diff --git a/src/yuzu/util/util.cpp b/src/yuzu/util/util.cpp index 4d199ebd1..9755004ad 100644 --- a/src/yuzu/util/util.cpp +++ b/src/yuzu/util/util.cpp | |||
| @@ -144,7 +144,7 @@ bool SaveIconToFile(const QImage& image, const std::filesystem::path& icon_path) | |||
| 144 | } | 144 | } |
| 145 | 145 | ||
| 146 | return true; | 146 | return true; |
| 147 | #endif | 147 | #else |
| 148 | |||
| 149 | return false; | 148 | return false; |
| 149 | #endif | ||
| 150 | } | 150 | } |