summaryrefslogtreecommitdiff
path: root/src/yuzu
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu')
-rw-r--r--src/yuzu/main.cpp24
-rw-r--r--src/yuzu/util/util.cpp3
-rw-r--r--src/yuzu/util/util.h10
3 files changed, 14 insertions, 23 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index fd68ac9b6..c3c12eeec 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2851,7 +2851,7 @@ bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
// Replace characters that are illegal in Windows filenames
std::filesystem::path shortcut_path_full =
- shortcut_path / Common::FS::UTF8FilenameSantizer(name);
+ shortcut_path / Common::FS::UTF8FilenameSanitizer(name);
#if defined(__linux__) || defined(__FreeBSD__)
shortcut_path_full += ".desktop";
@@ -2859,8 +2859,7 @@ bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
shortcut_path_full += ".lnk";
#endif
- LOG_INFO(Common, "[GMainWindow::CreateShortcutLink] Create shortcut path: {}",
- shortcut_path_full.string());
+ LOG_ERROR(Frontend, "Create shortcut path: {}", shortcut_path_full.string());
#if defined(__linux__) || defined(__FreeBSD__)
// This desktop file template was writing referencing
@@ -2869,7 +2868,7 @@ bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
// Plus 'Type' is required
if (name.empty()) {
- LOG_ERROR(Common, "[GMainWindow::CreateShortcutLink] Name is empty");
+ LOG_ERROR(Frontend, "Name is empty");
shortcut_succeeded = false;
return shortcut_succeeded;
}
@@ -2911,14 +2910,13 @@ bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
return true;
} else {
- LOG_ERROR(Common, "[GMainWindow::CreateShortcutLink] Failed to create shortcut");
+ LOG_ERROR(Frontend, "Failed to create shortcut");
return false;
}
shortcut_stream.close();
} catch (const std::exception& e) {
- LOG_ERROR(Common, "[GMainWindow::CreateShortcutLink] Failed to create shortcut: {}",
- e.what());
+ LOG_ERROR(Frontend, "Failed to create shortcut: {}", e.what());
}
#elif defined(_WIN32)
// Initialize COM
@@ -2970,7 +2968,7 @@ bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
pPersistFile->Release();
}
} else {
- LOG_ERROR(Common, "[GMainWindow::CreateShortcutLink] Failed to create IShellLinkWinstance");
+ LOG_ERROR(Frontend, "Failed to create IShellLinkWinstance");
}
ps1->Release();
@@ -2978,9 +2976,9 @@ bool GMainWindow::CreateShortcutLink(const std::filesystem::path& shortcut_path,
#endif
if (shortcut_succeeded && std::filesystem::is_regular_file(shortcut_path_full)) {
- LOG_INFO(Common, "[GMainWindow::CreateShortcutLink] Shortcut created");
+ LOG_ERROR(Frontend, "Shortcut created");
} else {
- LOG_ERROR(Common, "[GMainWindow::CreateShortcutLink] Shortcut error, failed to create it");
+ LOG_ERROR(Frontend, "Shortcut error, failed to create it");
shortcut_succeeded = false;
}
@@ -3047,7 +3045,7 @@ bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_vi
icons_path = Common::FS::GetYuzuPath(Common::FS::YuzuPath::ConfigDir) / "icons";
ico_extension = "ico";
#elif defined(__linux__) || defined(__FreeBSD__)
- icons_path = GetDataDirectory("XDG_DATA_HOME") / "icons/hicolor/256x256";
+ icons_path = Common::FS::GetDataDirectory("XDG_DATA_HOME") / "icons/hicolor/256x256";
#endif
// Create icons directory if it doesn't exist
@@ -3130,7 +3128,7 @@ void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& ga
QImage::fromData(icon_image_file.data(), static_cast<int>(icon_image_file.size()));
if (GMainWindow::MakeShortcutIcoPath(program_id, title, icons_path)) {
- if (!SaveIconToFile(icon_data, icons_path)) {
+ if (!SaveIconToFile(icons_path, icon_data)) {
LOG_ERROR(Frontend, "Could not write icon to file");
}
}
@@ -3138,7 +3136,7 @@ void GMainWindow::OnGameListCreateShortcut(u64 program_id, const std::string& ga
} else {
GMainWindow::CreateShortcutMessagesGUI(this, GMainWindow::CREATE_SHORTCUT_MSGBOX_ERROR,
title);
- LOG_ERROR(Frontend, "[GMainWindow::OnGameListCreateShortcut] Invalid shortcut target");
+ LOG_ERROR(Frontend, "Invalid shortcut target");
return;
}
diff --git a/src/yuzu/util/util.cpp b/src/yuzu/util/util.cpp
index 9755004ad..7b2a47496 100644
--- a/src/yuzu/util/util.cpp
+++ b/src/yuzu/util/util.cpp
@@ -42,7 +42,7 @@ QPixmap CreateCirclePixmapFromColor(const QColor& color) {
return circle_pixmap;
}
-bool SaveIconToFile(const QImage& image, const std::filesystem::path& icon_path) {
+bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image) {
#if defined(WIN32)
#pragma pack(push, 2)
struct IconDir {
@@ -142,7 +142,6 @@ bool SaveIconToFile(const QImage& image, const std::filesystem::path& icon_path)
} else {
LOG_INFO(Frontend, "Wrote an icon to {}", icon_path.string());
}
-
return true;
#else
return false;
diff --git a/src/yuzu/util/util.h b/src/yuzu/util/util.h
index 31e82ff67..4094cf6c2 100644
--- a/src/yuzu/util/util.h
+++ b/src/yuzu/util/util.h
@@ -15,21 +15,15 @@
/**
* Creates a circle pixmap from a specified color
- *
* @param color The color the pixmap shall have
- *
* @return QPixmap circle pixmap
*/
-
[[nodiscard]] QPixmap CreateCirclePixmapFromColor(const QColor& color);
/**
* Saves a windows icon to a file
- *
- * @param image The image to save
- *
* @param path The icons path
- *
+ * @param image The image to save
* @return bool If the operation succeeded
*/
-[[nodiscard]] bool SaveIconToFile(const QImage& image, const std::filesystem::path& icon_path);
+[[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image);