Commit Graph

1226 Commits

Author SHA1 Message Date
Chris Hennes
52ed707b0e [Core] Remove deprecated code for 0.20 2021-03-07 08:44:57 +01:00
Benjamin Nauck
a7f0d0112e [App] Use std::shared_ptr instead of boost::shared_ptr
There's no need to use boost version when stl has support for shared_ptr
2021-03-06 19:32:03 +01:00
Benjamin Nauck
7ee7e60310 [App] Switch from boost::tuple to std::tuple
It's better to use the standard lib when possible
2021-03-06 19:31:06 +01:00
wmayer
3779aadd7c App: in document observer classes replace boost::bind with std::bind to fix build failure with C++17 2021-03-05 13:26:26 +01:00
wmayer
48b42f8355 App: add convenience methods to get minimum, maximum and step size of property constraints 2021-03-03 08:12:03 +01:00
wmayer
bd755b654b Gui: [skip ci] re-add removed Py_INCREF of module 2021-02-27 11:13:30 +01:00
wmayer
df0f979f3b App/Gui: fix memory leaks:
+ add function to cleanup units and quantities in debug build
+ fix reference leak in PropertyVector::getPyPathValue()
+ fix reference leak in PropertyPlacement::getPyPathValue()
+ in InterpreterSingleton::init() use a static std::vector<wchar_t*> instead of a C array
  to free memory at program end
+ in MainWindow::closeEvent() explicitly delete all task watchers
+ in ReportOutputObserver constructor pass parent to QObject
+ in PropertyEditor destructor explicitly delete QItemEditorFactory
2021-02-27 10:56:19 +01:00
wmayer
5d5d05616f App: [skip ci] AddressSanitizer: heap-use-after-free
When removing a dynamic property its myName member must be nullified as the memory has been de-allocated
2021-02-27 02:21:14 +01:00
wmayer
7cf4d4b01e App: [skip ci] AddressSanitizer: heap-use-after-free
In Document::removeObject() do not access object after it has been possibly deleted
2021-02-23 14:30:00 +01:00
wmayer
1241752b94 App: [skip ci] check object status before accessing back links 2021-02-22 17:31:25 +01:00
wmayer
c331d608aa App: [skip ci] replace plain C API with PyCXX to avoid memory leaks 2021-02-19 17:26:33 +01:00
vosk
9f72a7b406 [App] [skip ci] - Fix python new references leaking 2021-02-19 17:25:25 +01:00
wmayer
81267fc284 App/Gui: fix possible crash when destroying Python feature or its view provider 2021-02-17 12:00:38 +01:00
Chris Hennes
946e980d1a LGTM: Move seq->next out of loop control
LGTM points out that the construct use in the loop here "does
nothing" -- that is, it is a conditional whose result is never used.
It is apparently being used simply to ensure that the next() function is
called on each loop iteration, but because sequence may be null, it is
shoehorned into a trinary :? operator. To clarify the intent and ensure
that later readers (including LGTM) do not misunderstand it,
this code is broken out into a more standard conditional construct at
the end of each loop iteration.
2021-02-11 12:31:25 +01:00
Chris Hennes
ebc4cd6700 LGTM: Minor fixes to FreeCADApp.py
LGTM flagged several redundant imports, and was confused by the else
clause of one loop. This commit removes those imports, and because of
the loop's construction, removes the else entirely and lets the loop
fall through to the error state if it fails to find what it's looking
for.
2021-02-11 11:54:24 +01:00
wmayer
a30cf5b4df App: make sure to also call a feature's extensions when recomputing it 2021-02-07 17:43:36 +01:00
Zheng, Lei
c5ce992786 App: fix Link extensionGetPropertyByName()
Do not query linked object if the owner object has property with the
given name.
2021-02-07 14:49:49 +01:00
wmayer
13927b2465 [skip ci] Do not throw plain C string as exception 2021-02-06 15:52:21 +01:00
wmayer
096e538c9e App: [skip ci] use better deprecation warning as used in PR 4335 2021-01-30 17:27:08 +01:00
wmayer
756654c46e App: [skip ci] print deprecation warning if addExtension() has two arguments 2021-01-30 17:20:43 +01:00
Stefan Tröger
446ce21517 Remove ExtensionProxy and rely on default Python proxy for extensions. fixes #0004534 2021-01-30 16:00:48 +01:00
Abdullah Tahiri
305fb03c0d App/Gui: New restoreError Document status and Gui pop-up
========================================================

If the restore of Document.xml results in invalid Document.xml (because unhandled exceptions occurred), the
document status Document::restoreError is set. The GUI or Mod/Web if a link was clicked, show a pop-up indicating
this situation.

This commit also shows an appropriate pop-up for the partialRestore when opening from the menu, that before only
appeared when opening by clicking a link.
2021-01-24 16:43:20 +01:00
Zheng, Lei
9c6e918493 App: auto create Origin in OriginGroup if copied without dependency 2021-01-24 11:56:10 +01:00
Yorik van Havre
33ec7fb3e7 Merge pull request #4275 from realthunder/FixGetPartOf
App: fix Part::getPartOfObject()
2021-01-14 12:53:20 +01:00
Zheng, Lei
74de3aebee App: fix Part::getPartOfObject()
Exclude link broght in by expressions
2021-01-12 09:45:59 +08:00
Markus Lampert
8fbbfb29d8 Expose PropertyEnumeration values list to python. 2020-12-31 20:06:02 -08:00
wmayer
0f31c87cc9 Boost: [skip ci] Fix build warnings from deprecated Boost headers (v1.75) 2020-12-29 15:34:25 +01:00
Mateusz Skowroński
2559f2d29c Fix build warnings from deprecated Boost headers (they are used internally by Boost). Thanks @wwmayer for the hint. 2020-12-29 10:20:53 +01:00
luz paz
472168fc15 Fix typos [skip ci]
Typos ffound via `codespell v2.1.dev0`  
Also includes fixes in deprecated code of `src/Mod/Assembly`
2020-12-28 23:14:04 +01:00
luz paz
cb58706e80 Fix various typos [skip ci]
Found via `codespell v2.1.dev0`  
```
codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,apoints,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,connexion,currenty,dof,doubleclick,dum,eiter,elemente,ende,feld,finde,findf,freez,hist,iff,indicies,initialisation,initialise,initialised,initialises,initialisiert,ist,kilometre,lod,mantatory,methode,metres,millimetre,modell,nd,noe,normale,normaly,nto,numer,oder,orgin,orginx,orginy,ot,pard,pres,programm,que,recurrance,rougly,seperator,serie,sinc,strack,substraction,te,thist,thru,tread,uint,unter,vertexes,wallthickness,whitespaces -S ./.git,*.po,*.ts,./ChangeLog.txt,./src/3rdParty,./src/Mod/Assembly/App/opendcm,./src/CXX,./src/zipios++,./src/Base/swig*,./src/Mod/Robot/App/kdl_cp,./src/Mod/Import/App/SCL,./src/WindowsInstaller,./src/Doc/FreeCAD.uml
```
2020-12-12 08:07:47 +01:00
wmayer
c76afc56e8 App: [skip ci] in addition to PR4104 pop the diagnostic 2020-12-04 17:11:22 +01:00
Mark O'Donovan
c1475c9820 Suppress gcc warnings also in FeaturePythonPyImp.h
Clang warnings are already disabled.
2020-12-04 17:09:06 +01:00
wmayer
c54deee146 Py2/Qt4: fix build failures and warnings 2020-11-30 19:05:37 +01:00
wmayer
de07c92361 Py2: do not open Init[Gui].py files with utf-8 encoding 2020-11-26 00:48:28 +01:00
wmayer
6b2b6a4868 PyCXX: [skip ci] fix compiler warnings due to changes on PyCXX 2020-11-25 16:52:46 +01:00
donovaly
9dc45340a9 [App] get rid of MSCV compiler warning
the same as in https://github.com/FreeCAD/FreeCAD/pull/4053
2020-11-25 09:51:40 +01:00
wmayer
27ee19c1f7 Init: [skip ci] do explicitly open Init[Gui].py files with utf-8 encoding 2020-11-24 14:15:26 +01:00
Zheng, Lei
0a6b7dad41 App: fix ObjectIdentifier::relativeTo()
Fixes realthunder/FreeCAD_Assembly3#328
2020-11-22 18:07:12 +01:00
luz paz
bfdffb50be App: Fix header uniformity, trailing whitespace, and doxygen headers 2020-11-19 13:38:37 +01:00
wmayer
e2b58bf3d5 App: simplify the logic in PropertyLinkList::getPyValue 2020-11-18 18:21:15 +01:00
Chris Hennes
031619db27 Modify PropertyLinkList to accept None from Python. 2020-11-18 18:11:11 +01:00
wmayer
82beefa98d Win32: [skip ci] DLL resolution in Python 3.8 on Windows has changed 2020-11-14 16:38:02 +01:00
wmayer
b5608611a4 App: [skip ci] expose functions to Python to get status string of a feature and whether it's valid 2020-11-12 15:46:40 +01:00
wmayer
b7f9e351c5 Win: [skip ci] check if NOMINMAX is already defined before setting it 2020-11-11 13:34:42 +01:00
wmayer
59c50053a6 MSVC: [skip ci] make working with C++17 compiler 2020-11-09 16:13:34 +01:00
M G Berberich
6d1b292280 [PartDesign] Dynamic hole cut-types
‣ Make countersink and counterbore on metric holes freely definable by user.

‣ Fixed the Naming of M1.6, M2, M2.5 and M3.5

‣ Added constructor for custom enums from Enums to PropertyEnumeration

‣ Put definitions of cut-types (counterbore/countersink) for
  screwtypes into json-files for easy modification.

‣ Allow users to put its own definitions in json-files in
  [UserDir]/Mod/PartDesign/Resources/Hole

‣ Contains several examples of cut-type definition json-files that are
  propably not production-ready.

This uses a local copy of nlohmann::json¹ to read json-files.

__________
¹ This is a very nice,header-only C++ library under the MIT License
  (https://github.com/nlohmann/json). I copied the single-file-version
  and the forward-declaration-header into …/PartDesign/App/ so no new
  dependencies arise.
2020-10-31 12:49:00 +01:00
wmayer
73ba306169 App: [skip ci] fix printing warning for recursive calls of Document::_commitTransaction 2020-10-23 20:50:23 +02:00
wmayer
cda1205c3e App: [skip ci] fix possible segmentation fault when performing a transaction after an undo 2020-10-23 19:47:33 +02:00
wmayer
a29d834bd3 App: [skip ci] fix PropertyEnumeration::setEnums to avoid to produce index values out of range 2020-10-19 16:09:57 +02:00
wmayer
01af171a31 macOS: [skip ci] suppress some more Py3.8 warnings, suppress warnings about deprecated OpenGL API 2020-10-17 23:53:47 +02:00