Commit Graph

2482 Commits

Author SHA1 Message Date
forbes
9809ff852c feat: .kc file format — Layer 1 (format registration)
Cherry-picked from feat/kc-file-format-layer1 (723a8c98d5).
- Document.cpp: checkFileName() accepts .kc extension
- FreeCADInit.py: register .kc import type
- Dialog filters: Save As, Save Copy, Merge, Project Utility
- kc_format.py: DocumentObserver preserves silo/ entries across saves
- InitGui.py: register kc_format observer on startup
2026-02-13 14:10:36 -06:00
Frank David Martínez M
f1366e8a75 Base: Remove assertion on isForceXML() (#27491)
This fixes a difference between Main code and LS3 Code ported during TNP big merge. The Issue generates a crash if FreeCAD is compiled in Debug Mode: #27489.
2026-02-13 11:51:52 -06:00
Christoph Niethammer
1046c3682a Fix typos (#26576)
* Fix typos in code documentation

Signed-off-by: Christoph Niethammer <christoph.niethammer@gmail.com>

* Update tool tip for links 'copyOnChange' property

The tool tip for the copyOnChange property was missing the "tracking"
option and had some typos. For details see the wiki documentation at
https://wiki.freecad.org/Std_LinkMake and commit
d1b6bb78d1.

Signed-off-by: Christoph Niethammer <christoph.niethammer@gmail.com>

---------

Signed-off-by: Christoph Niethammer <christoph.niethammer@gmail.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Chris Hennes <chennes@pioneerlibrarysystem.org>
2026-02-09 19:15:50 -06:00
drwho495
72b1076788 Remove hasher check and migrate CAM files 2026-02-09 11:00:23 -06:00
wmayer
cda2b8cbdb Use Application::getExecutableName() instead of Config()["ExeName"] 2026-02-05 10:59:52 +01:00
wmayer
4f116d8de3 App: Move Python functions from Application to ApplicationPy
This reduces build time when adding new Python functions because
only one file must be compiled.
2026-02-05 10:59:52 +01:00
wmayer
c97f6e5b3f App: Improve Document::writeObjects
Do not directly pass getNameInDocument() to the ostream as this will
set the badbit in case it returns nullptr. As a result no further
output is written to the stream and leads to loss of data.

Instead the returned C string is stored in a local variable and in case
it's nullptr an empty string is passed to the ostream.

At the end of the function writeObjects() it's checked whether the
failbit or badbit is set. If yes an error message is printed and the
failbit or badbit are cleared.

This is supposed to fix the issue 18044.

In case this fix is not sufficient it can be also check for every
object inside writeObjectData()
2026-02-05 10:59:50 +01:00
wmayer
2c2cdbfe7f App: Refactor Document::writeObjects 2026-02-05 10:47:49 +01:00
wmayer
6c9ad95a70 App: Improve handling with freeze status
* Do not raise an exception when saving a document and an object has
  'freeze' status because this breaks the project file and may lead
  to loss of data.
* Make 'freeze' state persistent
* When toggling 'freeze' status only work directly on the selection.
  Do not use in-list or out-list of an object because this makes it
  quite inflexible and leads to unpredictable behaviour.

This fixes issue with saving frozen files described in 18806.
2026-02-05 10:04:46 +01:00
Chris Hennes
6ada8e2cef Merge pull request #25199 from pieterhijma/doc-element-mapping
Doc: Improve the documentation of element mapping
2026-02-03 21:06:53 +01:00
Chris Hennes
f3b4aa6b8c Merge pull request #25198 from pieterhijma/doc-expressions
Doc: Improve the documentation of expressions
2026-02-03 21:06:13 +01:00
Chris Hennes
eb42b77285 Merge pull request #25143 from furgo16/issue_24571
App: cherry-pick - Implement Save() & Restore() for int/float constraint properties
2026-02-03 21:04:50 +01:00
captain0xff
79632dd3c6 App: handle symlinks in Application::processFiles & DocInfo::getDocPath 2026-02-02 19:50:36 +01:00
Chris Hennes
a4a1ef7294 App: Get Addon name from Metadata 2026-02-02 19:50:16 +01:00
Kacper Donat
92dbaad9db Merge pull request #27243 from 3x380V/app
App: Random fixes 1
2026-02-02 17:40:40 +01:00
freecad-gh-actions-translation-bot
0b7da82433 Update translations from Crowdin 2026-02-02 11:49:57 +01:00
Pieter Hijma
1d51b8e5e5 Doc: Improve the Expression Framework topic 2026-01-31 19:52:33 +01:00
Pieter Hijma
befd4a23ee Doc: Improve App::PropertyExpressionEngine docs 2026-01-31 19:52:33 +01:00
Pieter Hijma
ee538f707f Doc: Move doc comments in PropertyExpressionEngine
Several doc comments in App/PropertyExpressionEngine.cpp are moved to
header files.
2026-01-31 19:52:33 +01:00
Pieter Hijma
f113e775a1 Doc: Improve the App::Expression documentation 2026-01-31 19:52:33 +01:00
Pieter Hijma
063f03c764 Doc: Move doc comments in App::Expression
Several doc comments in App/Expression.cpp are moved to header files.
2026-01-31 19:52:33 +01:00
Chris Hennes
bbd0ba7626 Merge pull request #25197 from pieterhijma/doc-link
Doc: Improve the documentation of Link
2026-01-31 19:52:19 +01:00
Ladislav Michl
0831f7e392 App: Avoid C string compare
Since we are linking to boost anyway, use boost function for case
insensitive string compare. While there, make affected methods accept
std::string arguments, which simplifies code a bit.
2026-01-30 10:58:09 +01:00
wmayer
1886bcda00 App: Fix crash in Transaction::addObjectChange
It can happen that TransactionFactory::createTransaction() fails to create a transaction object because an unsuitable type is passed
(like BadType) and returns a null pointer.

The calling instances (Transaction::addObjectChange, Transaction::addObjectDel, Transaction::addObjectNew, Transaction::addOrRemoveProperty)
do not check for a null pointer and thus cause a segmentation fault by dereferencing it.

To fix the issue change the above methods to explicitly handle a null pointer.

This fixes issue 21095.

Note: In this case it's caused by the class ViewProviderFace which on purpose isn't added to the type system so that its type will be BadType.
2026-01-30 10:58:09 +01:00
wmayer
60b0221402 App: Optimize PropertyMaterialList::getDiffuseColors()/getTransparencies() 2026-01-30 10:58:09 +01:00
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
Furgo
d77e77f9f4 App: Replace getAttributeAs{Integer,Float} with templated getAttribute
Template was introduced in https://github.com/FreeCAD/FreeCAD/pull/19907
2026-01-29 08:44:25 +01:00
wwmayer
2de933793d App: Implement Save() & Restore() for int/float constraint properties
Implement the methods Save() and Restore() for PropertyIntegerConstraint and PropertyFloatConstraint. Handle also the case of a user-defined ranges.

This fixes https://github.com/FreeCAD/FreeCAD/issues/24571.

Hint: For PropertyQuantityConstraint this is not doable because it doesn't support user-defined ranges
2026-01-29 08:44:25 +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
0537bd6c36 Doc: Add a topic for element mapping 2026-01-12 10:36:11 +01:00
Pieter Hijma
171a14f542 Doc: Improve documentation element mapping 2026-01-12 10:36:09 +01:00
Pieter Hijma
88c2e9122e Doc: Improve the Expression Framework topic 2026-01-12 10:11:54 +01:00
Pieter Hijma
817c8e9dd3 Doc: Improve App::PropertyExpressionEngine docs 2026-01-12 10:11:54 +01:00
Pieter Hijma
8f110b59e7 Doc: Move doc comments in PropertyExpressionEngine
Several doc comments in App/PropertyExpressionEngine.cpp are moved to
header files.
2026-01-12 10:11:54 +01:00
Pieter Hijma
6afb6f7071 Doc: Improve the App::Expression documentation 2026-01-12 10:11:54 +01:00
Pieter Hijma
250b3790dd Doc: Move doc comments in App::Expression
Several doc comments in App/Expression.cpp are moved to header files.
2026-01-12 10:11:53 +01:00
Pieter Hijma
fac384d677 Doc: Add a topic for App::link 2026-01-12 10:01:45 +01:00
Pieter Hijma
401400cbcd Doc: Apply cog to Link.h and Link.cpp
Cog is reapplied to create improved documentation for LinkParams.  See
LinkParams.py
2026-01-12 10:01:45 +01:00
Pieter Hijma
16592cae48 Doc: Improve the App::Link documentation 2026-01-12 10:01:43 +01:00