Code cleanup and renamed published_* flags to orca_published_* flags to be less generic

This commit is contained in:
Lam Wei Lun
2026-08-25 17:37:04 +08:00
parent 51b646efcf
commit e1a79c4112
5 changed files with 63 additions and 55 deletions
+1 -1
View File
@@ -1224,7 +1224,7 @@ void PlateData::parse_filament_info(GCodeProcessorResult *result)
// Reads the parse-time metadata: the model XML carries it before its resources, while
// m_model->model_info is only filled in after the whole XML has been parsed.
bool _is_published_3mf() const {
return this->model_info.metadata_items.find("published") != this->model_info.metadata_items.end();
return this->model_info.metadata_items.find(ORCA_PUBLISHED_TAG) != this->model_info.metadata_items.end();
}
bool _is_svg_shape_file(const std::string &filename) const;
+9
View File
@@ -154,6 +154,15 @@ enum class SaveStrategy
Backup = 0x10000 | WithGcode | Silence | SkipStatic | SplitModel,
};
// Model metadata keys of a "published" 3MF (see MinimalPublished): the flag marks a minimal,
// tag-less publish export, the others carry the author-selected settings payload. Namespaced
// with the "orca_published" prefix because metadata_items round-trips verbatim through other
// slicers, where a bare "published" key could collide.
inline constexpr const char *ORCA_PUBLISHED_TAG = "orca_published";
inline constexpr const char *ORCA_PUBLISHED_KEYS_TAG = "orca_published_keys";
inline constexpr const char *ORCA_PUBLISHED_MATERIAL_TAG = "orca_published_material_keys";
inline constexpr const char *ORCA_PUBLISHED_CONFIG_TAG = "orca_published_config";
inline SaveStrategy operator | (SaveStrategy lhs, SaveStrategy rhs)
{
using T = std::underlying_type_t <SaveStrategy>;