Results 1 to 2 of 2

Thread: Problem in Qt DBus (register service name for system bus connection)

  1. #1
    Join Date
    Apr 2012
    Posts
    2
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem in Qt DBus (register service name for system bus connection)

    Dear all

    I try the Qt4.7 DBus example, including :

    - chat room example
    - remote car example

    using the code and project setting provided with Qt. Session bus is used in both examples, and they work well. But now I would like to change the session bus into system bus, by changing the line : QDBusConnection::sessionBus() into QDBusConnection::systemBus() only, while keeping the rest unchanged. However it doesnt work now. By tracking the programme line by line, I find that it fails to invoke : registerService("xxx.yyy.zzz"). Can anyone help to solve the problem? Does it involve the system bus permission in linux?

    thank you very much
    best regards
    k.t.

  2. #2
    Join Date
    Sep 2012
    Posts
    1
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Problem in Qt DBus (register service name for system bus connection)

    Old post but I was stuck with the same problem, so for anyone else interested the solution is you need to create a DBus policy conf.

    For example:

    /etc/dbus-1/system.d/org.kde.foohelper.conf

    Qt Code:
    1. <!DOCTYPE busconfig PUBLIC
    2. "-//freedesktop//DTD D-BUS Bus Configuration 1.0//EN"
    3. "http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd">
    4. <busconfig>
    5.  
    6. <!-- Only user root can own the foo helper -->
    7. <policy user="root">
    8. <allow own="org.kde.foohelper"/>
    9. </policy>
    10.  
    11. <!-- Allow anyone to call into the service - we'll reject callers using PolicyKit -->
    12. <policy context="default">
    13. <allow send_interface="org.kde.foohelper"/>
    14. <allow receive_sender="org.kde.foohelper"/>
    15. <allow receive_interface="org.kde.foohelper"/>
    16. </policy>
    17.  
    18. </busconfig>
    To copy to clipboard, switch view to plain text mode 

    http://techbase.kde.org/Development/...us_policy_file

    http://dbus.freedesktop.org/doc/dbus-daemon.1.html#lbAF

Similar Threads

  1. Cannot register Service name on System Bus
    By drf in forum Qt Programming
    Replies: 1
    Last Post: 19th April 2012, 02:44
  2. Replies: 1
    Last Post: 17th November 2010, 13:58
  3. Register Qt application as operation system toolbar
    By Matriarch in forum Qt Programming
    Replies: 0
    Last Post: 22nd September 2009, 11:59
  4. DBus service name
    By charlesf in forum Qt Programming
    Replies: 6
    Last Post: 4th May 2009, 07:53
  5. DBus connection
    By Nitz in forum Qt Programming
    Replies: 2
    Last Post: 25th January 2009, 14:43

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.