maplibre-native icon indicating copy to clipboard operation
maplibre-native copied to clipboard

Add ClientOptions to be able to pass around client name and version

Open ntadej opened this issue 2 years ago • 14 comments

Add ClientOptions to be able to pass around client name and version. The first client is Qt platform user agent setting. I can try to update other platforms that set user agent later.

The result example is

Vremenar/0.6.0 (macOS 12.4) MapLibreGL/9e31d615 (Qt 6.3.1)

Will investigate in a separate PR on how to override the git hash with a version when building a release build.

ntadej avatar Jul 09 '22 20:07 ntadej

This looks rather large. Let me know if you still want a review as you closed the PR.

rinigus avatar Jul 10 '22 06:07 rinigus

It was a mistake. Not sure what happened.

ntadej avatar Jul 10 '22 07:07 ntadej

I don't quite understand what the use case is for client option. This is not just Qt related, right?

In many places client option appears next to resource options. I wonder if we should put the information which is in client options into resource options?

wipfli avatar Jul 11 '22 12:07 wipfli

I don't quite understand what the use case is for client option. This is not just Qt related, right?

In many places client option appears next to resource options. I wonder if we should put the information which is in client options into resource options?

It is to set client metadata basically. For now Qt user agent is set based on that but I plan to update other http classes for other platforms witht that.

I did not want to put into resource options as that is specific to the resource used (so tiles settings).

ntadej avatar Jul 11 '22 12:07 ntadej

And thanks for your work @ntadej :)

wipfli avatar Jul 13 '22 06:07 wipfli

Hi @wipfli, I cleaned-up the code a bit:

  • do not use abbreviated variable names
  • set defaults in mbgl::Map and mbgl::MapSnapshotter

Regarding iOS and Android. In iOS none of the headers were changed. In Android all interface should go through Java.

ntadej avatar Jul 16 '22 11:07 ntadej

I'll try to build it for SFOS as well.

rinigus avatar Jul 16 '22 12:07 rinigus

Scratch that SFOS build - our OBS is down and not sure when I can do it.

rinigus avatar Jul 16 '22 12:07 rinigus

What is SFOS and OBS?

wipfli avatar Jul 16 '22 12:07 wipfli

SFOS - Sailfish OS - mobile Linux distro OBS - Open Build Service - set of servers that allows SFOS developers to build for a range of SFOS versions and architectures.

In the context of QMapLibreGL - SFOS is using ancient Qt (5.6) due to licensing changes introduced later. As we have some bits proprietary, company behind SFOS is reluctant to change. I am using QMapLibreGL for mapping app, hence my interest to make sure it works on older Qt as well :)

But looks like these changes are mainly on C++ part which should be fine as we have reasonably up to date gcc

rinigus avatar Jul 16 '22 12:07 rinigus

@rinigus, are there docker images with Sailfish OS? We may be able to setup some basic CI with them.

ntadej avatar Jul 16 '22 12:07 ntadej

@ntadej: there are some, but those are unofficial and I don't know how well they track SFOS releases. OBS has been a tool of choice for many of us. I'll have to look into docker SFOS images, but don't expect it soon - quite swamped right now.

rinigus avatar Jul 16 '22 12:07 rinigus

As additional note: it is surprising that a relatively simple change in client options requires so many changes. I guess it is a shortcoming of the used library design

rinigus avatar Jul 16 '22 14:07 rinigus

Hi @roblabs, as we did not have time to discuss this one, I wonder if you have an opinion. I plan to implement this also for iOS and Android in a separate PR.

ntadej avatar Aug 10 '22 18:08 ntadej