dlr-gtlab / gtlab-core

GTlab Core Framework
https://www.gtlab.de
Other
7 stars 2 forks source link

Added project dir to package read/save api #1259

Closed rainman110 closed 1 month ago

rainman110 commented 2 months ago

Closes #617

Description

ABI CHANGE

@mariusalexander I quickly adapted locally the intelligraph package to test this. Seems to be working. Please still have a look!

How Has This Been Tested?

Locally, with an adapted intelligraph.

Checklist:

rainman110 commented 2 months ago

@mariusalexander & @real-ct-ac Note, that we now must adapt the code of all modules using the package API.

This is a bit nasty, since we actually wanted to avoid this with the 2.1 release. The changes are minimal though but still required. Relying on the currentProject()->projectPath workaround is evil and should be erased in the long term.

Update: I think I have a better idea to overcome an API change. We add different function

These can be used, whenever non-xml files should be saved / read.

mariusalexander commented 1 month ago

Update: I think I have a better idea to overcome an API change. We add different function

  • saveToProjectDir
    • readFromProjectDir

These can be used, whenever non-xml files should be saved / read.

So these functions ar now saveMiscData and readMiscData? I like the new API. It is a clever yet simple fix

rainman110 commented 1 month ago

So these functions ar now saveMiscData and readMiscData? I like the new API. It is a clever yet simple fix

Correct. These functions should be used, when data should be read/saved that are not part of the xml document tree.

mariusalexander commented 1 month ago

Actually, I found a bug. The readMiscData and saveMiscData were not called if readData or saveData returned true. I had to change the operator && to ||.

rainman110 commented 1 month ago

@mariusalexander This will be our first, true merged 2.1 MR :D

mariusalexander commented 1 month ago

@mariusalexander This will be our first, true merged 2.1 MR :D

Pioneers!