Files
Leonardo Zide 688e2f70f1 Preserve in-place editing state during geometry exports
Collecting completed geometry called Project::SetActiveModel() afterward,
which restored only the tab model. An in-place editing target was left
inactive with final-step geometry despite retaining its earlier current step.

Snapshot each model's active flag in a scoped guard and restore models
individually after collecting geometry. The main model remains the export
source, and all exit paths restore the edited models' current-step poses.

Also simplify the common AGENTS.md translation guidance to require
translatable UI strings without mandating catalog refreshes.

Validated the Qt 6 application build and 30 focused export checks covering
OBJ, COLLADA, 3DS, and POV-Ray success, cancellation, and write errors,
plus completed main-model geometry and nested editing state restoration.
2026-10-24 12:48:03 -07:00

2.0 KiB

Code instructions

  • Keep the file lists in leocad.pro alphabetically sorted within their existing groups.
  • Get Qt and std includes through the precompiled header, lc_global.h.
  • Prefer std containers, use Qt containers where a Qt API boundary makes them useful.
  • Prefer lcstrcpy() and lcstrcat() from lc_string.h for bounded C-string copies and concatenation. Use the array overloads when possible; avoid strncpy() plus manual null termination. Keep standard functions where no suitable lc helper exists.
  • Avoid using auto for ordinary variable types. Template iterators, lambdas, and structured bindings may use it for readability.
  • Do not nest ternary expressions. Use explicit branches when a choice needs another condition.
  • Prefer a private static member function over a file-scope helper when the function belongs to a class and does not use instance state.
  • Prefer explicit lock() and unlock() over an extra scope with QMutexLocker for short, straight-line critical sections that must end before the following code. Keep QMutexLocker for early returns, waits, or nontrivial control flow.
  • Preserve existing blank lines when editing code. Prefer blank lines between declarations and following logic, and between distinct logical steps; do not remove user-added blank lines without a specific reason.
  • When adding a parameter to an existing function, update every call site explicitly instead of adding a default argument to preserve old calls.

Commit Messages

  • Every nontrivial commit must have a concise subject and a descriptive body.
  • Explain the problem or trigger, why the change is needed, and how the resulting behavior addresses it.
  • Write for a future maintainer without access to the chat. Do not merely restate the diff or include conversational history.
  • Subject-only messages are acceptable for purely mechanical changes.

Dialog help and translations

  • Follow docs/dialog-help.md when adding or changing dialog controls, including help text, label buddies, and Help/F1 behavior.
  • Keep UI strings translatable.