mirror of
https://github.com/OrcaSlicer/OrcaSlicer.git
synced 2026-09-28 03:11:47 +00:00
fix: installed vendor profiles only update when OTA is enabled (#15831)
* preset updater: refresh installed vendors from resources regardless of enable_ota Sincec4fea8ad24the resources check in check_installed_vendor_profiles() sat behind enabled_config_update, which now follows enable_ota, a hidden flag that defaults to off. The hotfixa93c6ea67bthen made that gate skip installed vendors entirely, so a new build's newer vendor profiles were never installed over an existing vendor unless OTA had been turned on. Before the gating the update URL always had a default, so the comparison effectively always ran. The resources shipped with a build are not an over-the-air update. Judge installed vendors against them, and drop the ones no longer enabled, regardless of the flag; enable_ota keeps gating the online sync. * preset updater: stop reinstalling the filament library on every launch check_installed_vendor_profiles() put OrcaFilamentLibrary on the install list unconditionally, so every launch recopied the whole vendor from resources and, in a build that ships the profile JSONs rather than a preset cache, then re-parsed and re-cached it: about 0.3 s of a dev build's startup, and a 3 MB copy in a release build, for a vendor that had not changed. The library was special-cased because it is never in the enabled-vendor list. Treat it like the default bundle instead: always wanted, and reinstalled only when the resources carry a newer version.
This commit is contained in:
@@ -1098,17 +1098,15 @@ void PresetUpdater::priv::check_installed_vendor_profiles() const
|
|||||||
const auto enabled_vendors = app_config->vendors();
|
const auto enabled_vendors = app_config->vendors();
|
||||||
|
|
||||||
std::set<std::string> bundles;
|
std::set<std::string> bundles;
|
||||||
// Orca: always install filament library
|
|
||||||
bundles.insert(PresetBundle::ORCA_FILAMENT_LIBRARY);
|
|
||||||
// A vendor is named by its profile or, where the build ships preset caches
|
// A vendor is named by its profile or, where the build ships preset caches
|
||||||
// instead of the raw profile JSONs, by its cache alone.
|
// instead of the raw profile JSONs, by its cache alone.
|
||||||
for (const std::string &vendor_name : vendor_names_in(rsrc_path)) {
|
for (const std::string &vendor_name : vendor_names_in(rsrc_path)) {
|
||||||
if (bundles.find(vendor_name) != bundles.end())continue;
|
// enabled_vendors lists the vendors whose printer models the user picked, and
|
||||||
|
// neither of these two is ever in it.
|
||||||
const auto is_vendor_enabled = (vendor_name == PresetBundle::ORCA_DEFAULT_BUNDLE) // always update configs from resource to vendor for ORCA_DEFAULT_BUNDLE
|
const auto is_vendor_enabled = (vendor_name == PresetBundle::ORCA_DEFAULT_BUNDLE)
|
||||||
|
|| (vendor_name == PresetBundle::ORCA_FILAMENT_LIBRARY)
|
||||||
|| (enabled_vendors.find(vendor_name) != enabled_vendors.end());
|
|| (enabled_vendors.find(vendor_name) != enabled_vendors.end());
|
||||||
if (is_vendor_installed(vendor_name)) {
|
if (is_vendor_installed(vendor_name)) {
|
||||||
if (enabled_config_update) {
|
|
||||||
if (is_vendor_enabled) {
|
if (is_vendor_enabled) {
|
||||||
// Orca: whichever form of the vendor resources ships at the newer
|
// Orca: whichever form of the vendor resources ships at the newer
|
||||||
// version is the one installing lays down, and the one to judge
|
// version is the one installing lays down, and the one to judge
|
||||||
@@ -1127,7 +1125,6 @@ void PresetUpdater::priv::check_installed_vendor_profiles() const
|
|||||||
// need to be removed because not installed
|
// need to be removed because not installed
|
||||||
remove_installed_vendor(vendor_name);
|
remove_installed_vendor(vendor_name);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else if (is_vendor_enabled) {
|
} else if (is_vendor_enabled) {
|
||||||
bundles.insert(vendor_name);
|
bundles.insert(vendor_name);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user