Răsfoiți Sursa

qt/main: Collapse if statement in UpdateRecentFiles()

Given the function accepts a boolean, we don't need to use an if
statement here and repeat ourselves.
Lioncash 8 ani în urmă
părinte
comite
cf983888cc
1 a modificat fișierele cu 2 adăugiri și 6 ștergeri
  1. 2 6
      src/yuzu/main.cpp

+ 2 - 6
src/yuzu/main.cpp

@@ -595,12 +595,8 @@ void GMainWindow::UpdateRecentFiles() {
         actions_recent_files[j]->setVisible(false);
     }
 
-    // Grey out the recent files menu if the list is empty
-    if (num_recent_files == 0) {
-        ui.menu_recent_files->setEnabled(false);
-    } else {
-        ui.menu_recent_files->setEnabled(true);
-    }
+    // Enable the recent files menu if the list isn't empty
+    ui.menu_recent_files->setEnabled(num_recent_files != 0);
 }
 
 void GMainWindow::OnGameListLoadFile(QString game_path) {