comaps/comaps
42
1.9k
Fork
You've already forked comaps
161

[desktop] Stop stripping scheme from URIs #4276

Merged
pastk merged 1 commit from noahgitsham/comaps:main into main 2026年06月05日 15:01:02 +02:00
Contributor
Copy link

Fixes #3610.

Previously, clicking the URI on Linux produced this error:

xdg-open: file 'www.*' does not exist.

xdg-open expects URIs to start with a scheme (http:// or https://) for them to be opened in a browser, otherwise it treats them as file paths.

Was there a specific reason they were previously being stripped, other than to make the link look "cleaner"?
I'd argue that it's valuable to know if a link is using TLS before clicking on it.

I removed the stripSchemeFromURI function entirely, since it was unused elsewhere, and was not generic to any URI which isn't http(s).

Fixes #3610. Previously, clicking the URI on Linux produced this error: ``` xdg-open: file 'www.*' does not exist. ``` `xdg-open` expects URIs to start with a scheme (http:// or https://) for them to be opened in a browser, otherwise it treats them as file paths. Was there a specific reason they were previously being stripped, other than to make the link look "cleaner"? I'd argue that it's valuable to know if a link is using TLS before clicking on it. I removed the stripSchemeFromURI function entirely, since it was unused elsewhere, and was not generic to any URI which isn't http(s).
Stop stripping scheme from URIs
Some checks failed
DCO / check (pull_request) Failing after 4s
Linux Check / Linux no unity build (pull_request) Failing after 15m21s
Linux Check / Linux builds and tests (pull_request) Failing after 15m17s
d55910a74d
Stripping them meant that xdg-open could not open them in browsers
noahgitsham changed title from (削除) Stop stripping scheme from URIs (削除ここまで) to [desktop] Stop stripping scheme from URIs 2026年05月16日 21:57:32 +02:00
Author
Contributor
Copy link

I just realised that the URIs are stripped on mobile too. I personally prefer having more information even if it looks less "clean", but can understand both perspectives.
Should I attempt to unstrip the mobile URIs too, or fix the stripped desktop URIs?

I just realised that the URIs are stripped on mobile too. I personally prefer having more information even if it looks less "clean", but can understand both perspectives. Should I attempt to unstrip the mobile URIs too, or fix the stripped desktop URIs?
Contributor
Copy link

Welcome to the community and thanks for your first contribution on the project 😀
We will try to review the PR soon
Can you sign your commit like explained here?

Welcome to the community and thanks for your first contribution on the project 😀 We will try to review the PR soon Can you sign your commit like explained [here](https://codeberg.org/comaps/comaps/src/branch/main/docs/CONTRIBUTING.md#submitting-your-changes)?
jeanbaptisteC 2026年05月23日 07:22:34 +02:00

Diff looks good to me, needs DCO (which should fix the tests unless there are real errors)

Diff looks good to me, needs DCO (which should fix the tests unless there are real errors)
Owner
Copy link

@noahgitsham wrote in #4276 (comment):

Was there a specific reason they were previously being stripped, other than to make the link look "cleaner"?
I'd argue that it's valuable to know if a link is using TLS before clicking on it.

Some people might want to know it indeed, but its kind of special interest info nowadays, most people won't care and would prefer a "cleaner" url.

Is it possible to make it display a short/clean version, but resort to a full one when its clicked so that opening works?

@noahgitsham wrote in https://codeberg.org/comaps/comaps/pulls/4276#issue-5112267: > Was there a specific reason they were previously being stripped, other than to make the link look "cleaner"? > I'd argue that it's valuable to know if a link is using TLS before clicking on it. Some people might want to know it indeed, but its kind of special interest info nowadays, most people won't care and would prefer a "cleaner" url. Is it possible to make it display a short/clean version, but resort to a full one when its clicked so that opening works?
Owner
Copy link

@pastk wrote in #4276 (comment):

Is it possible to make it display a short/clean version, but resort to a full one when its clicked so that opening works?

Should be easily possible, the code already uses explicit html <a href=

label->setText(QString::fromStdString("<a href=\"" + value + "\">" + value + "</a>"));

So just strip scheme from the displayed part.

Also there might be cases where url initially comes without a scheme? (I think it could be tagged this way in OSM) Then we'll need to prepend a default https://?

@pastk wrote in https://codeberg.org/comaps/comaps/pulls/4276#issuecomment-16299929: > Is it possible to make it display a short/clean version, but resort to a full one when its clicked so that opening works? Should be easily possible, the code already uses explicit html `<a href=` ``` label->setText(QString::fromStdString("<a href=\"" + value + "\">" + value + "</a>")); ``` So just strip scheme from the displayed part. Also there might be cases where url initially comes without a scheme? (I think it could be tagged this way in OSM) Then we'll need to prepend a default `https://`?

Also there might be cases where url initially comes without a scheme? (I think it could be tagged this way in OSM) Then we'll need to prepend a default https://?

This probably belongs in core though

> Also there might be cases where url initially comes without a scheme? (I think it could be tagged this way in OSM) Then we'll need to prepend a default https://? This probably belongs in core though
Owner
Copy link

Or in the generator even.
But in fact Android and iOS apps work just fine with scheme-less urls, it seems to be an issue when its used with xdg-open only, so fixing in Qt client makes sense.

Or in the generator even. But in fact Android and iOS apps work just fine with scheme-less urls, it seems to be an issue when its used with xdg-open only, so fixing in Qt client makes sense.
pastk left a comment
Copy link

Its an improvement as is.

Follow-up PRs for a better versions are welcome.

Its an improvement as is. Follow-up PRs for a better versions are welcome.
Sign in to join this conversation.
No reviewers
Labels
Clear labels
accessibility
Visual contrast, screen readers, etc.
addresses
Related to addresses, post codes, city/town/village borders
AI-assisted
AI-assisted PRs or issues
Android
Android app
Android Auto
Android Auto integration
Android Automotive
Android Automotive app
api
Deeplinks and URLs handled by the API
app stores
Google Play, App Store, F-Droid, Obtanium, Huawei Gallery, Acressent, Flathub, IzzyOnDroid, etc.
battery & performance
Performance and battery consumption-related problems and optimisations
borders
Related to borders between countries / regions
bug
Something is not working
build
building of apps
CarPlay
CarPlay integration
community
Community relations
contribution welcome
Contributions are very welcome, get started here
core
C++ core of the app
crash
Crash reporting
cycling
Specific to using a bicycle or similar vehicles
desktop
Qt desktop app incl. designer
devops
directions
Voice and visual turn-by-turn directions
docs
Documentation
downloader
Map downloader
drape
The C++ map rendering engine
driving
Specific to driving a car or similar vehicles
duplicate
This issue or pull request already exists
editor
Built-in OSM editor
elevation
Contour lines, elevation profiles, ...
enhancement
New feature
EPIC
A big idea or a piece of work that requires a lot of effort to implement
F-Droid
F-Droid platform
favorites
Places and GPS tracks
feature parity
A feature is implemented on one platform, but not on another
fonts
Fonts
good first issue
Interested in contributing? Get started here
help wanted
Need some help
icons
Map features icons
invalid
Something is wrong
iOS
iOS app
legal
Legal aspects
linux phone
LibreM, PinePhone and other mobile linuxes
location
Via GPS, network, etc.
macOS
Emulated iOS App or Qt Desktop App specifically related to macOS
map data
Related to OpenStreetMap data
mapgen needed
map generation is needed for PR to take full effect
maps compat
compatibility of newer maps with older apps; issues and PRs breaking or fixing compatibility
maps generator
Maps generator
navigation
The navigation turn-by-turn app mode
need feedback
Further information is requested
needs design
not planned
This is not planned at the moment
OM
Related to or references Organic Maps
opening hours
Related to Business Hours, off time, holidays, seasonal
outdoor
Hiking, backcountry cycling, 4WD, etc.
POI info
Various feature attributes usually displayed on the place page
priority
High
Seriously affects a lot of users or breaks the app severely
priority
Low
Not urgent or only happens in rare cases
priority
Medium
Happens enough to be a concern, but not app-breaking
privacy
Privacy aspects
public feedback needed
Experimental changes which requite explicit public feedback before continuing with them
public transport
Specific to public transport (busses, trams, subways, trains etc.)
question
Questions and Discussions
raw idea
Needs more discussion or to be further elaborated
refactoring
Improving the structure or simplifying the code, improving maintainability
regional
Different depending on the country or region
regression
Regression in the app
releases
Release management
route planning
Preview and plan your route
routing
Routing engine
search
Search inside of the app
security
Security improvements
source data
Related to OSM, SRTM, Tiger etc.
styles
Map styling, incl. mapping OSM tags
subway
The special subway layer
task
Internal things that have a clear way for implementation
tests
Unit tests
track recording
Track recording
traffic
Traffic information (still under development)
translations
Translations and all other kinds of localisation
TTS
Text-to-Speech
UI
User interface
UX
User experience
wait for upstream
Waiting for something to be done upstream
walking
Specific to walking
Wikipedia
Related to the embedded Wikipedia articles
Windows
Windows related
world map
The world overview map
No labels
accessibility
addresses
AI-assisted
Android
Android Auto
Android Automotive
api
app stores
battery & performance
borders
bug
build
CarPlay
community
contribution welcome
core
crash
cycling
desktop
devops
directions
docs
downloader
drape
driving
duplicate
editor
elevation
enhancement
EPIC
F-Droid
favorites
feature parity
fonts
good first issue
help wanted
icons
invalid
iOS
legal
linux phone
location
macOS
map data
mapgen needed
maps compat
maps generator
navigation
need feedback
needs design
not planned
OM
opening hours
outdoor
POI info
priority
High
priority
Low
priority
Medium
privacy
public feedback needed
public transport
question
raw idea
refactoring
regional
regression
releases
route planning
routing
search
security
source data
styles
subway
task
tests
track recording
traffic
translations
TTS
UI
UX
wait for upstream
walking
Wikipedia
Windows
world map
Milestone
Clear milestone
No items
No milestone
Projects
Clear projects
No items
No project
Assignees
Clear assignees
No assignees
4 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
comaps/comaps!4276
Reference in a new issue
comaps/comaps
No description provided.
Delete branch "noahgitsham/comaps:main"

Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?