Commit Graph

1430 Commits

Author SHA1 Message Date
wmayer
1a20b7f119 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
Chris Hennes
c996f3040d App: Fix missing ignored variable 2022-03-21 09:40:28 -05:00
Chris Hennes
af041fb4d6 App: Add Metadata content type test 2022-03-21 09:24:51 -05:00
wmayer
1a62c2024d lgtm: removes unused imports in Python scripts 2022-03-20 23:00:55 +01:00
wmayer
585bcb8708 lgtm: [skip ci] FIXME comment
Change FIXME or remove it
2022-03-20 16:51:23 +01:00
wmayer
65a6575921 App: [skip ci] lgtm: Declaration hides parameter
Local variable 'obj' hides a parameter of the same name.
2022-03-20 16:46:16 +01:00
wmayer
a0d6310658 App: [skip ci] lgtm: Large object passed by value
This parameter of type pair<const basic_string<char, char_traits<char>, allocator<char>>, Metadata> is 672 bytes - consider passing a const pointer/reference instead.
2022-03-20 16:42:48 +01:00
wmayer
fa81d0d21c App: [skip ci] fix warning 2022-03-20 13:41:45 +01:00
wmayer
02ac1508ff App/Gui: make operator-> operator of WeakPtrT constant 2022-03-19 15:35:58 +01:00
wmayer
c6398bbbe0 App: make sure to create parent directories of a document's transient directory 2022-03-19 13:58:10 +01:00
wmayer
e785569f7b App: use static functions of FileInfo to convert between path and string 2022-03-19 13:57:24 +01:00
wmayer
e4d1ed8366 Base: rename BaseExceptionFreeCADError to PyExc_FC_GeneralError 2022-03-17 14:45:48 +01:00
wmayer
1f12dca2b4 Py: replace BaseExceptionFreeCADError with more suitable exception types 2022-03-17 13:54:23 +01:00
wmayer
6e5feb5ccc App: change base types of some exceptions and raise XML exceptions in MetadataPy::PyInit 2022-03-17 11:43:59 +01:00
wmayer
a90a39a4c9 Base: add more custom Python exception types 2022-03-17 11:29:09 +01:00
wmayer
0f9768fb33 Fix coverity issue:
* CID 332682: Resource leak
* CID 350607: Resource leak
* CID 332677: Resource leak
2022-03-14 11:35:04 +01:00
Chris Hennes
46cd740269 App: Improve Metadata error handling
Report XML parse exception details.
2022-03-13 21:01:47 -05:00
Chris Hennes
4fc8ee56a6 App: Fix Metadata Py constructors
Also adds unit tests for the corrected Copy and Default constructors.
2022-03-13 21:01:47 -05:00
wmayer
b78dc894e1 Core: Fix several coverity issues:
* CID 350582: Big parameter passed by value
* CID 350639: Big parameter passed by value
* CID 305234: Uncaught exception
* CID 316529: Uncaught exception
* CID 350597: Uncaught exception
* CID 350623: Uncaught exception
* CID 332690: Uncaught exception
* CID 332700: Unchecked return value
* CID 350576: Uninitialized scalar field
* CID 350587: Uninitialized scalar variable
* CID 192606: Uninitialized scalar field
* CID 332699: Uninitialized pointer field
* CID 350561: Dereference null return value
* CID 350610: Dereference null return value
* CID 350567: Dereference after null check
2022-03-13 13:53:32 +01:00
wmayer
5fd93b7d3b Fix several coverity issues:
* CID 350617: Dereference after null check
* CID 350585: Out-of-bounds read
* CID 350624: Resource leak
* CID 332701: Uncaught exception
* CID 350642: Uninitialized scalar field
* CID 350590: Uninitialized scalar field
* CID 350629: Uninitialized scalar variable
* CID 350602: Uninitialized scalar variable
* CID 350564: Uninitialized scalar variable
* CID 350548: Uninitialized scalar variable
2022-03-13 12:12:49 +01:00
wmayer
b34a00fe14 App: add convenience method DocumentObject::clearExpression() 2022-03-10 12:09:57 +01:00
wmayer
042d9d248e App: correctly handle int as argument for ocumentPy::getObject
Add a unit test to confirm correct behaviour
2022-03-09 23:02:22 +01:00
wmayer
55bd9677a9 App: [skip ci] fix bug in Metadata::supportsCurrentFreeCAD()
clang prints the warning: operator '?:' has lower precedence than '<<'; '<<' will be evaluated first [-Wparentheses]
2022-03-09 22:05:14 +01:00
wmayer
08b77bff08 Core/Mod: modernize C++11
* use nullptr
2022-03-09 21:55:31 +01:00
Chris Hennes
0c85c16932 Core: Support disabling Addon by FreeCAD version
If package.xml metadata file exists, it is scanned for FreeCAD version
compatibility before the Addon is loaded. If the Addon specifies that it is
explicitly not compatible with the current version of FreeCAD, the Addon is
not loaded.
2022-03-08 23:19:04 -06:00
Uwe
7d1a64e1c1 [App] AutoTransaction: a change to silence MSVC compiler
as proposed here: https://github.com/FreeCAD/FreeCAD/pull/6519#discussion_r820641762
2022-03-07 20:34:02 +01:00
wmayer
f1f68db55b App: Optimize includes to reduce compile time 2022-03-07 15:53:58 +01:00
wmayer
4b0658a3a6 App: include cstddef to get definition of size_t 2022-03-07 01:00:14 +01:00
Uwe
cdff8e19dc Revert "[App] add a missing return statement (#6519)"
This reverts commit 5c7ef17ac063f9339c68333afecf1cd88404b959.
2022-03-07 00:50:18 +01:00
wmayer
4a343ab31e Base/App: fix warnings from code analysers:
* convert old-style-casts to explicit C++ casts where possible
* make some implicit conversions explicit
2022-03-06 23:49:30 +01:00
Uwe
26ece78df4 [App] add a missing return statement (#6519)
* [App] add a missing return statement

as discussed here: ceae048a43 (commitcomment-68066635)
2022-03-06 23:20:05 +01:00
wmayer
91e4e468dd Base: move ILogger sub-classes to their own source files in order to reduce including stream classes in client code 2022-03-06 10:13:47 +01:00
Uwe
f274c63e0e [App] next attempt to fix CI build error
- revert previous commit and re-add application as header
2022-03-06 03:25:14 +01:00
Uwe
8250cab590 [App] try to fix CI build failure
- since I have no clue what the error is about:
https://gitlab.com/freecad/FreeCAD-CI/-/jobs/2167699355
I follow MSVC's advice that tells me that a function definition in the .cpp file is missing
2022-03-06 03:02:14 +01:00
wmayer
5e0cfc64ee App: use forward declarations 2022-03-04 21:09:46 +01:00
wmayer
2a33fe77f6 App/Gui: move template classes (ViewProvider)ExtensionPythonT to their own header files 2022-03-04 18:54:42 +01:00
wmayer
1cbecdf122 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
wmayer
6c2e1a2d6e Base: implement a lightweight smart pointer for PyObject like Py::Object to reduce includes of Python.h in header files 2022-03-04 15:51:51 +01:00
wmayer
9798e6de2b App: move member DocumentPythonObject to DocumentP 2022-03-03 20:28:47 +01:00
Chris Hennes
6dd6c3168d Core: Remove Init.py stop file check from inner package loop
Check was unused, only stop files located at the top-level should halt loading.
2022-03-02 10:00:52 -06:00
Uwe
7a551a82f3 [App] remove header
slipped in with previous commit but will be part of a PR
2022-03-02 01:53:28 +01:00
Uwe
71d6e43d54 [Base] some sorting and cleanup 2022-03-02 01:51:05 +01:00
wmayer
739804b511 Mod: add string header to dxf.h 2022-03-01 17:18:29 +01:00
wmayer
e70170dbf3 App: [skip ci] Add enum value to suppress error messages on document recompute 2022-02-28 17:54:25 +01:00
Uwe
d64c091385 [App] Origin and Part: remove unused includes 2022-02-28 13:15:23 +01:00
Chris Hennes
7d0e6aa1ac Core: Correct metadata docs 2022-02-27 23:33:07 -06:00
Uwe
f04194b7bb [App] Object, Meta, Merge: remove unused includes 2022-02-28 01:02:06 +01:00
Uwe
efd68f1c69 [App] remove unused code and some header sorting 2022-02-28 00:17:16 +01:00
Uwe
062944f674 [App] Link and Material: remove unused includes 2022-02-27 21:23:51 +01:00
Uwe
7a60d92282 [App] Annotation: remove unused code 2022-02-27 18:30:15 +01:00