|
|
|
@ -1,7 +1,7 @@
|
|
|
|
|
|
|
|
|
|
# dbus-1-tqt-example
|
|
|
|
|
|
|
|
|
|
PoC to discuss around https://mirror.git.trinitydesktop.org/gitea/TDE/dbus-1-tqt/issues/3 5 7 9 11
|
|
|
|
|
PoC to discuss around dbus-1-tqt dbusxml2qt3
|
|
|
|
|
|
|
|
|
|
All examples are based on the example in dbus-1-tqt for a service providing method "ListSorter".
|
|
|
|
|
In examples 4d and 4e below the service is calles "org.example.Service".
|
|
|
|
@ -15,21 +15,21 @@ Another standard DBus service "org.freedesktop.DBus.ObjectManager" is placed uns
|
|
|
|
|
In example 4f we show how service "org.example.Service" from example 4d is used asynchronously.
|
|
|
|
|
The async use of a service has the advantage of non blocking in GUI context.
|
|
|
|
|
|
|
|
|
|
####Overview####
|
|
|
|
|
## Overview ##
|
|
|
|
|
|
|
|
|
|
#####Build:#####
|
|
|
|
|
### Build: ###
|
|
|
|
|
```
|
|
|
|
|
git clone https://mirror.git.trinitydesktop.org/gitea/deloptes/dbus-1-tqt-example
|
|
|
|
|
cd dbus-1-tqt-example/4<example>
|
|
|
|
|
bash ../build_4<example>.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#####Run:#####
|
|
|
|
|
### Run: ###
|
|
|
|
|
```
|
|
|
|
|
./tqdbusexample
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#####Test for example 4d and 4e:#####
|
|
|
|
|
### Test for example 4d and 4e: ###
|
|
|
|
|
```
|
|
|
|
|
dbus-send --print-reply --session --dest=org.example.Service / \
|
|
|
|
|
org.freedesktop.DBus.Introspectable.Introspect
|
|
|
|
@ -56,7 +56,7 @@ method return time=1571079832.192439 sender=:1.42 -> destination=:1.46 serial=8
|
|
|
|
|
boolean true
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
#####Test for example 4f:#####
|
|
|
|
|
### Test for example 4f: ###
|
|
|
|
|
```
|
|
|
|
|
dbus-send --print-reply --session --dest=org.example.Service1 / \
|
|
|
|
|
org.freedesktop.DBus.Introspectable.Introspect
|
|
|
|
@ -101,7 +101,7 @@ Output: a, b, c, d, x
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#####Test for example 50:#####
|
|
|
|
|
### Test for example 50: ###
|
|
|
|
|
```
|
|
|
|
|
dbus-send --print-reply --session --dest=org.example.service / \
|
|
|
|
|
org.freedesktop.DBus.Introspectable.Introspect
|
|
|
|
@ -134,9 +134,9 @@ dbus-send --print-reply --session --dest=org.example.service \
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
####Detailed overview####
|
|
|
|
|
## Detailed overview ##
|
|
|
|
|
|
|
|
|
|
#####Generate code example 4d#####
|
|
|
|
|
### Generate code example 4d ###
|
|
|
|
|
|
|
|
|
|
There is only one definitions "test1.xml". Just run ```dbusxml2qt3 test1.xml``` and implement.
|
|
|
|
|
|
|
|
|
@ -157,7 +157,7 @@ serviceProxy.h
|
|
|
|
|
test1.xml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######create main.cpp and the service implementation "testservice"######
|
|
|
|
|
#### create main.cpp and the service implementation "testservice" ####
|
|
|
|
|
|
|
|
|
|
Content of the directory
|
|
|
|
|
|
|
|
|
@ -179,26 +179,26 @@ testservice.cpp
|
|
|
|
|
testservice.h
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######build######
|
|
|
|
|
#### build ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ bash ../build_4d.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######run######
|
|
|
|
|
#### run ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./tqdbusexample
|
|
|
|
|
Requesting name 'org.example.Service' successfull
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######test######
|
|
|
|
|
#### test ####
|
|
|
|
|
|
|
|
|
|
See test section in Overview
|
|
|
|
|
|
|
|
|
|
#####Generate code example 4e#####
|
|
|
|
|
### Generate code example 4e ###
|
|
|
|
|
|
|
|
|
|
######generate root node######
|
|
|
|
|
#### generate root node ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
# will generate only the root node
|
|
|
|
@ -238,7 +238,7 @@ serviceProxy.cpp
|
|
|
|
|
serviceProxy.h
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######create main.cpp and the service implementation "testservice"######
|
|
|
|
|
#### create main.cpp and the service implementation "testservice" ####
|
|
|
|
|
|
|
|
|
|
Content of the directory
|
|
|
|
|
|
|
|
|
@ -267,24 +267,24 @@ testservice.cpp
|
|
|
|
|
testservice.h
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######build######
|
|
|
|
|
#### build ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ bash ../build_4e.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######run######
|
|
|
|
|
#### run ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./tqdbusexample
|
|
|
|
|
Requesting name 'org.example.Service' successfull
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######test######
|
|
|
|
|
#### test ####
|
|
|
|
|
|
|
|
|
|
See test section in Overview
|
|
|
|
|
|
|
|
|
|
#####Generate code example 4f#####
|
|
|
|
|
### Generate code example 4f ###
|
|
|
|
|
|
|
|
|
|
There is only one definitions "test1.xml". Just run ```dbusxml2qt3 test1.xml``` and implement.
|
|
|
|
|
|
|
|
|
@ -305,7 +305,7 @@ serviceNode.h
|
|
|
|
|
test1.xml
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######create main.cpp and the service implementation "testservice"######
|
|
|
|
|
#### create main.cpp and the service implementation "testservice" ####
|
|
|
|
|
|
|
|
|
|
Content of the directory
|
|
|
|
|
|
|
|
|
@ -327,24 +327,24 @@ testservice.cpp
|
|
|
|
|
testservice.h
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######build######
|
|
|
|
|
#### build ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ bash ../build_4f.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######run######
|
|
|
|
|
#### run ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./tqdbusexample
|
|
|
|
|
Requesting name 'org.example.Service1' successfull
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######test######
|
|
|
|
|
#### test ####
|
|
|
|
|
|
|
|
|
|
See test section in Overview
|
|
|
|
|
|
|
|
|
|
#####Generate code example 50#####
|
|
|
|
|
### Generate code example 50 ###
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ dbusxml2qt3 org.example.service.xml
|
|
|
|
@ -464,7 +464,7 @@ serviceNode.h
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######create main.cpp and the service implementations "testservice"######
|
|
|
|
|
#### create main.cpp and the service implementations "testservice" ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
main.cpp
|
|
|
|
@ -473,19 +473,20 @@ testservice.h
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######build######
|
|
|
|
|
#### build ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ bash ../build_50.sh
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######run######
|
|
|
|
|
#### run ####
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
$ ./tqdbusexample
|
|
|
|
|
[2020/02/22 21:19:54.621] Requesting name 'org.example.service' successfull
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
######test######
|
|
|
|
|
#### test ####
|
|
|
|
|
|
|
|
|
|
See test section in Overview
|
|
|
|
|
|
|
|
|
|