Commit Graph

2445 Commits

Author SHA1 Message Date
wmayer
8062fadbd4 App: Replace C macros with lambda expression 2026-01-30 10:58:09 +01:00
wmayer
93ee3a3475 App: Remove assert() from PropertyXLink::Restore
If the property is added to a view provider then in debug mode this will
cause a crash while in release mode this will cause undefined behaviour
because of a static_cast.

To fix crashes remove the assert() and replace the static_cast with
freecad_cast.
2026-01-30 10:58:09 +01:00
wmayer
dace71205f App: In ProjectFile::loadDocument() check for parse errors
In case a parse error occurred then return with false and do not set the DOMDocument
2026-01-30 10:56:05 +01:00
wmayer
56e687d9cc App: Refactor PropertyExpressionEngine::afterRestore()
Put the reading of each expression of an object into a try/catch block. This is to avoid that all expressions of an object may be lost.

This mitigates the issue 19866
2026-01-30 10:56:05 +01:00
wmayer
3fba587044 App: In ExpressionParser::parse add the failing expression text to the error message 2026-01-30 10:56:05 +01:00
wmayer
2799aa2700 App: Simplify and fix code for ifcopenshell version check 2026-01-30 10:56:05 +01:00
Chase Naples
b182ebdfd6 Docs: update Link copyOnChange tooltip (#26603) 2026-01-29 17:46:32 +00:00
Chris Hennes
a00db89f57 Merge pull request #25196 from pieterhijma/doc-application
Doc: Improve the documentation of Application
2026-01-29 13:31:09 +01:00
Chris Hennes
c74ac37488 Merge pull request #25195 from pieterhijma/doc-document
Doc: Improve the documentation of Document
2026-01-29 13:29:43 +01:00
Chris Hennes
9919f77642 App: Handle OSError for library directory 2026-01-22 07:46:46 -06:00
freecad-gh-actions-translation-bot
10a540b1bf Update translations from Crowdin 2026-01-19 08:10:24 +01:00
Yash Suthar
7aafb105f7 App: Prevent addObjects from extracting children of nested groups (#26846)
* App: Prevent from extracting children of nested groups

Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>

* Update src/App/GeoFeatureGroupExtension.cpp

---------

Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2026-01-18 02:05:43 +00:00
Frank Martinez
3d9f640300 Remove unnecessary warnings during Mod scanning. 2026-01-15 11:06:26 -06:00
Pieter Hijma
393434026a Doc: Add a topic for App::Application 2026-01-12 09:38:45 +01:00
Pieter Hijma
d4a115df06 [Doc] Improve the App::Application documentation 2026-01-12 09:38:42 +01:00
Pieter Hijma
df85b59de9 Doc: Improve the topic for App::Document 2026-01-12 09:19:05 +01:00
Pieter Hijma
bd3a7c1368 Doc: Improve App::Document documentation 2026-01-12 09:19:03 +01:00
Pieter Hijma
c093fd484c Doc: Add a topic for App::DocumentObject 2026-01-12 08:39:53 +01:00
Pieter Hijma
788fe423e8 Doc: Improve App::DocumentObject documentation
It also improves documentation from other files for relevant dependent
functions.
2026-01-12 08:39:48 +01:00
Pieter Hijma
d0b1191b2d Doc: Move App::DocumentObject documentation
App::DocumentObject had docstrings both in the cpp file and in the
header file.  All documentation has been moved to the header file. In
cases where documentation existed in both the header and cpp file, the
documentation has been reconciled.
2026-01-12 08:27:51 +01:00
Kacper Donat
800990bacd Part: Introduce PreviewUpdateScheduler
This commit introduces PreviewUpdateScheduler class that is responsible
to schedule the true recompute of the preview. View Providers (or other
components) can use this service to ask for the preview recompute to
happend at a time that is convinent for a program and that won't impact
performance.

The provided implementation uses Queued Connections in Qt to calculate
preview essentially on next run of the event loop. It allows business
logic in FreeCAD (like property propagation) to execute fully and then
recompute preview once. This greately reduces number of recompute calls
for previews.
2026-01-11 20:32:50 -06:00
tritao
69058376e6 Base: Remove Boost-based signals and switch to FastSignals. 2026-01-07 21:16:16 +00:00
wmayer
f9cbeb91b1 Simplify code using xerces namespace 2026-01-07 14:37:59 +01:00
Max Wilfinger
3cdc42fd58 Merge pull request #25897 from marioalexis84/fem-magnetic_flux_density 2026-01-07 10:15:20 +01:00
drwho495
9b64da827a TopoNaming: Improve ElementMapVersion definition. (#26691)
This change makes the program only mark an object's ElementMapVersion with the "1" prefix if the object has a hasher AND an element map.
2026-01-06 15:36:19 +00:00
Yash Suthar
9e22524e11 Core: Fix premature merge of property in debug mode
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
2026-01-05 17:51:47 +01:00
freecad-gh-actions-translation-bot
2592406b35 Update translations from Crowdin 2026-01-05 08:47:20 +01:00
chris
6df651b5c8 partdesign: fix issue #25811 while not breaking #14720 topo naming 2026-01-02 18:52:30 +01:00
drwho495
e9ea3d0d25 TopoNaming: Enable migration code for 1.0.X -> 1.1 (#26538) 2025-12-30 13:24:09 +01:00
Yash Suthar
ee7d84bb03 Fix : added empty link check to prevent null entry in document link map (#26406)
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
2025-12-29 17:35:01 +01:00
freecad-gh-actions-translation-bot
7fe10f7436 Update translations from Crowdin 2025-12-29 11:31:39 +01:00
PhoneDroid
8abd25c999 [ App ]: Update SPDX License Identifiers 2025-12-25 11:55:37 -06:00
Christoph Moench-Tegeder
4f4f4425aa Include sys/sysctl.h on FreeBSD when using sysctl()
The ApplicationDirectories::findHomePath() on BSD uses sysctl()
to find the path to the running executable. On FreeBSD, we need
to include sys/sysctl.h for that - and as it is not included anywhere
else, add it to the includes directly in front of this function,
with a suitable ifdef.
2025-12-19 20:55:52 -06:00
Yash Suthar
dbd2bade1e Part: added floating point fallback in PropertyLinks::_updateElementReference
Signed-off-by: Yash Suthar <yashsuthar983@gmail.com>
2025-12-19 10:52:26 +01:00
Syres916
26cc33ecfb [Core] Fix macro path append to sys.path 2025-12-18 13:19:21 -06:00
Chris Hennes
55a55725eb App: Compiler warning cleanup 2025-12-17 10:41:27 -06:00
marioalexis
0f148f6e63 Base: Add millitesla unit 2025-12-16 14:26:31 -03:00
drwho495
88b5cde45f Implement Fix
Switch from checking child tag to checking the materTag
2025-12-15 11:17:42 -06:00
Kacper Donat
fc93004c89 Gui: Improve transform UI responsivness
This introduces much faster CenterOfMassProvider#supports method that
can be used as cheap pre-check to see if the object supplied could have
the center of mass and so delay the domputation to a moment where it is
actually needed.
2025-12-15 09:18:27 -06:00
luzpaz
5c0ff4bd8a Fix typos
Fixes various documentation/source-comment typos
2025-12-12 13:59:38 +01:00
PaddleStroke
893a9d19b6 Core: move getPlacementProperty to be more accessible (#26088)
* Core: move getPlacementProperty to be more accessible

* Update DocumentObject.h

* Update DocumentObject.cpp

* Update ViewProviderDragger.h

* Update ViewProviderDragger.cpp

* Update DocumentObject.h

* Update DocumentObject.cpp

* Update ViewProviderLink.cpp

* Update DocumentObject.h

* Update DocumentObject.cpp

* Update DocumentObject.h
2025-12-12 11:59:03 +00:00
PaddleStroke
7a8135d863 Core: Add getPlacementOf replacing previous getGlobalPlacement logic. (#26059)
* Core: Add getPlacementOf replacing previous getGlobalPlacement logic.

* Update src/App/DocumentObject.cpp

Co-authored-by: Kacper Donat <kadet1090@gmail.com>

* Update DocumentObject.cpp

* Fix error when called from python with targetObj == None

---------

Co-authored-by: Kacper Donat <kadet1090@gmail.com>
2025-12-10 22:47:20 +01:00
freecad-gh-actions-translation-bot
f7483a08b4 Update translations from Crowdin 2025-12-08 22:31:48 -06:00
Frank David Martínez M
d7a7416398 [Core] FreeCADInit and FreeCADGuiInit refactoring (#23413) 2025-12-04 11:10:53 -06:00
Chris Hennes
dfb9baf678 Merge pull request #24262 from mnesarco/pyi-fixes-1 2025-11-29 20:23:37 -06:00
PaddleStroke
79f66b75f3 Datums: Prevent 'doesn't contain feature with role' error on load 2025-11-28 12:08:38 +01:00
github-actions
68cb0a3270 Update translations from Crowdin 2025-11-25 21:20:42 -06:00
Furgo
b571889ab5 App: Handle uncleared Python exceptions during object restoration
When a Python-based object throws an exception during the restoration
process (e.g. inside `onDocumentRestored`), the error is caught by a
generic `catch(...)` block in `Document::afterRestore`.

Previously, this block swallowed the C++ exception wrapper but failed to
clear the underlying Python error state. Leaving the interpreter in this
"dirty" state caused a segmentation fault or `SystemError` later in the
loading process when C++ attempted to interact with the Python API
(specifically in `App::Application::setActiveDocument`).

This commit adds a check for `PyErr_Occurred()` inside the catch block.
If an error is detected, the traceback is printed to the console for
debugging, and `PyErr_Clear()` is called to reset the interpreter state,
allowing the application to continue loading the document without
crashing.
2025-11-24 17:26:46 +01:00
Andrew Burks
bad2989b7b #25474 Added read-only warnings when saving documents (#25532)
* #25474 Added read-only warnings when saving documents

Block saving a file and notify user if windows is unable to save to the file for any reason, or the read-only attribute is checked. Also check std::filesystem::perms for write permission and other checks in FileInfo::isWritable(), although it doesn't seem to matter on windows.

Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2025-11-23 05:09:32 +00:00
Logstor
e802aa1821 Removed sys in 'from os import sys, path' 2025-11-20 20:13:16 -06:00