From 80b88c542a4e7d2a82a99eb18054a21e58e7716d Mon Sep 17 00:00:00 2001 From: David Kocik Date: Mon, 22 May 2023 11:10:36 +0200 Subject: [PATCH] Enable loading profiles in config wizard from vendor folder. This is for 3rd party profiles that are not downloaded from our servers. #10606 --- src/slic3r/GUI/ConfigWizard.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/ConfigWizard.cpp b/src/slic3r/GUI/ConfigWizard.cpp index 60e7b00cc..265d256dc 100644 --- a/src/slic3r/GUI/ConfigWizard.cpp +++ b/src/slic3r/GUI/ConfigWizard.cpp @@ -153,15 +153,22 @@ BundleMap BundleMap::load() if (res.find(id) != res.end()) { continue; } // Fresh index should be in archive_dir, otherwise look for it in cache + // Then if not in archive or cache - it could be 3rd party profile that user just copied to vendor folder (both ini and cache) + fs::path idx_path (archive_dir / (id + ".idx")); if (!boost::filesystem::exists(idx_path)) { - BOOST_LOG_TRIVIAL(warning) << format("Missing index %1% when loading bundle %2%.", idx_path.string(), id); + BOOST_LOG_TRIVIAL(error) << format("Missing index %1% when loading bundle %2%. Going to search for it in cache folder.", idx_path.string(), id); idx_path = fs::path(cache_dir / (id + ".idx")); } + if (!boost::filesystem::exists(idx_path)) { + BOOST_LOG_TRIVIAL(error) << format("Missing index %1% when loading bundle %2%. Going to search for it in vendor folder. Is it a 3rd party profile?", idx_path.string(), id); + idx_path = fs::path(vendor_dir / (id + ".idx")); + } if (!boost::filesystem::exists(idx_path)) { BOOST_LOG_TRIVIAL(error) << format("Could not load bundle %1% due to missing index %2%.", id, idx_path.string()); continue; } + Slic3r::GUI::Config::Index index; try { index.load(idx_path);