567 Commits

Author SHA1 Message Date
Kacper Donat 12cced51f1 Merge pull request #21978 from theo-vt/document_transaction
GSOC Multi file editing
2026-03-18 18:37:38 +01:00
PaddleStroke eabd052c17 Core: Fix freecad when windows path has non ASCII characters (#28222)
* Core: Fix freecad when Windows username has non ASCII characters

* Update ApplicationDirectories.cpp

* Tests: Add tests of pathToString/stringToPath

Validates the fix for non-ASCII characters in filesystem paths (e.g.
Windows usernames with umlauts). Includes Windows-specific tests that
verify pathToString produces UTF-8 from wide-string paths and that
the naive fs::path::string() does not. On Linux these functions are
effectively a no-op, so the tests themselves are only really useful
on Windows.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-16 17:37:43 +01:00
theo-vt f4665aa7b5 Core: support multiple active transactions 2026-03-14 12:15:46 -04:00
PeterfoxUwU ecb188fe4c Base: Added Quantities for Optic/Chemical mechanics (#27944)
* Base: Added Quantities for Optic/Chemical mechanics

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-03-07 21:10:40 +01:00
Chris Hennes 8cb06956d0 Merge pull request #27759 from dhruvjamwal/main
Fix #27741: Prevent camel case splitting on numbers in Property Editor.
2026-03-07 00:08:47 -06:00
Chris Hennes 15dd009f13 Tests: Add test for PropertyItem setName() behavior 2026-03-06 22:34:42 -06:00
Chris Hennes 07e94dfaae Part: Eliminate use of sscanf
Replace with safer modern C++ `std::from_chars` (plus some additional
validation for expected inputs). Includes unit tests for new function.
2026-02-27 23:29:31 +01:00
Chris Hennes 659780c31b Tests: Add QtTests run to CI 2026-02-27 11:30:55 -06:00
Chris Hennes 0872d45827 Merge pull request #27099 from timpieces/expressionparser-improvements
ExpressionParser: Return unique_ptr from public interface (#27098)
2026-02-27 09:51:08 -06:00
Chris Hennes ad50c6eb64 Merge pull request #27428 from kadet1090/add-style-parameter-tuples
Gui: Add Tuple type to StyleParameters
2026-02-25 08:28:50 -06:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ ca9e1ecdf3 All: Header Guards ➞ Pragma Once (#27154) 2026-02-22 16:28:20 -06:00
Louis Gombert 3bad5dabde Add missing NOLINTEND clang-tidy comment 2026-02-17 15:26:14 -06:00
Kacper Donat fae6cda1d7 Merge pull request #26938 from chennes/macroPathToDefault
Gui: Don't record macro path if default
2026-02-14 20:24:31 +01:00
Chris Hennes 45598fa319 Merge pull request #27552 from hyarion/fix-schema-issues
Base: Fix schema issues
2026-02-14 12:17:51 -06:00
Benjamin Nauck d94269f85f Base: Add sweep round-trip tests for all unit schemas
Sweep tests parse a string and translate it back, verifying identical
output. Values cover every threshold band at 10x increments plus a
scientific-notation value in each default band. Tests all 10 schemas.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 14:26:46 +01:00
Chris Hennes ec18d4e250 Tests/Sketcher: Eliminate unused variables 2026-02-11 17:03:18 +01:00
Kacper Donat 1cc53d911a Gui: Add element-wise tuple arithmetic to StyleParameters
Add arithmetic operators (+, -, *, /, unary -) to Value, enabling
element-wise operations on tuples and scalar broadcast with numerics.
Tuple addition/subtraction uses union semantics: named elements match
by name, unnamed elements match positionally, and unmatched elements
pass through. BinaryOp and UnaryOp now delegate to these Value operators.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 00:33:00 +01:00
Kacper Donat 7bf2050865 Gui: Add dot syntax for tuple member access in StyleParameters
Add MemberAccess AST node and postfix `.member` parsing to support
extracting individual elements from tuple-valued parameters, e.g.
`@ButtonBorderThickness.left` or `@Grays.0`.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 00:33:00 +01:00
Kacper Donat 9e0538abc8 Gui: Add ArgumentParser for named/positional function arguments
Adds ArgumentParser class that resolves mixed positional and named
arguments against a declared function signature (Python-style).
Includes Tuple::get<T>(name) for type-checked access with
user-friendly error messages. Refactors lighten/darken/blend to use it.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 00:33:00 +01:00
Kacper Donat 7c813a6f5a Gui: Add tests for StyleParameters tuple support
Test cases cover unnamed, named, and mixed tuples, single named
elements, nested tuples, expressions and mixed types in elements,
toString roundtrip, Value::holds/get accessors, Tuple::at/find/size,
error handling, and backward compatibility of grouped expressions.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-09 00:33:00 +01:00
Chris Hennes 5b27deb4f0 Gui: Migrate old macro dir if needed 2026-02-07 20:36:43 -06:00
timpieces adf15a401d ExpressionParser: Add more tests for expression parsing (#27098)
- I'm not familiar with absolutely all usages of expressions - this is
  intended more as a starting point to make it easy to add more
- The test captures *current* behaviour, please don't assume that
  everything it tests is *correct* behaviour
2026-02-07 11:23:13 +08:00
timpieces 1de8cd5e36 ExpressionParser: Make cosmetic test changes before adding more tests (#27098)
Fix some weird quirks before adding new tests:
- The whole file has clang format off, this feels unnecessary, localize
  it to where it's important
- Put the code inside a nested test namespace within the production
  namespace, this is generally good practice rather than putting it in
  the global namespace, and it means we don't have to explicitly namespace
  methods that are directly under test
- Rename variables to camelCase, which afaict is closer to 'normal' in
  freecad cpp
- Remove the usage of arrays. Maintaining manual array sizes is
  annoying. Just use initializer lists here as they are all constants.
- I have *not* renamed the snake_case methods, as I feel that it
  destroys too much of the git history for too little benefit
2026-02-07 11:23:13 +08:00
timpieces daceb8afe4 ExpressionParser: Return unique_ptr from simplified (#27098)
- Removes many/most of the copy().release() from the last commit
- Still some .release() in the simplify functions now
- It doesn't work to rename simplify and turn it into a protected
  method, because it's called recursively within the tree
2026-02-07 11:23:13 +08:00
timpieces 1455321ace ExpressionParser: Return unique_ptr from eval (#27098)
- Most of the usages of 'release' are temporary here, but a few will
  likely need to stay. In these cases, the existing behaviour is
  retained. To fix all usages, smart pointers would need to be used all
  throughout the tree
- The freecad_cast looks awkward now. I haven't added a new version that
  works with smart pointers because it's not clear what the right
  ownership semantics would be. Make the caller be explicit for now.
2026-02-07 11:23:13 +08:00
timpieces 47d02c0618 ExpressionParser: Return unique_ptr from parse (#27098)
- Start at ScanResult, as starting higher makes it easy to have memory
  issues.
- There are multiple memory leaks (at least in tests, but possibly in
  production code too) from using raw pointers in the public interface
  here. Fix these before adding more tests.
- Starts at ScanResult
- The bison changes were applied manually, as I don't think that it's
  pixified and running my local version showed many changes.
- I've chosen not to pimplify Expression, but only because it would be
  such a significant change for not so much value.
2026-02-07 11:23:09 +08:00
Chris Hennes 0a585dc3bb Base: Add tests for escapeXml 2026-01-31 09:09:27 +01:00
pre-commit-ci[bot] c19eb5c0e0 [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
2026-01-06 01:40:39 +00:00
Ajinkya Dahale 9000dc3c70 Sketcher: Add test stubs for SketchObject::addCopy() 2026-01-06 05:59:10 +05:30
Ajinkya Dahale bf51899580 Sketcher: [test] Add test for addExternal and delExternal 2026-01-06 05:59:10 +05:30
Ajinkya Dahale 9c87e26280 [Sketcher][test] Add tests for replaceGeometries() 2026-01-06 05:42:44 +05:30
PaddleStroke 07756cc838 Part: Toposhape: fix regressions due to changes in getElementTypeAndIndex (#26596)
* Part: Toposhape: fix regressions due to changes in getElementTypeAndIndex

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Update TopoShape.cpp

* Update TopoShape.cpp

* Update TopoShape.cpp

* Update TopoShape.h

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2026-01-02 19:37:09 +01:00
horseDeveloper 4892154faf Fixing Leftover references from migration from freecadweb.org (#26163) 2025-12-26 11:11:12 -06:00
PaddleStroke 3608c9f8c4 Part: TopoShape make getElementTypeAndIndex more robust (#25913)
* Part: TopoShape make getElementTypeAndIndex more robust
* Part: Add unit tests for new regex

---------

Co-authored-by: Chris Hennes <chennes@gmail.com>
2025-12-08 11:24:13 -06:00
pre-commit-ci[bot] 25c3ba7338 All: Reformat according to new standard 2025-11-11 13:49:01 +01:00
Chris Hennes d97c7cc95c Core: Switch away from deprecated wstring_convert and codecvt_utf8 2025-10-21 09:01:59 +02:00
Adrian Insaurralde Avalos 667b841de1 [Base] fix some unit tests that where dependent on user config
redundant and faulty test `imperial_decimal_1_mm_default_precision` removed, it is already covered by `imperial_decimal_1_mm_precision_2`
2025-10-14 12:42:24 +02:00
Florian Foinant-Willig f4fe303829 Sketcher: rename DeriVector2::crossProdNorm to DeriVector2::crossProdZ 2025-10-13 17:57:51 +02:00
ᴩʜᴏɴᴇᴅʀᴏɪᴅ 084003e361 Tests: Add/update SPDX header (#24547) 2025-10-09 13:50:17 -05:00
Syres916 e77f181393 [Part] Fix Part Boolean operations Refine incorrectly set for new users (#24256)
* [Part] Fix Part Boolean operations Refine incorrectly set for new users

* [Part] update tests to specify Refine to be...

...false where necessary
2025-09-27 00:33:57 -05:00
Markus Reitböck 05a706697b Material: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-22 23:17:39 +02:00
Chris Hennes 929bd5090b App: Sanitize all paths for null characters (#23821)
* App: Sanitize all paths for null characters

* [pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci

* Apply suggestions from code review

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-09-18 17:37:33 +00:00
sliptonic 79640fd18a Merge pull request #23885 from chennes/pythonInterfaceToApplicationDirectories
App: Add Python interface to ApplicationDirectories
2025-09-17 18:11:41 -05:00
Chris Hennes 8f128f21f9 Tests: Update to match new behavior 2025-09-17 17:02:35 -05:00
Markus Reitböck 6ef07bb358 Gui: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:03 +02:00
Markus Reitböck d05e2a0431 App: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:02 +02:00
Markus Reitböck f0eca551b3 Base: use CMake to generate precompiled headers on all platforms
"Professional CMake" book suggest the following:

"Targets should build successfully with or without compiler support for precompiled headers. It
should be considered an optimization, not a requirement. In particular, do not explicitly include a
precompile header (e.g. stdafx.h) in the source code, let CMake force-include an automatically
generated precompile header on the compiler command line instead. This is more portable across
the major compilers and is likely to be easier to maintain. It will also avoid warnings being
generated from certain code checking tools like iwyu (include what you use)."

Therefore, removed the "#include <PreCompiled.h>" from sources, also
there is no need for the "#ifdef _PreComp_" anymore
2025-09-14 09:47:01 +02:00
Markus Reitböck 749ac36615 do not use precompiled header for setting global compiler definitions and to disable compiler warnings
only 4 of these warnings are still relevant, CMake shall be used to disable them

Compiler definitions:

  NOMINMAX:
    * is already globally defined in SetGlobalCompilerAndLinkerSettings.cmake

  WIN32_LEAN_AND_MEAN:
    * use CMake target_compile_options on relevant targets

Warnings that still occur:

  C4251, C4273, C4275: all related to dllimport / export
    * use CMake target_compile_options on relevant targets

  C4661: no suitable definition provied for explicit template instantiation request
    * triggered in Mesh because of Vector3D in Base - not all functions are defined in header
    * use CMake target_compile_options on relevant targets

Warnings that are Currently not triggered (fix code if they appear again):

  C4005: macro redefinition

  C4244: argument conversion, possible loss of data

  C4267: conversion from size_t to type, possible loss of data

  C4305: truncation from type1 to type2
    * only occurrence disabled in Reader.cpp

  C4522: multiple assignment operator specified

  C5208: unnamed class in typedef name

Obsolete Compiler warnings:

  C4181: not mentioned in Microsoft docs anymore

  C4290: C++ exception specification ignored except to indicate a function is not __declspec(nothrow)
    * throw(optional_type_list)  deprecated in C++17

  C4482: nonstandard extension used: enum 'enumeration' used in qualified name
    * not generated for compilers that support C++11

  C4503: 'identifier': decorated name length exceeded, name was truncated
    * obsolete since Visual Studio 2017

  C4786: not mentioned in Microsoft docs anymore
2025-09-11 20:21:04 -05:00
Chris Hennes 1f05f5eda4 Merge pull request #23351 from 3x380V/fileinfo
Core: Modernize Fileinfo
2025-09-07 21:28:11 -05:00
Chris Hennes 325730dd9c Merge pull request #23384 from 3x380V/units
Base: Units update
2025-09-07 20:22:54 -05:00