From a081818b0c03170e749ae1461c57e24dae75bc94 Mon Sep 17 00:00:00 2001 From: "zorro.zhang" Date: Thu, 26 Dec 2024 17:07:43 +0800 Subject: [PATCH] ENH: Ignore Not Exist Profile Json JIRA: none Change-Id: Ied94cdadf0097b819328284cbc773ffe3c47d32b --- src/slic3r/GUI/WebGuideDialog.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/slic3r/GUI/WebGuideDialog.cpp b/src/slic3r/GUI/WebGuideDialog.cpp index a8d81fa35..725569c18 100644 --- a/src/slic3r/GUI/WebGuideDialog.cpp +++ b/src/slic3r/GUI/WebGuideDialog.cpp @@ -1282,6 +1282,8 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath std::string s2 = OneModel["sub_path"]; boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred(); + if (!boost::filesystem::exists(sub_path)) continue; + std::string sub_file = sub_path.string(); boost::nowide::ifstream ifs(sub_file); @@ -1316,6 +1318,8 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath // wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2); boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred(); + if (!boost::filesystem::exists(sub_path)) continue; + std::string sub_file = sub_path.string(); boost::nowide::ifstream ifs(sub_file); json pm; @@ -1358,6 +1362,8 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath if (!m_ProfileJson["filament"].contains(s1)) { // wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2); boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred(); + if (!boost::filesystem::exists(sub_path)) continue; + std::string sub_file = sub_path.string(); boost::nowide::ifstream ifs(sub_file); json pm; @@ -1417,6 +1423,8 @@ int GuideFrame::LoadProfileFamily(std::string strVendor, std::string strFilePath std::string s2 = OneProcess["sub_path"]; // wxString ModelFilePath = wxString::Format("%s\\%s\\%s", strFolder, strVendor, s2); boost::filesystem::path sub_path = boost::filesystem::absolute(vendor_dir / s2).make_preferred(); + if (!boost::filesystem::exists(sub_path)) continue; + std::string sub_file = sub_path.string(); boost::nowide::ifstream ifs(sub_file); json pm;