michaellukashov / Far-NetBox

SFTP/SCP/FTP/FTPS/WebDAV/S3 client for Far Manager 3 (http://farmanager.com/)
https://forum.farmanager.com/viewtopic.php?t=6317
GNU General Public License v2.0
155 stars 52 forks source link

Fix properties implementation #457

Closed ssvine closed 2 months ago

ssvine commented 2 months ago

This pull request fixes this issue

Under the hood, this pull request fixes how properties are implemented. Consider the following code, that contain assignment of one property to another:

FCommandSession->CurrentDirectory = CurrentDirectory;

This assignment is embarassing, because it doesn't do what it's supposed to do. So, the current implementation of the properties is slightly different from the C++ Builder semantics. We need to disable copy / move constructors - we don't want properties to be copied / moved. We also need to disable copy / move operators on RO properties, and disable move operator on RW properties. We should use explicit copy operator for RW properties with correct semantics, i.e. copy values instead of copying setters and getters.

sonarcloud[bot] commented 2 months ago

Quality Gate Failed Quality Gate failed

Failed conditions
B Maintainability Rating on New Code (required ≥ A)

See analysis details on SonarCloud

Catch issues before they fail your Quality Gate with our IDE extension SonarLint