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 STATES_DIR "states"
#define ICONS_DIR "icons"
#define PLAY_TIME_DIR "play_time"
// Filenames
// Files in the directory returned by GetUserPath(UserPath::LogDir)

View File

@ -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;
}

View File

@ -10,6 +10,7 @@
#include <ios>
#include <limits>
#include <optional>
#include <span>
#include <string>
#include <string_view>
#include <type_traits>
@ -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);

View File

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

View File

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

View File

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

View File

@ -15,6 +15,7 @@
#include <QtGui>
#include <QtWidgets>
#include <fmt/format.h>
#include <fmt/ostream.h>
#ifdef __APPLE__
#include <unistd.h> // 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())) {

View File

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

View File

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

View File

@ -5,6 +5,7 @@
#include <array>
#include <cmath>
#include <QPainter>
#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<u8>& smdh_data) {
QPixmap GetQPixmapFromSMDH(const std::vector<u8>& smdh_data) {
Loader::SMDH smdh;
std::memcpy(&smdh, smdh_data.data(), sizeof(Loader::SMDH));

View File

@ -7,6 +7,7 @@
#include <filesystem>
#include <QFont>
#include <QString>
#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<u8>& smdh_data);
QPixmap GetQPixmapFromSMDH(const std::vector<u8>& smdh_data);
/**
* Saves a windows icon to a file