Commit Graph

2367 Commits

Author SHA1 Message Date
Frank David Martínez M
77b034dc82 Fix Refine in Cut Compound test 2025-09-26 16:12:56 -05:00
marioalexis
c8fb2d1ae0 App: Fix GroupExtension finding wrong group for objects 2025-09-25 15:52:43 -05:00
Chris Hennes
1c6d9c79fb Update translations 2025-09-25 2025-09-25 17:25:13 +02:00
PaddleStroke
725abff6a7 Core: Add signalAboutToOpenTransaction (#24049)
* Core: Add signalAboutToOpenTransaction

* change name to squash

* Update AutoTransaction.cpp

* Update Application.h

* reorder

* Update AutoTransaction.cpp

* Update Application.h
2025-09-24 22:45:57 -05:00
Chris Hennes
8c66c91ef4 Merge pull request #23803 from 3x380V/py
Py3.13: fix warnings
2025-09-24 22:16:30 -05:00
drwho495
08cbc5cffa Toponaming: Don't add empty tags past the threshold 2025-09-22 10:35:13 -05:00
Chris Hennes
b262f4b17c App: Fix the Python wrapper for isVersionedPath 2025-09-20 11:46:11 -05:00
sliptonic
975a4b65d2 Merge pull request #23585 from chennes/extractVersionMigrator
Gui: Improve version migration UX
2025-09-20 10:01:40 -05:00
PaddleStroke
a24747bcb8 Core: GeoFeature::getPlacementFromProp prevent potential crash 2025-09-19 08:40:06 -05:00
Chris Hennes
cc48a08f46 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
524526ac5a Merge pull request #23885 from chennes/pythonInterfaceToApplicationDirectories
App: Add Python interface to ApplicationDirectories
2025-09-17 18:11:41 -05:00
Chris Hennes
4aa01bb948 App: Remove manual PCH entries 2025-09-17 16:18:10 -05:00
Chris Hennes
5f30da529a App: Address reviewer comments 2025-09-17 16:08:07 -05:00
Chris Hennes
d9e6ee8fa1 Gui: Improve version migration UX 2025-09-17 10:43:16 -05:00
Chris Hennes
02721eec37 Update translations 2025-09-15 2025-09-16 09:55:13 +02:00
Markus Reitböck
73c97bc90f 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
Chris Hennes
641bf0b511 App: Add Python interface to ApplicationDirectories
The Python version of this class is entirely static: no instance is
required. Internally it accesses th pre-constructed instance of the C++
ApplicationDirectories class that is instantiated at program startup by
the Application class.
2025-09-12 15:25:47 -05:00
Markus Reitböck
496b31b087 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
Markus Reitböck
be6b957929 missing includes in Base, App and Gui headers (#23854)
* missing includes in Base, App and Gui headers

header should be self contained

* use cstddef header instead of stddef.h

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>

---------

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-09-11 18:58:44 -05:00
Chris Hennes
ff349c81d6 Merge pull request #23746 from 3x380V/cmake
CMake: Use scoped include and library directories
2025-09-10 21:54:51 -05:00
Chris Hennes
23bcfd12ff Update translations 2025-09-09 2025-09-10 08:53:41 +02:00
Ladislav Michl
175454b78c Py3.13: Initialize field tp_versions_used 2025-09-10 08:49:31 +02:00
wmayer
ac51455a0a CMake: Replace include_directories with target_include_directories 2025-09-08 19:04:34 +02:00
drwho495
edb046d48e Toponaming: Remove updateElementReferences call in getLinks methods. (#23525)
* remove calls to updateElementReferences in getLinks

* add description of the bug for future developers' sake
2025-09-07 20:40:47 -05:00
Chris Hennes
c00bf075e5 Merge pull request #23384 from 3x380V/units
Base: Units update
2025-09-07 20:22:54 -05:00
Weston Schmidt
87a4ce2e8d Add test causing crash and fix map sorting function. (#22889)
* Add test causing crash and fix map sorting function.

When opening a model from FreeCAD 0.7, the model would crash when I
changed some of the parameters.  This turned out to be due to the
ElementNameComparator::operator() not correctly sorting the items going
into the map, which caused the map to be invalid.

This change adds a test that represented the exact names causing the
crash as well as a fix for the problem.  Names are now sorted:

1. Empty names first
2. Identifier based names second.
3. Hex based names last.

Identifiers are sorted lexicographically for the name portion and
numerically for the number portion, smallest to largest.

Hex based names are sorted by the value of the hex number, smallest to
largest.

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

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

* Fix lint issues.

* Add another test form to the mix.

---------

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2025-09-05 14:07:02 -05:00
Ladislav Michl
0278a1298d Base: refactor unit formatting defaults
Defaults for both precision (number of digits after decimal point)
and denominator (number of fractions) are defined on various places
making difficult to find which default is used for various tasks.
Store these values at one central place: UnitsApi. Unless overriden
by user, default values are defined by unitSchemasDataPack.
2025-09-05 17:31:54 +02:00
Chris Hennes
c0d1151633 Update translations 2025-09-03 2025-09-04 11:37:11 +02:00
Chris Hennes
4fbe8e1773 App: Fix safe mode and home directory 2025-09-02 21:39:09 +02:00
luzpaz
b7959450f2 AddonManager: ignore everything but dirs in getVerboseAddOnsInfo
Before this PR addon manager was displaying manifest.json files along with backup files. Now those are ignored.
Fixes #23545
2025-09-01 22:32:23 -05:00
Chris Hennes
a429931abd Core: Record module failure information during startup 2025-09-01 18:10:04 +02:00
Chris Hennes
0206ebc1e3 Merge pull request #23503 from maxwxyz/issue-22123
Fix STEP import with bad string behavior
2025-08-31 23:23:25 -05:00
PaddleStroke
00e6ce5f5e Core: Datums: Make getDirection and getBasePoint aware of LCS position 2025-08-31 22:54:03 -05:00
Kacper Donat
6cc652f414 Merge pull request #23321 from chennes/refactorApplicationAndAddVersioning
Refactor App::Application directory handling and add versioning
2025-08-31 21:35:02 +02:00
wmayer
379fd2cf9b App: Fix output string to XML
Not all unicode characters are allowed as XML output. When writing disallowed characters the SAX parser throws an exception
when loading a project file that results into a broken document and thus to a possible loss of data.

This PR replaces all disallowed characters with an underscore and prints a warning.

This fixes https://github.com/FreeCAD/FreeCAD/issues/22123
Note: It does not fix an already corrupted project file.
2025-08-31 14:38:05 +02:00
Chris Hennes
78c6c5a962 Merge pull request #23368 from kadet1090/show-placement-and-plane-in-attacher
Gui: Show placement and plane in attacher
2025-08-30 14:13:43 -05:00
Chris Hennes
f3c675ed5b Update translations 2025-08-28 16:14:49 +02:00
Chris Hennes
fa98beb221 App: refactor to use unique_ptr
Also address other reviewer comments.
2025-08-27 11:51:22 -05:00
Chris Hennes
5c7a44d7d8 App: Fix problems with temp dir creation 2025-08-27 11:51:22 -05:00
Chris Hennes
bce7ff8708 App: Add directory versioning for data and config
At the application level, support the existence of subdirectories inside
the original config and data paths for a specific version of the
software. For a new installation, create them, but for an existing
installation use the most recent available version, even if it's not the
current one (and even if it's not versioned at all). Any migration must
be done at the GUI level due to the amount of data that is potentially
being copied during that process.
2025-08-27 11:51:22 -05:00
Chris Hennes
3426c9ff21 App: Migrate directory handling to helper class
Use std::filesystem wherever possible, replacing most uses of
std::string when the object is actually a path. This is the first stage
of refactoring, and does not make any changes to Application that affect
client code. Access to the new directory-handling class is implemented,
but is unused by any external code.
2025-08-27 11:51:22 -05:00
Kacper Donat
13a74c14fd App: Add helpers for guarding property overrides.
Within code often it is required to temporarly override value of some
object properties. To properly restore old values they must be stored
somewhere and the developer must remember to manualy restore them.

This commit introduces utilities that can be used to make it easier
using RAII idiom to guard the overrides.
2025-08-27 16:53:37 +02:00
Benjamin Nauck
1b49998f6f Merge pull request #23291 from 3x380V/measurement
Measure: Useability improvements
2025-08-26 06:51:50 +02:00
drwho495
3ee1e3335f Toponaming: Remove updateElementReferences call in PropertyLinkSub (#23263)
* remove updateElementReferences call in PropertyLinkSub

* Retrigger checks

* update element refs after the document has restored
2025-08-25 21:39:40 -05:00
Frank David Martínez M
0f2ea5588c [Core] Fix #15558: Direct expression in ternary operator (#22938)
* [Core] Fix #15558: Direct expression in ternary operator

* [Core] Added tests for Non-Numeric conditions in ternary op.

* [Core] prevent relational operator chains at grammar level.

* [Core] Rewrite expressions grammar as a layered grammar.

* [Core] Revert to left associative relops (like C/C++) plus tests.
2025-08-25 21:52:42 +02:00
wmayer
d1a84ab538 Measure: Fix TaskMeasure
Made several fixes to TaskMeasure:
* Move to correct namespace
* Handle possible exception in update() method
* Add null pointer checks for buttonBox
* Cannot use 'Measure::MeasurePython' as template argument in addObject<>
  because the macro PROPERTY_HEADER_WITH_OVERRIDE determines the invalid
  string 'App::FeaturePythonT<FeatureT>' so that an exception is raised

Note: The changes might fix issue 20304
2025-08-25 09:21:33 +02:00
wmayer
c15e46348d App: Remove build dependency to Coin3D
Fixes https://github.com/FreeCAD/FreeCAD/issues/20897
2025-08-24 22:18:55 -05:00
Chris Hennes
1ac1d93069 Merge pull request #23164 from ickby/FEM_post_fixes_4
Fem: Fix for 3 issues
2025-08-19 19:00:55 -05:00
Stefan Tröger
96ed82f0cf FEM: Keep result pipeline and only reload data. Fixes #20542 2025-08-19 17:44:21 +02:00
drwho495
a43e712700 Toponaming: Update element references of PropertyLinks everytime the program needs to access the values (#22785) 2025-08-18 11:11:49 -05:00