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 misbehaviour when connecting a session with an empty hostname #476

Closed ssvine closed 1 month ago

ssvine commented 1 month ago

When a saved session has an empty hostname, connecting to such a session brings up a session edit dialog (to fill missing parameters), but this dialog is not based on the saved session data. Also, pressing Cancel in this popped up dialog does not prevent connection, but pressing Ok prevents connection.

This PR makes this fixes/changes:

  1. Use the real session data instead of an empty one
  2. Pressing Cancel prevents connection
  3. Pressing Ok acts the same as Connect if hostname is not empty, otherwise it prevents connection
  4. Clean redundant code
sonarcloud[bot] commented 1 month ago

Quality Gate Passed Quality Gate passed

Issues
2 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud