diff options
Diffstat (limited to 'ui/qt/main_welcome.cpp')
-rw-r--r-- | ui/qt/main_welcome.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/ui/qt/main_welcome.cpp b/ui/qt/main_welcome.cpp index b5cb3dc878..61623def82 100644 --- a/ui/qt/main_welcome.cpp +++ b/ui/qt/main_welcome.cpp @@ -384,8 +384,10 @@ void MainWelcome::updateRecentFiles() { rfRow++; } - while ((unsigned)recent_files_->count() > prefs.gui_recent_files_count_max) { - recent_files_->takeItem(recent_files_->count()); + int row = recent_files_->count(); + while (row > 0 && row > (int) prefs.gui_recent_files_count_max) { + row--; + recent_files_->takeItem(row); } if (recent_files_->count() > 0) { welcome_ui_->openFrame->animatedShow(); |