summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/yuzu/main.cpp14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index e28679cd1..d0415a7dc 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -654,9 +654,8 @@ void GMainWindow::OnMenuRecentFile() {
654 QAction* action = qobject_cast<QAction*>(sender()); 654 QAction* action = qobject_cast<QAction*>(sender());
655 assert(action); 655 assert(action);
656 656
657 QString filename = action->data().toString(); 657 const QString filename = action->data().toString();
658 QFileInfo file_info(filename); 658 if (QFileInfo::exists(filename)) {
659 if (file_info.exists()) {
660 BootGame(filename); 659 BootGame(filename);
661 } else { 660 } else {
662 // Display an error message and remove the file from the list. 661 // Display an error message and remove the file from the list.
@@ -947,15 +946,14 @@ void GMainWindow::UpdateUITheme() {
947 QStringList theme_paths(default_theme_paths); 946 QStringList theme_paths(default_theme_paths);
948 if (UISettings::values.theme != UISettings::themes[0].second && 947 if (UISettings::values.theme != UISettings::themes[0].second &&
949 !UISettings::values.theme.isEmpty()) { 948 !UISettings::values.theme.isEmpty()) {
950 QString theme_uri(":" + UISettings::values.theme + "/style.qss"); 949 const QString theme_uri(":" + UISettings::values.theme + "/style.qss");
951 QFile f(theme_uri); 950 QFile f(theme_uri);
952 if (!f.exists()) { 951 if (f.open(QFile::ReadOnly | QFile::Text)) {
953 LOG_ERROR(Frontend, "Unable to set style, stylesheet file not found");
954 } else {
955 f.open(QFile::ReadOnly | QFile::Text);
956 QTextStream ts(&f); 952 QTextStream ts(&f);
957 qApp->setStyleSheet(ts.readAll()); 953 qApp->setStyleSheet(ts.readAll());
958 GMainWindow::setStyleSheet(ts.readAll()); 954 GMainWindow::setStyleSheet(ts.readAll());
955 } else {
956 LOG_ERROR(Frontend, "Unable to set style, stylesheet file not found");
959 } 957 }
960 theme_paths.append(QStringList{":/icons/default", ":/icons/" + UISettings::values.theme}); 958 theme_paths.append(QStringList{":/icons/default", ":/icons/" + UISettings::values.theme});
961 QIcon::setThemeName(":/icons/" + UISettings::values.theme); 959 QIcon::setThemeName(":/icons/" + UISettings::values.theme);