Commit Graph

108 Commits

Author SHA1 Message Date
Chris Hennes
132a1d7e55 App: PR6497 move return statement to new line 2022-03-29 12:33:37 -05:00
wmayer
749361d2f3 App: modernize C++11
* use nullptr
2022-03-23 17:29:23 +01:00
wmayer
702222b5a2 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
4ae1ca58d1 App: use forward declaration to reduce compile time 2022-03-04 17:27:53 +01:00
Uwe
c7910825a3 [App] Placement and Property: remove unused includes 2022-02-24 01:09:00 +01:00
wmayer
f147986fa9 App: Bugfix for NULL-Pointer dereference of Property->getName() 2022-01-16 14:30:51 +01:00
wmayer
d3cdd29f5e App: [skip ci] fix Property::isSame() and subclasses by first comparing the pointers directly 2022-01-07 17:09:08 +01:00
Zheng, Lei
08cdd323b6 App: add Property::isSame() API
To compare if two property contains the same content. The default
implementation in Property uses the persistense interface to save both
properties to string and compares the content. This may not work at the
moment if the property saves content in separate file or in binary.

Various properties have cheaper implementation to direct compare their
internal values.
2021-12-21 21:41:02 -07:00
Zheng, Lei
b9e72f1a7c App: fix subname encoding when saving property links 2021-11-21 23:35:40 -06:00
wmayer
0469e277ab App: add PropertyLinkSubList::addValue() to extend the list 2021-11-15 13:05:19 +01:00
wmayer
1929b4ca4a App: add PropertyLinkSubList::verifyObject() to reduce code duplication 2021-11-15 08:42:32 +01:00
Zheng, Lei
14dfae0597 App: add hiddenref() expression built-in function
Any object reference inside this function is treated as hidden to
exclude it from dependency calculation. This function allows some form
of cyclic depdenency.

Merger note: renamed from "HREF" to "HIDDENREF" to avoid confusion with
the standard "hypertext reference" use of HREF.
2021-11-14 20:45:09 -06:00
wmayer
b2475b228a App: add upgrade() method to PropertyLinkSubList 2021-11-12 07:49:44 +01:00
Zheng, Lei
fc9d3547ad App: fix external document loading
The problem happens when partial loading is enabled. If document A
contains a link to some object in document B, it will load B as partial
document with only that object and its necessary dependencies. But if
document A contains another link to some object in document C which also
has a link to some object in document B, the link in document C may not
be restored, because document B is partially loaded without the linked
object. This patch will check for this case and reload document B for
more objects.

See an example reported in
https://forum.freecadweb.org/viewtopic.php?p=495078#p495078
2021-10-30 11:03:52 +08:00
Chris Hennes
6780ded233 [App] Fix LGTM warning decl hides param 2021-09-19 12:31:24 -05:00
wmayer
1241752b94 App: [skip ci] check object status before accessing back links 2021-02-22 17:31:25 +01:00
wmayer
c54deee146 Py2/Qt4: fix build failures and warnings 2020-11-30 19:05:37 +01:00
wmayer
6b2b6a4868 PyCXX: [skip ci] fix compiler warnings due to changes on PyCXX 2020-11-25 16:52:46 +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
Zheng, Lei
18eb018a14 App: fix PropertyXLink handling on symlink file path 2020-08-31 14:05:14 +02:00
wmayer
035993c968 typos: [skip ci] 2020-08-30 14:51:55 +02:00
wmayer
bf1e8e4838 App: fix crash due to incorrect usage of std::mismatch 2020-08-22 20:25:10 +02:00
Jean-Marie Verdun
0b1af7c838 Add App::Link support to Cloud module
ONLY enabled if the Cloud Module is compiled into FreeCAD
    ALL files must be saved into a Cloud Based storage
    Add a Signal to the PropertyLink to enable support of external storage
    Put the Assembly Document as active document

Signed-off-by: Jean-Marie Verdun <jmverdun3@gmail.com>
2020-07-23 13:47:21 +02:00
wmayer
421f6c52cb Coverity: Dereference after null check 2020-07-20 17:34:25 +02:00
wmayer
d562c52fdc PVS: V571 Recurring check. A condition was already verified in previous line 2020-07-18 10:59:28 +02:00
wmayer
af9c5274b4 PVS: V688 The local variable possesses the same name as one of the class members, which can result in a confusion 2020-07-18 10:59:28 +02:00
wmayer
cbb5f99ade PVS: V730 Not all members of a class are initialized inside the constructor 2020-07-18 10:59:27 +02:00
Zheng, Lei
536051179b App/Gui: introduce temporary document
Add new argument to Application::newDocument() to create a temporary
    document. Also exposed to Python API App.newDocument() with a named
    argument 'temp'.

    The temporary document is marked with status bit 'TempDoc'. The user
    will not be prompt for saving when closing. The undo/redo is disabled.
    The AutoSaver skips it. And the tree view will not show it.
    PropertyXLink allows linking to/from object within a temporary document
    without saving.
2020-07-14 19:36:05 +02:00
wmayer
f3b460e42e boost: fix for boost < 1.60 2020-06-15 19:38:39 +02:00
wmayer
4ec45b545e boost 1.73.0: The practice of declaring the Bind placeholders (_1, _2, ...) in the global namespace is deprecated 2020-06-12 17:51:33 +02:00
Zheng, Lei
516a005ced App: fix PropertyXLinkList/SubList::getValues() 2020-06-03 14:34:20 +02:00
Zheng, Lei
e0199b3a8f App: fix PropertyXLink(Sub) python input/output 2020-06-03 14:34:20 +02:00
Zheng, Lei
7069d9abb8 App: fix lost of Link when renaming linked file 2020-04-27 11:24:29 +02:00
wandererfan
30e07229e1 [App]convenience getter for PropertyXLinkList 2020-04-14 10:24:29 -04:00
Zheng, Lei
0a608e9413 App: fix Link document restore
This fixes issue #0004224
2020-02-14 19:46:36 +01:00
Zheng, Lei
3364911d6d App: add PropertyXLinkList
PropertyXLinkList is derived from PropertyXLinkSubList, which is
modified to provide APIs compatible to PropertyLinkList.

The only difference between the two class is in their getPyObject() to
make PropertyXLinkList output similar to PropertyLinkList in Python. In
C++, both class can accept mix of objects link with or without subname,
depending on which set of APIs are used.
2020-02-11 15:40:27 -05:00
Zheng, Lei
e4a2d9fc42 App: fix PropertyXLink invalid external link 2020-02-11 15:40:27 -05:00
Zheng, Lei
e707ba8348 App: fix PropertyLinkSub(List) unicode handling 2020-02-11 15:40:27 -05:00
luz.paz
4f308dc03c src/App: [skip ci] fix header uniformity
This PR fixes header uniformity across all `src/App` files
2019-12-25 11:38:43 +01:00
asapelkin
bbbabf99ae removed useless std::move on const and unmovable objects 2019-11-21 17:49:57 +01:00
asapelkin
e951094af9 use emplace_back instead of push_back where justified 2019-11-21 14:48:09 +01:00
Zheng, Lei
b0c9325432 App: fix PropertyXLink file path saving
Also modified ProeprtyLinkItem to show file path as tooltip.
2019-11-10 11:32:59 +01:00
Zheng, Lei
71c54272a0 Fix various Py::Object leak 2019-10-08 17:53:20 +02:00
Zheng, Lei
3de3f696e3 App: fix PropertyXLink file path update 2019-10-08 10:26:03 +02:00
Zheng, Lei
4042d83362 App: allow multiple subname in PropertyXLink
PropertyXLink and PropertyXLinkSub now only differ in getPyObject().
This is to allow Link support of multiple sub-element
2019-10-08 10:20:36 +02:00
luz.paz
7b7797f4f3 Fix various (doxy) typos and whitespace issues
Found via `codespell -q 3 -L aci,ake,aline,alle,alledges,alocation,als,ang,anid,ba,beginn,behaviour,bloaded,byteorder,calculater,cancelled,cancelling,cas,cascade,centimetre,childs,colour,colours,commen,currenty,dof,doubleclick,dum,eiter,elemente,feld,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`
2019-10-03 07:57:13 +02:00
wmayer
b50b21576e core system
force strict ISO C++ (-Wpedantic)
TODO: still a lot of variadic macros are not valid ISO C++
2019-09-18 01:01:14 +02:00
Zheng, Lei
f66e7f3332 App: remove unused variable 2019-08-30 15:52:18 +02:00