From 80c48919266d108a551f7b34f797f5e47cf20496 Mon Sep 17 00:00:00 2001 From: "chunmao.guo" Date: Wed, 8 Jan 2025 15:06:46 +0800 Subject: [PATCH] FIX: support maximum 999 recent projects Change-Id: I2465990583a1295f40e3c4c6ef9237657e38a91c Jira: STUDIO-9107 (cherry picked from commit d29fa512acd0c21255fbf8d6f5f0488214677e83) --- src/libslic3r/AppConfig.cpp | 3 ++- src/slic3r/GUI/MainFrame.cpp | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libslic3r/AppConfig.cpp b/src/libslic3r/AppConfig.cpp index 6032d8b0cc..c48075f4c1 100644 --- a/src/libslic3r/AppConfig.cpp +++ b/src/libslic3r/AppConfig.cpp @@ -1188,7 +1188,8 @@ void AppConfig::set_recent_projects(const std::vector& recent_proje for (unsigned int i = 0; i < (unsigned int)recent_projects.size(); ++i) { auto n = std::to_string(i + 1); - if (n.length() == 1) n = "0" + n; + if (n.length() == 1) n = "00" + n; + else if (n.length() == 2) n = "0" + n; it->second[n] = recent_projects[i]; } } diff --git a/src/slic3r/GUI/MainFrame.cpp b/src/slic3r/GUI/MainFrame.cpp index 566c95962c..e4a840dd80 100644 --- a/src/slic3r/GUI/MainFrame.cpp +++ b/src/slic3r/GUI/MainFrame.cpp @@ -3194,7 +3194,7 @@ void MainFrame::init_menubar_as_editor() void MainFrame::set_max_recent_count(int max) { - max = max < 0 ? 0 : max > 10000 ? 10000 : max; + max = max < 0 ? 0 : max > 999 ? 999 : max; size_t count = m_recent_projects.GetCount(); m_recent_projects.SetMaxFiles(max); if (count != m_recent_projects.GetCount()) {