lime_qt: Fix remaining build errors

Co-Authored-By: FearlessTobi <thm.frey@gmail.com>
This commit is contained in:
Reg Tiangha 2024-05-01 11:08:03 -06:00 committed by OpenSauce
parent b4662a822b
commit f2a8ab5547
15 changed files with 27 additions and 16 deletions

View File

@ -53,7 +53,6 @@
#define SHADER_DIR "shaders" #define SHADER_DIR "shaders"
#define STATES_DIR "states" #define STATES_DIR "states"
#define ICONS_DIR "icons" #define ICONS_DIR "icons"
#define PLAY_TIME_DIR "play_time"
// Filenames // Filenames
// Files in the directory returned by GetUserPath(UserPath::LogDir) // Files in the directory returned by GetUserPath(UserPath::LogDir)

View File

@ -729,7 +729,7 @@ static const std::string& GetHomeDirectory() {
* @return The directory path * @return The directory path
* @sa http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html * @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()); const char* directory = getenv(envvar.c_str());
std::string user_dir; 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::LoadDir, user_path + LOAD_DIR DIR_SEP);
g_paths.emplace(UserPath::StatesDir, user_path + STATES_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::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; g_default_paths = g_paths;
} }

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>
@ -202,6 +203,8 @@ void UpdateUserPath(UserPath path, const std::string& filename);
#ifdef _WIN32 #ifdef _WIN32
[[nodiscard]] const std::string& GetExeDirectory(); [[nodiscard]] const std::string& GetExeDirectory();
[[nodiscard]] std::string AppDataRoamingDirectory(); [[nodiscard]] std::string AppDataRoamingDirectory();
#else
[[nodiscard]] const std::string GetUserDirectory(const std::string& envvar);
#endif #endif
std::size_t WriteStringToFile(bool text_file, const std::string& filename, std::string_view str); std::size_t WriteStringToFile(bool text_file, const std::string& filename, std::string_view str);

View File

@ -25,7 +25,7 @@ namespace Core {
class ARM_Interface : NonCopyable { class ARM_Interface : NonCopyable {
public: public:
explicit ARM_Interface(u32 id, std::shared_ptr<Core::Timing::Timer> timer) explicit ARM_Interface(u32 id, std::shared_ptr<Core::Timing::Timer> timer)
: timer(timer), id(id){}; : timer(timer), id(id) {};
virtual ~ARM_Interface() {} virtual ~ARM_Interface() {}
struct ThreadContext { struct ThreadContext {

View File

@ -251,7 +251,7 @@ public:
explicit Timing(std::size_t num_cores, u32 cpu_clock_percentage, s64 override_base_ticks = -1); 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. * Returns the event_type identifier. if name is not unique, it will assert.

View File

@ -281,7 +281,7 @@ void Module::Interface::GetLastResponseResult(Kernel::HLERequestContext& ctx) {
rb.Push(ResultSuccess); rb.Push(ResultSuccess);
} }
Module::Module(Core::System& system) : system(system){}; Module::Module(Core::System& system) : system(system) {};
Module::~Module() = default; Module::~Module() = default;
void InstallInterfaces(Core::System& system) { void InstallInterfaces(Core::System& system) {

View File

@ -183,7 +183,7 @@ public:
}; };
struct RequestHeader { 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 name;
std::string value; std::string value;
@ -213,10 +213,10 @@ public:
struct Param { struct Param {
Param(const std::vector<u8>& value) Param(const std::vector<u8>& value)
: name(value.begin(), value.end()), value(value.begin(), value.end()){}; : 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::string& value) : name(name), value(value) {};
Param(const std::string& name, const std::vector<u8>& value) Param(const std::string& name, const std::vector<u8>& 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 name;
std::string value; std::string value;
bool is_binary = false; bool is_binary = false;

View File

@ -5,6 +5,7 @@
#pragma once #pragma once
#include <QWidget> #include <QWidget>
#include "common/common_types.h"
#include "common/microprofile.h" #include "common/microprofile.h"
class MicroProfileDialog : public QWidget { class MicroProfileDialog : public QWidget {

View File

@ -6,6 +6,7 @@
#include <memory> #include <memory>
#include <QDockWidget> #include <QDockWidget>
#include "common/common_types.h"
class QTreeWidget; class QTreeWidget;
class QTreeWidgetItem; class QTreeWidgetItem;

View File

@ -14,7 +14,6 @@
#include <QStyleOption> #include <QStyleOption>
#include <QTime> #include <QTime>
#include <fmt/format.h> #include <fmt/format.h>
#include "citra_qt/util/util.h"
#include "common/logging/log.h" #include "common/logging/log.h"
#include "core/loader/loader.h" #include "core/loader/loader.h"
#include "core/loader/smdh.h" #include "core/loader/smdh.h"

View File

@ -15,6 +15,7 @@
#include <QtGui> #include <QtGui>
#include <QtWidgets> #include <QtWidgets>
#include <fmt/format.h> #include <fmt/format.h>
#include <fmt/ostream.h>
#ifdef __APPLE__ #ifdef __APPLE__
#include <unistd.h> // for chdir #include <unistd.h> // for chdir
#endif #endif
@ -82,6 +83,7 @@
#include "common/x64/cpu_detect.h" #include "common/x64/cpu_detect.h"
#endif #endif
#include "common/settings.h" #include "common/settings.h"
#include "common/string_util.h"
#include "core/core.h" #include "core/core.h"
#include "core/dumping/backend.h" #include "core/dumping/backend.h"
#include "core/file_sys/archive_extsavedata.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); out_icon_path = FileUtil::GetUserPath(FileUtil::UserPath::IconsDir);
ico_extension = "ico"; ico_extension = "ico";
#elif defined(__linux__) || defined(__FreeBSD__) #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 #endif
// Create icons directory if it doesn't exist // Create icons directory if it doesn't exist
if (!FileUtil::CreateDir(out_icon_path.string())) { if (!FileUtil::CreateDir(out_icon_path.string())) {

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

@ -148,6 +148,8 @@ struct Values {
// logging // logging
Settings::Setting<bool> show_console{false, "showConsole"}; Settings::Setting<bool> show_console{false, "showConsole"};
bool shortcut_already_warned = false;
}; };
extern Values values; extern Values values;

View File

@ -5,6 +5,7 @@
#include <array> #include <array>
#include <cmath> #include <cmath>
#include <QPainter> #include <QPainter>
#include "common/logging/log.h"
#include "core/loader/smdh.h" #include "core/loader/smdh.h"
#include "lime_qt/util/util.h" #include "lime_qt/util/util.h"
@ -43,7 +44,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));

View File

@ -7,6 +7,7 @@
#include <filesystem> #include <filesystem>
#include <QFont> #include <QFont>
#include <QString> #include <QString>
#include "common/common_types.h"
/// Returns a QFont object appropriate to use as a monospace font for debugging widgets, etc. /// Returns a QFont object appropriate to use as a monospace font for debugging widgets, etc.
QFont GetMonospaceFont(); QFont GetMonospaceFont();
@ -26,7 +27,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