Fix compilation problems and code issues

This commit is contained in:
FearlessTobi 2024-02-08 18:24:19 +01:00
parent a4b16bfb1f
commit 1fff5b5e32
5 changed files with 9 additions and 5 deletions

View file

@ -79,6 +79,7 @@
#include "common/memory_detect.h" #include "common/memory_detect.h"
#include "common/scm_rev.h" #include "common/scm_rev.h"
#include "common/scope_exit.h" #include "common/scope_exit.h"
#include "common/string_util.h"
#if CITRA_ARCH(x86_64) #if CITRA_ARCH(x86_64)
#include "common/x64/cpu_detect.h" #include "common/x64/cpu_detect.h"
#endif #endif

View file

@ -5,7 +5,6 @@
#pragma once #pragma once
#include <array> #include <array>
#include <filesystem>
#include <memory> #include <memory>
#include <vector> #include <vector>
#include <QMainWindow> #include <QMainWindow>
@ -22,6 +21,9 @@
#include <QDBusObjectPath> #include <QDBusObjectPath>
#endif #endif
// Needs to be included at the end due to https://bugreports.qt.io/browse/QTBUG-73263
#include <filesystem>
class AboutDialog; class AboutDialog;
class Config; class Config;
class ClickableLabel; class ClickableLabel;

View file

@ -43,7 +43,7 @@ QPixmap CreateCirclePixmapFromColor(const QColor& color) {
return circle_pixmap; return circle_pixmap;
} }
QPixmap GetQPixmapFromSMDH(std::vector<u8>& smdh_data) { QPixmap GetQPixmapFromSMDH(const std::vector<u8>& smdh_data) {
Loader::SMDH smdh; Loader::SMDH smdh;
std::memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH)); std::memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH));
@ -158,4 +158,4 @@ bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image)
#else #else
return false; return false;
#endif #endif
} }

View file

@ -26,7 +26,7 @@ QPixmap CreateCirclePixmapFromColor(const QColor& color);
* @param smdh_data SMDH data * @param smdh_data SMDH data
* @return QPixmap game icon * @return QPixmap game icon
*/ */
QPixmap GetQPixmapFromSMDH(std::vector<u8>& smdh_data); QPixmap GetQPixmapFromSMDH(const std::vector<u8>& smdh_data);
/** /**
* Saves a windows icon to a file * Saves a windows icon to a file
@ -34,4 +34,4 @@ QPixmap GetQPixmapFromSMDH(std::vector<u8>& smdh_data);
* @param image The image to save * @param image The image to save
* @return bool If the operation succeeded * @return bool If the operation succeeded
*/ */
[[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image); [[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image);

View file

@ -10,6 +10,7 @@
#include <ios> #include <ios>
#include <limits> #include <limits>
#include <optional> #include <optional>
#include <span>
#include <string> #include <string>
#include <string_view> #include <string_view>
#include <type_traits> #include <type_traits>