albar965 / littlenavmap

Little Navmap is a free flight planner, navigation tool, moving map, airport search and airport information system for Flight Simulator X, Microsoft Flight Simulator 2020, Prepar3D and X-Plane.
https://albar965.github.io/littlenavmap.html
GNU General Public License v3.0
1.28k stars 164 forks source link

Whitespace before/after Whazzup File URL causes Test function to become inactive or fail #1089

Closed hdinthkld closed 7 months ago

hdinthkld commented 7 months ago

Confirmed with 2.8.12

When entering the URL for the Whazzup file URL users are unable to test the connection if there is whitespace at the beginning: image

In addition if whitespace is entered after the URL the test fails: image

Whitespace is not permitted in a URL so it would be preferred if this is automatically cleared out once the user exits the text box.

The online group I'm a member of often receives requests from users who have trouble with this.

hdinthkld commented 7 months ago

I don't program in Qt but maybe the below is of help: https://doc.qt.io/qt-5/qstring.html#trimmed

albar965 commented 7 months ago

The URL is encoded internally which results all spaces converted to '%20' (and other special characters too). Spaces inside the URL are allowed but trailing or leading should be better trimmed by LNM.

The disabled test button is already fixed in the 3.0.x beta releases.

I'll check all paths and URLs and trim them. I already use the trim function in a lot of places but there are still a few missing.