From f2a8ab5547d570fa60c494acfacbbd03e144a4c7 Mon Sep 17 00:00:00 2001 From: Reg Tiangha Date: Wed, 1 May 2024 11:08:03 -0600 Subject: [PATCH] lime_qt: Fix remaining build errors Co-Authored-By: FearlessTobi --- src/common/common_paths.h | 1 - src/common/file_util.cpp | 4 ++-- src/common/file_util.h | 3 +++ src/core/arm/arm_interface.h | 2 +- src/core/core_timing.h | 2 +- src/core/hle/service/frd/frd.cpp | 2 +- src/core/hle/service/http/http_c.h | 8 ++++---- src/lime_qt/debugger/profiler.h | 1 + src/lime_qt/debugger/registers.h | 1 + src/lime_qt/loading_screen.cpp | 1 - src/lime_qt/main.cpp | 4 +++- src/lime_qt/main.h | 4 +++- src/lime_qt/uisettings.h | 2 ++ src/lime_qt/util/util.cpp | 3 ++- src/lime_qt/util/util.h | 5 +++-- 15 files changed, 27 insertions(+), 16 deletions(-) diff --git a/src/common/common_paths.h b/src/common/common_paths.h index 4c96158c9..71c4de06f 100644 --- a/src/common/common_paths.h +++ b/src/common/common_paths.h @@ -53,7 +53,6 @@ #define SHADER_DIR "shaders" #define STATES_DIR "states" #define ICONS_DIR "icons" -#define PLAY_TIME_DIR "play_time" // Filenames // Files in the directory returned by GetUserPath(UserPath::LogDir) diff --git a/src/common/file_util.cpp b/src/common/file_util.cpp index 7f7ce34cf..3e052454f 100644 --- a/src/common/file_util.cpp +++ b/src/common/file_util.cpp @@ -729,7 +729,7 @@ static const std::string& GetHomeDirectory() { * @return The directory path * @sa http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html */ -[[maybe_unused]] static const std::string GetUserDirectory(const std::string& envvar) { +[[maybe_unused]] const std::string GetUserDirectory(const std::string& envvar) { const char* directory = getenv(envvar.c_str()); std::string user_dir; @@ -827,7 +827,7 @@ void SetUserPath(const std::string& path) { g_paths.emplace(UserPath::LoadDir, user_path + LOAD_DIR DIR_SEP); g_paths.emplace(UserPath::StatesDir, user_path + STATES_DIR DIR_SEP); g_paths.emplace(UserPath::IconsDir, user_path + ICONS_DIR DIR_SEP); - g_paths.emplace(UserPath::PlayTimeDir, user_path + PLAY_TIME_DIR DIR_SEP); + g_paths.emplace(UserPath::PlayTimeDir, user_path + LOG_DIR DIR_SEP); g_default_paths = g_paths; } diff --git a/src/common/file_util.h b/src/common/file_util.h index 213319ca6..c24beeb7a 100644 --- a/src/common/file_util.h +++ b/src/common/file_util.h @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -202,6 +203,8 @@ void UpdateUserPath(UserPath path, const std::string& filename); #ifdef _WIN32 [[nodiscard]] const std::string& GetExeDirectory(); [[nodiscard]] std::string AppDataRoamingDirectory(); +#else +[[nodiscard]] const std::string GetUserDirectory(const std::string& envvar); #endif std::size_t WriteStringToFile(bool text_file, const std::string& filename, std::string_view str); diff --git a/src/core/arm/arm_interface.h b/src/core/arm/arm_interface.h index 5723115c3..1f6ddc9e9 100644 --- a/src/core/arm/arm_interface.h +++ b/src/core/arm/arm_interface.h @@ -25,7 +25,7 @@ namespace Core { class ARM_Interface : NonCopyable { public: explicit ARM_Interface(u32 id, std::shared_ptr timer) - : timer(timer), id(id){}; + : timer(timer), id(id) {}; virtual ~ARM_Interface() {} struct ThreadContext { diff --git a/src/core/core_timing.h b/src/core/core_timing.h index d82fc7faf..7a69afb97 100644 --- a/src/core/core_timing.h +++ b/src/core/core_timing.h @@ -251,7 +251,7 @@ public: explicit Timing(std::size_t num_cores, u32 cpu_clock_percentage, s64 override_base_ticks = -1); - ~Timing(){}; + ~Timing() {}; /** * Returns the event_type identifier. if name is not unique, it will assert. diff --git a/src/core/hle/service/frd/frd.cpp b/src/core/hle/service/frd/frd.cpp index 2b0c0d876..83678d546 100644 --- a/src/core/hle/service/frd/frd.cpp +++ b/src/core/hle/service/frd/frd.cpp @@ -281,7 +281,7 @@ void Module::Interface::GetLastResponseResult(Kernel::HLERequestContext& ctx) { rb.Push(ResultSuccess); } -Module::Module(Core::System& system) : system(system){}; +Module::Module(Core::System& system) : system(system) {}; Module::~Module() = default; void InstallInterfaces(Core::System& system) { diff --git a/src/core/hle/service/http/http_c.h b/src/core/hle/service/http/http_c.h index 93becaae8..43a1c631d 100644 --- a/src/core/hle/service/http/http_c.h +++ b/src/core/hle/service/http/http_c.h @@ -183,7 +183,7 @@ public: }; struct RequestHeader { - RequestHeader(std::string name, std::string value) : name(name), value(value){}; + RequestHeader(std::string name, std::string value) : name(name), value(value) {}; std::string name; std::string value; @@ -213,10 +213,10 @@ public: struct Param { Param(const std::vector& value) - : name(value.begin(), value.end()), value(value.begin(), value.end()){}; - Param(const std::string& name, const std::string& value) : name(name), value(value){}; + : name(value.begin(), value.end()), value(value.begin(), value.end()) {}; + Param(const std::string& name, const std::string& value) : name(name), value(value) {}; Param(const std::string& name, const std::vector& value) - : name(name), value(value.begin(), value.end()), is_binary(true){}; + : name(name), value(value.begin(), value.end()), is_binary(true) {}; std::string name; std::string value; bool is_binary = false; diff --git a/src/lime_qt/debugger/profiler.h b/src/lime_qt/debugger/profiler.h index 43d470aee..dc1b1346a 100644 --- a/src/lime_qt/debugger/profiler.h +++ b/src/lime_qt/debugger/profiler.h @@ -5,6 +5,7 @@ #pragma once #include +#include "common/common_types.h" #include "common/microprofile.h" class MicroProfileDialog : public QWidget { diff --git a/src/lime_qt/debugger/registers.h b/src/lime_qt/debugger/registers.h index 19ed374ea..0e38a8700 100644 --- a/src/lime_qt/debugger/registers.h +++ b/src/lime_qt/debugger/registers.h @@ -6,6 +6,7 @@ #include #include +#include "common/common_types.h" class QTreeWidget; class QTreeWidgetItem; diff --git a/src/lime_qt/loading_screen.cpp b/src/lime_qt/loading_screen.cpp index d2df6bd5e..e039fb89b 100644 --- a/src/lime_qt/loading_screen.cpp +++ b/src/lime_qt/loading_screen.cpp @@ -14,7 +14,6 @@ #include #include #include -#include "citra_qt/util/util.h" #include "common/logging/log.h" #include "core/loader/loader.h" #include "core/loader/smdh.h" diff --git a/src/lime_qt/main.cpp b/src/lime_qt/main.cpp index a9bb2a4c5..39225600f 100644 --- a/src/lime_qt/main.cpp +++ b/src/lime_qt/main.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #ifdef __APPLE__ #include // for chdir #endif @@ -82,6 +83,7 @@ #include "common/x64/cpu_detect.h" #endif #include "common/settings.h" +#include "common/string_util.h" #include "core/core.h" #include "core/dumping/backend.h" #include "core/file_sys/archive_extsavedata.h" @@ -1805,7 +1807,7 @@ bool GMainWindow::MakeShortcutIcoPath(const u64 program_id, const std::string_vi out_icon_path = FileUtil::GetUserPath(FileUtil::UserPath::IconsDir); ico_extension = "ico"; #elif defined(__linux__) || defined(__FreeBSD__) - out_icon_path = FileUtil::GetDataDirectory("XDG_DATA_HOME") / "icons/hicolor/256x256"; + out_icon_path = FileUtil::GetUserDirectory("XDG_DATA_HOME") + "icons/hicolor/256x256"; #endif // Create icons directory if it doesn't exist if (!FileUtil::CreateDir(out_icon_path.string())) { diff --git a/src/lime_qt/main.h b/src/lime_qt/main.h index a25d2ac29..fecba63f9 100644 --- a/src/lime_qt/main.h +++ b/src/lime_qt/main.h @@ -5,7 +5,6 @@ #pragma once #include -#include #include #include #include @@ -22,6 +21,9 @@ #include #endif +// Needs to be included at the end due to https://bugreports.qt.io/browse/QTBUG-73263 +#include + class AboutDialog; class Config; class ClickableLabel; diff --git a/src/lime_qt/uisettings.h b/src/lime_qt/uisettings.h index e75f57545..43d75fb21 100644 --- a/src/lime_qt/uisettings.h +++ b/src/lime_qt/uisettings.h @@ -148,6 +148,8 @@ struct Values { // logging Settings::Setting show_console{false, "showConsole"}; + + bool shortcut_already_warned = false; }; extern Values values; diff --git a/src/lime_qt/util/util.cpp b/src/lime_qt/util/util.cpp index 575fcfc2b..cb14d376b 100644 --- a/src/lime_qt/util/util.cpp +++ b/src/lime_qt/util/util.cpp @@ -5,6 +5,7 @@ #include #include #include +#include "common/logging/log.h" #include "core/loader/smdh.h" #include "lime_qt/util/util.h" @@ -43,7 +44,7 @@ QPixmap CreateCirclePixmapFromColor(const QColor& color) { return circle_pixmap; } -QPixmap GetQPixmapFromSMDH(std::vector& smdh_data) { +QPixmap GetQPixmapFromSMDH(const std::vector& smdh_data) { Loader::SMDH smdh; std::memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH)); diff --git a/src/lime_qt/util/util.h b/src/lime_qt/util/util.h index c50640217..67bd51a90 100644 --- a/src/lime_qt/util/util.h +++ b/src/lime_qt/util/util.h @@ -7,6 +7,7 @@ #include #include #include +#include "common/common_types.h" /// Returns a QFont object appropriate to use as a monospace font for debugging widgets, etc. QFont GetMonospaceFont(); @@ -26,7 +27,7 @@ QPixmap CreateCirclePixmapFromColor(const QColor& color); * @param smdh_data SMDH data * @return QPixmap game icon */ -QPixmap GetQPixmapFromSMDH(std::vector& smdh_data); +QPixmap GetQPixmapFromSMDH(const std::vector& smdh_data); /** * Saves a windows icon to a file @@ -34,4 +35,4 @@ QPixmap GetQPixmapFromSMDH(std::vector& smdh_data); * @param image The image to save * @return bool If the operation succeeded */ -[[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image); \ No newline at end of file +[[nodiscard]] bool SaveIconToFile(const std::filesystem::path& icon_path, const QImage& image);