Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QDBus path encoding
Qt 6.11 is out! See what's new in the release blog

QDBus path encoding

Scheduled Pinned Locked Moved Unsolved General and Desktop
qdbus
4 Posts 2 Posters 975 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • C Offline
    C Offline
    Chruetli
    wrote on last edited by
    #1

    Hi

    I'm moving from libsystemd-dev to QDBus. I have to get the state of a customer service called "application-ui.service". Du to the special characters I had to use sd_bus_path_encode to encode the path. This results in "application_2dui_2eservice".
    Is there an equivalent method in Qt available?

    Best regards
    Mario

    C 1 Reply Last reply
    0
    • C Chruetli

      Hi

      I'm moving from libsystemd-dev to QDBus. I have to get the state of a customer service called "application-ui.service". Du to the special characters I had to use sd_bus_path_encode to encode the path. This results in "application_2dui_2eservice".
      Is there an equivalent method in Qt available?

      Best regards
      Mario

      C Offline
      C Offline
      Chruetli
      wrote on last edited by
      #2

      @Chruetli no one stumbled across this problem?

      1 Reply Last reply
      0
      • SGaistS Offline
        SGaistS Offline
        SGaist
        Lifetime Qt Champion
        wrote on last edited by
        #3

        Hi,

        One would likely use QString::replace once for each char you want to replace or this overload with a QRegularExpression.

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply
        1
        • C Offline
          C Offline
          Chruetli
          wrote on last edited by
          #4

          Thank you for the answer. Honestly I expected this as some kind of magic done in background...
          At the moment I will use the sd_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 called bus_label_escape.

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved