QDBus path encoding
Unsolved
General and Desktop
-
Hi
I'm moving from
libsystemd-dev
toQDBus
. I have to get the state of a customer service called "application-ui.service
". Du to the special characters I had to usesd_bus_path_encode
to encode the path. This results in "application_2dui_2eservice
".
Is there an equivalent method in Qt available?Best regards
Mario -
Hi,
One would likely use QString::replace once for each char you want to replace or this overload with a QRegularExpression.
-
Thank you for the answer. Honestly I expected this as some kind of magic done in background...
At the moment I will use thesd_bus_path_encode
function.
The source of the function can be found at https://github.com/systemd/systemd/blob/main/src/basic/bus-label.c calledbus_label_escape
.