summaryrefslogtreecommitdiff
path: root/src/yuzu
diff options
context:
space:
mode:
Diffstat (limited to 'src/yuzu')
-rw-r--r--src/yuzu/applets/software_keyboard.cpp18
-rw-r--r--src/yuzu/applets/web_browser.cpp19
-rw-r--r--src/yuzu/applets/web_browser.h11
-rw-r--r--src/yuzu/configuration/config.cpp36
-rw-r--r--src/yuzu/game_list.cpp106
-rw-r--r--src/yuzu/game_list.h5
-rw-r--r--src/yuzu/game_list_p.h26
-rw-r--r--src/yuzu/main.cpp10
-rw-r--r--src/yuzu/main.h2
-rw-r--r--src/yuzu/uisettings.h1
10 files changed, 185 insertions, 49 deletions
diff --git a/src/yuzu/applets/software_keyboard.cpp b/src/yuzu/applets/software_keyboard.cpp
index fd3368479..653486493 100644
--- a/src/yuzu/applets/software_keyboard.cpp
+++ b/src/yuzu/applets/software_keyboard.cpp
@@ -1027,10 +1027,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() {
ui->bottomOSK->setCurrentIndex(static_cast<int>(bottom_osk_index));
ui->button_shift_shift->setStyleSheet(
- QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_off.png);"
- "\nbackground-position: left top;"
- "\nbackground-repeat: no-repeat;"
- "\nbackground-origin: content;"));
+ QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);"
+ "\nimage-position: left;"));
ui->button_shift_shift->setIconSize(ui->button_shift->iconSize());
ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize());
@@ -1040,10 +1038,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() {
caps_lock_enabled = false;
ui->button_shift_shift->setStyleSheet(
- QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_off.png);"
- "\nbackground-position: left top;"
- "\nbackground-repeat: no-repeat;"
- "\nbackground-origin: content;"));
+ QStringLiteral("image: url(:/overlay/osk_button_shift_lock_off.png);"
+ "\nimage-position: left;"));
ui->button_shift_shift->setIconSize(ui->button_shift->iconSize());
ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize());
@@ -1056,10 +1052,8 @@ void QtSoftwareKeyboardDialog::ChangeBottomOSKIndex() {
caps_lock_enabled = true;
ui->button_shift_shift->setStyleSheet(
- QStringLiteral("background-image: url(:/overlay/osk_button_shift_lock_on.png);"
- "\nbackground-position: left top;"
- "\nbackground-repeat: no-repeat;"
- "\nbackground-origin: content;"));
+ QStringLiteral("image: url(:/overlay/osk_button_shift_lock_on.png);"
+ "\nimage-position: left;"));
ui->button_shift_shift->setIconSize(ui->button_shift->iconSize());
ui->button_backspace_shift->setIconSize(ui->button_backspace->iconSize());
diff --git a/src/yuzu/applets/web_browser.cpp b/src/yuzu/applets/web_browser.cpp
index e482ba029..93e3a4f6f 100644
--- a/src/yuzu/applets/web_browser.cpp
+++ b/src/yuzu/applets/web_browser.cpp
@@ -102,8 +102,8 @@ QtNXWebEngineView::~QtNXWebEngineView() {
StopInputThread();
}
-void QtNXWebEngineView::LoadLocalWebPage(std::string_view main_url,
- std::string_view additional_args) {
+void QtNXWebEngineView::LoadLocalWebPage(const std::string& main_url,
+ const std::string& additional_args) {
is_local = true;
LoadExtractedFonts();
@@ -113,12 +113,12 @@ void QtNXWebEngineView::LoadLocalWebPage(std::string_view main_url,
SetLastURL("http://localhost/");
StartInputThread();
- load(QUrl(QUrl::fromLocalFile(QString::fromStdString(std::string(main_url))).toString() +
- QString::fromStdString(std::string(additional_args))));
+ load(QUrl(QUrl::fromLocalFile(QString::fromStdString(main_url)).toString() +
+ QString::fromStdString(additional_args)));
}
-void QtNXWebEngineView::LoadExternalWebPage(std::string_view main_url,
- std::string_view additional_args) {
+void QtNXWebEngineView::LoadExternalWebPage(const std::string& main_url,
+ const std::string& additional_args) {
is_local = false;
SetUserAgent(UserAgent::WebApplet);
@@ -127,8 +127,7 @@ void QtNXWebEngineView::LoadExternalWebPage(std::string_view main_url,
SetLastURL("http://localhost/");
StartInputThread();
- load(QUrl(QString::fromStdString(std::string(main_url)) +
- QString::fromStdString(std::string(additional_args))));
+ load(QUrl(QString::fromStdString(main_url) + QString::fromStdString(additional_args)));
}
void QtNXWebEngineView::SetUserAgent(UserAgent user_agent) {
@@ -375,7 +374,7 @@ QtWebBrowser::QtWebBrowser(GMainWindow& main_window) {
QtWebBrowser::~QtWebBrowser() = default;
void QtWebBrowser::OpenLocalWebPage(
- std::string_view local_url, std::function<void()> extract_romfs_callback_,
+ const std::string& local_url, std::function<void()> extract_romfs_callback_,
std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback_) const {
extract_romfs_callback = std::move(extract_romfs_callback_);
callback = std::move(callback_);
@@ -390,7 +389,7 @@ void QtWebBrowser::OpenLocalWebPage(
}
void QtWebBrowser::OpenExternalWebPage(
- std::string_view external_url,
+ const std::string& external_url,
std::function<void(Service::AM::Applets::WebExitReason, std::string)> callback_) const {
callback = std::move(callback_);
diff --git a/src/yuzu/applets/web_browser.h b/src/yuzu/applets/web_browser.h
index 47f960d69..7ad07409f 100644
--- a/src/yuzu/applets/web_browser.h
+++ b/src/yuzu/applets/web_browser.h
@@ -58,7 +58,7 @@ public:
* @param main_url The url to the file.
* @param additional_args Additional arguments appended to the main url.
*/
- void LoadLocalWebPage(std::string_view main_url, std::string_view additional_args);
+ void LoadLocalWebPage(const std::string& main_url, const std::string& additional_args);
/**
* Loads an external website. Cannot be used to load local urls.
@@ -66,7 +66,7 @@ public:
* @param main_url The url to the website.
* @param additional_args Additional arguments appended to the main url.
*/
- void LoadExternalWebPage(std::string_view main_url, std::string_view additional_args);
+ void LoadExternalWebPage(const std::string& main_url, const std::string& additional_args);
/**
* Sets the background color of the web page.
@@ -193,16 +193,17 @@ public:
explicit QtWebBrowser(GMainWindow& parent);
~QtWebBrowser() override;
- void OpenLocalWebPage(std::string_view local_url, std::function<void()> extract_romfs_callback_,
+ void OpenLocalWebPage(const std::string& local_url,
+ std::function<void()> extract_romfs_callback_,
std::function<void(Service::AM::Applets::WebExitReason, std::string)>
callback_) const override;
- void OpenExternalWebPage(std::string_view external_url,
+ void OpenExternalWebPage(const std::string& external_url,
std::function<void(Service::AM::Applets::WebExitReason, std::string)>
callback_) const override;
signals:
- void MainWindowOpenWebPage(std::string_view main_url, std::string_view additional_args,
+ void MainWindowOpenWebPage(const std::string& main_url, const std::string& additional_args,
bool is_local) const;
private:
diff --git a/src/yuzu/configuration/config.cpp b/src/yuzu/configuration/config.cpp
index 851246233..e80a3df77 100644
--- a/src/yuzu/configuration/config.cpp
+++ b/src/yuzu/configuration/config.cpp
@@ -29,9 +29,10 @@ Config::~Config() {
}
const std::array<int, Settings::NativeButton::NumButtons> Config::default_buttons = {
- Qt::Key_A, Qt::Key_S, Qt::Key_Z, Qt::Key_X, Qt::Key_3, Qt::Key_4, Qt::Key_Q,
- Qt::Key_W, Qt::Key_1, Qt::Key_2, Qt::Key_N, Qt::Key_M, Qt::Key_F, Qt::Key_T,
- Qt::Key_H, Qt::Key_G, Qt::Key_D, Qt::Key_C, Qt::Key_B, Qt::Key_V,
+ Qt::Key_C, Qt::Key_X, Qt::Key_V, Qt::Key_Z, Qt::Key_F,
+ Qt::Key_G, Qt::Key_Q, Qt::Key_E, Qt::Key_R, Qt::Key_T,
+ Qt::Key_M, Qt::Key_N, Qt::Key_Left, Qt::Key_Up, Qt::Key_Right,
+ Qt::Key_Down, Qt::Key_Q, Qt::Key_E, 0, 0,
};
const std::array<int, Settings::NativeMotion::NumMotions> Config::default_motions = {
@@ -41,10 +42,10 @@ const std::array<int, Settings::NativeMotion::NumMotions> Config::default_motion
const std::array<std::array<int, 4>, Settings::NativeAnalog::NumAnalogs> Config::default_analogs{{
{
- Qt::Key_Up,
- Qt::Key_Down,
- Qt::Key_Left,
- Qt::Key_Right,
+ Qt::Key_W,
+ Qt::Key_S,
+ Qt::Key_A,
+ Qt::Key_D,
},
{
Qt::Key_I,
@@ -55,8 +56,8 @@ const std::array<std::array<int, 4>, Settings::NativeAnalog::NumAnalogs> Config:
}};
const std::array<int, 2> Config::default_stick_mod = {
- Qt::Key_E,
- Qt::Key_R,
+ Qt::Key_Shift,
+ 0,
};
const std::array<int, Settings::NativeMouseButton::NumMouseButtons> Config::default_mouse_buttons =
@@ -862,8 +863,7 @@ void Config::ReadSystemValues() {
Settings::values.rng_seed.SetGlobal(rng_seed_global);
if (global || !rng_seed_global) {
if (rng_seed_enabled) {
- Settings::values.rng_seed.SetValue(
- ReadSetting(QStringLiteral("rng_seed"), 0).toULongLong());
+ Settings::values.rng_seed.SetValue(ReadSetting(QStringLiteral("rng_seed"), 0).toUInt());
} else {
Settings::values.rng_seed.SetValue(std::nullopt);
}
@@ -936,6 +936,13 @@ void Config::ReadUIGamelistValues() {
UISettings::values.row_2_text_id = ReadSetting(QStringLiteral("row_2_text_id"), 2).toUInt();
UISettings::values.cache_game_list =
ReadSetting(QStringLiteral("cache_game_list"), true).toBool();
+ const int favorites_size = qt_config->beginReadArray(QStringLiteral("favorites"));
+ for (int i = 0; i < favorites_size; i++) {
+ qt_config->setArrayIndex(i);
+ UISettings::values.favorited_ids.append(
+ ReadSetting(QStringLiteral("program_id")).toULongLong());
+ }
+ qt_config->endArray();
qt_config->endGroup();
}
@@ -1479,6 +1486,13 @@ void Config::SaveUIGamelistValues() {
WriteSetting(QStringLiteral("row_1_text_id"), UISettings::values.row_1_text_id, 3);
WriteSetting(QStringLiteral("row_2_text_id"), UISettings::values.row_2_text_id, 2);
WriteSetting(QStringLiteral("cache_game_list"), UISettings::values.cache_game_list, true);
+ qt_config->beginWriteArray(QStringLiteral("favorites"));
+ for (int i = 0; i < UISettings::values.favorited_ids.size(); i++) {
+ qt_config->setArrayIndex(i);
+ WriteSetting(QStringLiteral("program_id"),
+ QVariant::fromValue(UISettings::values.favorited_ids[i]));
+ }
+ qt_config->endArray();
qt_config->endGroup();
}
diff --git a/src/yuzu/game_list.cpp b/src/yuzu/game_list.cpp
index 9afd5b45f..827bc10e7 100644
--- a/src/yuzu/game_list.cpp
+++ b/src/yuzu/game_list.cpp
@@ -11,6 +11,7 @@
#include <QJsonDocument>
#include <QJsonObject>
#include <QKeyEvent>
+#include <QList>
#include <QMenu>
#include <QThreadPool>
#include <fmt/format.h>
@@ -84,6 +85,10 @@ void GameListSearchField::setFilterResult(int visible, int total) {
label_filter_result->setText(tr("%1 of %n result(s)", "", total).arg(visible));
}
+QString GameListSearchField::filterText() const {
+ return edit_filter->text();
+}
+
QString GameList::GetLastFilterResultItem() const {
QString file_path;
const int folder_count = item_model->rowCount();
@@ -187,7 +192,9 @@ void GameList::OnTextChanged(const QString& new_text) {
// If the searchfield is empty every item is visible
// Otherwise the filter gets applied
if (edit_filter_text.isEmpty()) {
- for (int i = 0; i < folder_count; ++i) {
+ tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(),
+ UISettings::values.favorited_ids.size() == 0);
+ for (int i = 1; i < folder_count; ++i) {
folder = item_model->item(i, 0);
const QModelIndex folder_index = folder->index();
const int children_count = folder->rowCount();
@@ -198,8 +205,9 @@ void GameList::OnTextChanged(const QString& new_text) {
}
search_field->setFilterResult(children_total, children_total);
} else {
+ tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true);
int result_count = 0;
- for (int i = 0; i < folder_count; ++i) {
+ for (int i = 1; i < folder_count; ++i) {
folder = item_model->item(i, 0);
const QModelIndex folder_index = folder->index();
const int children_count = folder->rowCount();
@@ -228,9 +236,9 @@ void GameList::OnTextChanged(const QString& new_text) {
} else {
tree_view->setRowHidden(j, folder_index, true);
}
- search_field->setFilterResult(result_count, children_total);
}
}
+ search_field->setFilterResult(result_count, children_total);
}
}
@@ -280,6 +288,13 @@ void GameList::OnUpdateThemedIcons() {
.scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation),
Qt::DecorationRole);
break;
+ case GameListItemType::Favorites:
+ child->setData(
+ QIcon::fromTheme(QStringLiteral("star"))
+ .pixmap(icon_size)
+ .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation),
+ Qt::DecorationRole);
+ break;
default:
break;
}
@@ -427,6 +442,13 @@ void GameList::DonePopulating(const QStringList& watch_list) {
emit ShowList(!IsEmpty());
item_model->invisibleRootItem()->appendRow(new GameListAddDir());
+ item_model->invisibleRootItem()->insertRow(0, new GameListFavorites());
+ tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(),
+ UISettings::values.favorited_ids.size() == 0);
+ tree_view->expand(item_model->invisibleRootItem()->child(0)->index());
+ for (const auto id : UISettings::values.favorited_ids) {
+ AddFavorite(id);
+ }
// Clear out the old directories to watch for changes and add the new ones
auto watch_dirs = watcher->directories();
@@ -446,7 +468,7 @@ void GameList::DonePopulating(const QStringList& watch_list) {
tree_view->setEnabled(true);
const int folder_count = tree_view->model()->rowCount();
int children_total = 0;
- for (int i = 0; i < folder_count; ++i) {
+ for (int i = 1; i < folder_count; ++i) {
children_total += item_model->item(i, 0)->rowCount();
}
search_field->setFilterResult(children_total, children_total);
@@ -478,6 +500,9 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
case GameListItemType::SysNandDir:
AddPermDirPopup(context_menu, selected);
break;
+ case GameListItemType::Favorites:
+ AddFavoritesPopup(context_menu);
+ break;
default:
break;
}
@@ -485,6 +510,8 @@ void GameList::PopupContextMenu(const QPoint& menu_location) {
}
void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path) {
+ QAction* favorite = context_menu.addAction(tr("Favorite"));
+ context_menu.addSeparator();
QAction* open_save_location = context_menu.addAction(tr("Open Save Data Location"));
QAction* open_mod_location = context_menu.addAction(tr("Open Mod Data Location"));
QAction* open_transferable_shader_cache =
@@ -503,6 +530,9 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
context_menu.addSeparator();
QAction* properties = context_menu.addAction(tr("Properties"));
+ favorite->setVisible(program_id != 0);
+ favorite->setCheckable(true);
+ favorite->setChecked(UISettings::values.favorited_ids.contains(program_id));
open_save_location->setVisible(program_id != 0);
open_mod_location->setVisible(program_id != 0);
open_transferable_shader_cache->setVisible(program_id != 0);
@@ -513,6 +543,7 @@ void GameList::AddGamePopup(QMenu& context_menu, u64 program_id, const std::stri
auto it = FindMatchingCompatibilityEntry(compatibility_list, program_id);
navigate_to_gamedb_entry->setVisible(it != compatibility_list.end() && program_id != 0);
+ connect(favorite, &QAction::triggered, [this, program_id]() { ToggleFavorite(program_id); });
connect(open_save_location, &QAction::triggered, [this, program_id, path]() {
emit OpenFolderRequested(program_id, GameListOpenTarget::SaveData, path);
});
@@ -564,6 +595,7 @@ void GameList::AddCustomDirPopup(QMenu& context_menu, QModelIndex selected) {
connect(delete_dir, &QAction::triggered, [this, &game_dir, selected] {
UISettings::values.game_dirs.removeOne(game_dir);
item_model->invisibleRootItem()->removeRow(selected.row());
+ OnTextChanged(search_field->filterText());
});
}
@@ -576,7 +608,7 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) {
const int row = selected.row();
- move_up->setEnabled(row > 0);
+ move_up->setEnabled(row > 1);
move_down->setEnabled(row < item_model->rowCount() - 2);
connect(move_up, &QAction::triggered, [this, selected, row, game_dir_index] {
@@ -614,6 +646,18 @@ void GameList::AddPermDirPopup(QMenu& context_menu, QModelIndex selected) {
});
}
+void GameList::AddFavoritesPopup(QMenu& context_menu) {
+ QAction* clear_all = context_menu.addAction(tr("Clear"));
+
+ connect(clear_all, &QAction::triggered, [this] {
+ for (const auto id : UISettings::values.favorited_ids) {
+ RemoveFavorite(id);
+ }
+ UISettings::values.favorited_ids.clear();
+ tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true);
+ });
+}
+
void GameList::LoadCompatibilityList() {
QFile compat_list{QStringLiteral(":compatibility_list/compatibility_list.json")};
@@ -728,6 +772,58 @@ void GameList::RefreshGameDirectory() {
}
}
+void GameList::ToggleFavorite(u64 program_id) {
+ if (!UISettings::values.favorited_ids.contains(program_id)) {
+ tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(),
+ !search_field->filterText().isEmpty());
+ UISettings::values.favorited_ids.append(program_id);
+ AddFavorite(program_id);
+ item_model->sort(tree_view->header()->sortIndicatorSection(),
+ tree_view->header()->sortIndicatorOrder());
+ } else {
+ UISettings::values.favorited_ids.removeOne(program_id);
+ RemoveFavorite(program_id);
+ if (UISettings::values.favorited_ids.size() == 0) {
+ tree_view->setRowHidden(0, item_model->invisibleRootItem()->index(), true);
+ }
+ }
+}
+
+void GameList::AddFavorite(u64 program_id) {
+ auto* favorites_row = item_model->item(0);
+
+ for (int i = 1; i < item_model->rowCount() - 1; i++) {
+ const auto* folder = item_model->item(i);
+ for (int j = 0; j < folder->rowCount(); j++) {
+ if (folder->child(j)->data(GameListItemPath::ProgramIdRole).toULongLong() ==
+ program_id) {
+ QList<QStandardItem*> list;
+ for (int k = 0; k < item_model->columnCount(); k++) {
+ list.append(folder->child(j, k)->clone());
+ }
+ list[0]->setData(folder->child(j)->data(GameListItem::SortRole),
+ GameListItem::SortRole);
+ list[0]->setText(folder->child(j)->data(Qt::DisplayRole).toString());
+
+ favorites_row->appendRow(list);
+ return;
+ }
+ }
+ }
+}
+
+void GameList::RemoveFavorite(u64 program_id) {
+ auto* favorites_row = item_model->item(0);
+
+ for (int i = 0; i < favorites_row->rowCount(); i++) {
+ const auto* game = favorites_row->child(i);
+ if (game->data(GameListItemPath::ProgramIdRole).toULongLong() == program_id) {
+ favorites_row->removeRow(i);
+ return;
+ }
+ }
+}
+
GameListPlaceholder::GameListPlaceholder(GMainWindow* parent) : QWidget{parent} {
connect(parent, &GMainWindow::UpdateThemedIcons, this,
&GameListPlaceholder::onUpdateThemedIcons);
diff --git a/src/yuzu/game_list.h b/src/yuzu/game_list.h
index 58059a3c4..9c0a1a482 100644
--- a/src/yuzu/game_list.h
+++ b/src/yuzu/game_list.h
@@ -112,10 +112,15 @@ private:
void RefreshGameDirectory();
+ void ToggleFavorite(u64 program_id);
+ void AddFavorite(u64 program_id);
+ void RemoveFavorite(u64 program_id);
+
void PopupContextMenu(const QPoint& menu_location);
void AddGamePopup(QMenu& context_menu, u64 program_id, const std::string& path);
void AddCustomDirPopup(QMenu& context_menu, QModelIndex selected);
void AddPermDirPopup(QMenu& context_menu, QModelIndex selected);
+ void AddFavoritesPopup(QMenu& context_menu);
std::shared_ptr<FileSys::VfsFilesystem> vfs;
FileSys::ManualContentProvider* provider;
diff --git a/src/yuzu/game_list_p.h b/src/yuzu/game_list_p.h
index f25445f18..978d27325 100644
--- a/src/yuzu/game_list_p.h
+++ b/src/yuzu/game_list_p.h
@@ -29,7 +29,8 @@ enum class GameListItemType {
SdmcDir = QStandardItem::UserType + 3,
UserNandDir = QStandardItem::UserType + 4,
SysNandDir = QStandardItem::UserType + 5,
- AddDir = QStandardItem::UserType + 6
+ AddDir = QStandardItem::UserType + 6,
+ Favorites = QStandardItem::UserType + 7,
};
Q_DECLARE_METATYPE(GameListItemType);
@@ -310,6 +311,28 @@ public:
}
};
+class GameListFavorites : public GameListItem {
+public:
+ explicit GameListFavorites() {
+ setData(type(), TypeRole);
+
+ const int icon_size = std::min(static_cast<int>(UISettings::values.icon_size), 64);
+ setData(QIcon::fromTheme(QStringLiteral("star"))
+ .pixmap(icon_size)
+ .scaled(icon_size, icon_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation),
+ Qt::DecorationRole);
+ setData(QObject::tr("Favorites"), Qt::DisplayRole);
+ }
+
+ int type() const override {
+ return static_cast<int>(GameListItemType::Favorites);
+ }
+
+ bool operator<(const QStandardItem& other) const override {
+ return false;
+ }
+};
+
class GameList;
class QHBoxLayout;
class QTreeView;
@@ -323,6 +346,7 @@ class GameListSearchField : public QWidget {
public:
explicit GameListSearchField(GameList* parent = nullptr);
+ QString filterText() const;
void setFilterResult(int visible, int total);
void clear();
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 5f6cdc0c6..00d4cfe67 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -349,7 +349,7 @@ GMainWindow::GMainWindow()
continue;
}
- Settings::values.current_user = selected_user;
+ Settings::values.current_user = static_cast<s32>(selected_user);
continue;
}
@@ -574,8 +574,8 @@ void GMainWindow::SoftwareKeyboardExit() {
software_keyboard = nullptr;
}
-void GMainWindow::WebBrowserOpenWebPage(std::string_view main_url, std::string_view additional_args,
- bool is_local) {
+void GMainWindow::WebBrowserOpenWebPage(const std::string& main_url,
+ const std::string& additional_args, bool is_local) {
#ifdef YUZU_USE_QT_WEB_ENGINE
if (disable_web_applet) {
@@ -596,13 +596,15 @@ void GMainWindow::WebBrowserOpenWebPage(std::string_view main_url, std::string_v
loading_progress.setRange(0, 3);
loading_progress.setValue(0);
- if (is_local && !Common::FS::Exists(std::string(main_url))) {
+ if (is_local && !Common::FS::Exists(main_url)) {
loading_progress.show();
auto future = QtConcurrent::run([this] { emit WebBrowserExtractOfflineRomFS(); });
while (!future.isFinished()) {
QCoreApplication::processEvents();
+
+ std::this_thread::sleep_for(std::chrono::milliseconds(1));
}
}
diff --git a/src/yuzu/main.h b/src/yuzu/main.h
index 7f1e50a5b..98a608fce 100644
--- a/src/yuzu/main.h
+++ b/src/yuzu/main.h
@@ -159,7 +159,7 @@ public slots:
void SoftwareKeyboardExit();
void ErrorDisplayDisplayError(QString error_code, QString error_text);
void ProfileSelectorSelectProfile();
- void WebBrowserOpenWebPage(std::string_view main_url, std::string_view additional_args,
+ void WebBrowserOpenWebPage(const std::string& main_url, const std::string& additional_args,
bool is_local);
void OnAppFocusStateChanged(Qt::ApplicationState state);
diff --git a/src/yuzu/uisettings.h b/src/yuzu/uisettings.h
index ce3945485..5ba00b8c8 100644
--- a/src/yuzu/uisettings.h
+++ b/src/yuzu/uisettings.h
@@ -74,6 +74,7 @@ struct Values {
QString game_dir_deprecated;
bool game_dir_deprecated_deepscan;
QVector<UISettings::GameDir> game_dirs;
+ QVector<u64> favorited_ids;
QStringList recent_files;
QString language;