Skip to content

Commit

Permalink
[dbus] Group configured methods/signals by relation. JB#49969
Browse files Browse the repository at this point in the history
After years of manual editing, method calls and signals are
listed in more or less random order.

Arrange members so that methods are listed before signals and,
in both groups related entries are next to each other.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jun 5, 2020
1 parent 66eb5fc commit 08f2c5a
Show file tree
Hide file tree
Showing 3 changed files with 57 additions and 60 deletions.
16 changes: 8 additions & 8 deletions debian/usb_moded.conf
Expand Up @@ -22,16 +22,13 @@
send_member="get_target_state"/>
<allow send_destination="com.meego.usb_moded"
send_interface="com.meego.usb_moded"
send_member="set_mode"/>
<allow send_destination="com.meego.usb_moded"
send_interface="com.meego.usb_moded"
send_member="set_config"/>
send_member="get_target_mode_config"/>
<allow send_destination="com.meego.usb_moded"
send_interface="com.meego.usb_moded"
send_member="net_config"/>
send_member="set_mode"/>
<allow send_destination="com.meego.usb_moded"
send_interface="com.meego.usb_moded"
send_member="get_net_config"/>
send_member="set_config"/>
<allow send_destination="com.meego.usb_moded"
send_interface="com.meego.usb_moded"
send_member="get_config"/>
Expand Down Expand Up @@ -64,9 +61,12 @@
send_member="set_whitelisted"/>
<allow send_destination="com.meego.usb_moded"
send_interface="com.meego.usb_moded"
send_member="rescue_off"/>
send_member="net_config"/>
<allow send_destination="com.meego.usb_moded"
send_interface="com.meego.usb_moded"
send_member="get_target_mode_config"/>
send_member="get_net_config"/>
<allow send_destination="com.meego.usb_moded"
send_interface="com.meego.usb_moded"
send_member="rescue_off"/>
</policy>
</busconfig>
50 changes: 25 additions & 25 deletions src/com.meego.usb_moded.xml
Expand Up @@ -10,6 +10,10 @@
<method name="get_target_state">
<arg name="mode" type="s" direction="out"/>
</method>
<method name="get_target_mode_config">
<arg name="config" type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
</method>
<method name="set_mode">
<arg name="mode" type="s" direction="in"/>
<arg name="mode" type="s" direction="out"/>
Expand All @@ -18,17 +22,6 @@
<arg name="config" type="s" direction="in"/>
<arg name="config" type="s" direction="out"/>
</method>
<method name="net_config">
<arg name="key" type="s" direction="in"/>
<arg name="value" type="s" direction="in"/>
<arg name="key" type="s" direction="out"/>
<arg name="value" type="s" direction="out"/>
</method>
<method name="get_net_config">
<arg name="key" type="s" direction="in"/>
<arg name="key" type="s" direction="out"/>
<arg name="value" type="s" direction="out"/>
</method>
<method name="get_config">
<arg name="mode" type="s" direction="out"/>
</method>
Expand Down Expand Up @@ -62,6 +55,17 @@
<arg name="mode" type="s" direction="in"/>
<arg name="whitelisted" type="b" direction="in"/>
</method>
<method name="net_config">
<arg name="key" type="s" direction="in"/>
<arg name="value" type="s" direction="in"/>
<arg name="key" type="s" direction="out"/>
<arg name="value" type="s" direction="out"/>
</method>
<method name="get_net_config">
<arg name="key" type="s" direction="in"/>
<arg name="key" type="s" direction="out"/>
<arg name="value" type="s" direction="out"/>
</method>
<method name="rescue_off"/>
<signal name="sig_usb_state_ind">
<arg name="mode_or_event" type="s"/>
Expand All @@ -72,36 +76,32 @@
<signal name="sig_usb_target_state_ind">
<arg name="mode" type="s"/>
</signal>
<signal name="sig_usb_taget_mode_config_ind">
<arg name="config" type="a{sv}"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
</signal>
<signal name="sig_usb_event_ind">
<arg name="event" type="s"/>
</signal>
<signal name="sig_usb_state_error_ind">
<arg name="error" type="s"/>
<signal name="sig_usb_config_ind">
<arg name="section" type="s"/>
<arg name="key" type="s"/>
<arg name="value" type="s"/>
</signal>
<signal name="sig_usb_supported_modes_ind">
<arg name="modes" type="s"/>
</signal>
<signal name="sig_usb_available_modes_ind">
<arg name="modes" type="s"/>
</signal>
<signal name="sig_usb_config_ind">
<arg name="section" type="s"/>
<arg name="key" type="s"/>
<arg name="value" type="s"/>
</signal>
<signal name="sig_usb_hidden_modes_ind">
<arg name="modes" type="s"/>
</signal>
<signal name="sig_usb_whitelisted_modes_ind">
<arg name="modes" type="s"/>
</signal>
<signal name="sig_usb_taget_mode_config_ind">
<arg name="config" type="a{sv}"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.In0" value="QVariantMap"/>
<signal name="sig_usb_state_error_ind">
<arg name="error" type="s"/>
</signal>
<method name="get_target_mode_config">
<arg name="config" type="a{sv}" direction="out"/>
<annotation name="org.qtproject.QtDBus.QtTypeName.Out0" value="QVariantMap"/>
</method>
</interface>
</node>
51 changes: 24 additions & 27 deletions src/usb_moded-dbus.c
Expand Up @@ -929,15 +929,16 @@ usb_moded_rescue_off_cb(umdbus_context_t *context)

static const member_info_t usb_moded_members[] =
{
/* FIXME: ordering here does not make sense, but minimizes
* diff with old manually updated introspect data.
*/
ADD_METHOD(USB_MODE_STATE_REQUEST,
usb_moded_state_request_cb,
" <arg name=\"mode\" type=\"s\" direction=\"out\"/>\n"),
ADD_METHOD(USB_MODE_TARGET_STATE_GET,
usb_moded_target_state_get_cb,
" <arg name=\"mode\" type=\"s\" direction=\"out\"/>\n"),
ADD_METHOD(USB_MODE_TARGET_CONFIG_GET,
usb_moded_target_config_get_cb,
" <arg name=\"config\" type=\"a{sv}\" direction=\"out\"/>\n"
" <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"QVariantMap\"/>\n"),
ADD_METHOD(USB_MODE_STATE_SET,
usb_moded_state_set_cb,
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n"
Expand All @@ -946,17 +947,6 @@ static const member_info_t usb_moded_members[] =
usb_moded_config_set_cb,
" <arg name=\"config\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"config\" type=\"s\" direction=\"out\"/>\n"),
ADD_METHOD(USB_MODE_NETWORK_SET,
usb_moded_network_set_cb,
" <arg name=\"key\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"value\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"key\" type=\"s\" direction=\"out\"/>\n"
" <arg name=\"value\" type=\"s\" direction=\"out\"/>\n"),
ADD_METHOD(USB_MODE_NETWORK_GET,
usb_moded_network_get_cb,
" <arg name=\"key\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"key\" type=\"s\" direction=\"out\"/>\n"
" <arg name=\"value\" type=\"s\" direction=\"out\"/>\n"),
ADD_METHOD(USB_MODE_CONFIG_GET,
usb_moded_config_get_cb,
" <arg name=\"mode\" type=\"s\" direction=\"out\"/>\n"),
Expand Down Expand Up @@ -990,6 +980,17 @@ static const member_info_t usb_moded_members[] =
usb_moded_whitelisted_set_cb,
" <arg name=\"mode\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"whitelisted\" type=\"b\" direction=\"in\"/>\n"),
ADD_METHOD(USB_MODE_NETWORK_SET,
usb_moded_network_set_cb,
" <arg name=\"key\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"value\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"key\" type=\"s\" direction=\"out\"/>\n"
" <arg name=\"value\" type=\"s\" direction=\"out\"/>\n"),
ADD_METHOD(USB_MODE_NETWORK_GET,
usb_moded_network_get_cb,
" <arg name=\"key\" type=\"s\" direction=\"in\"/>\n"
" <arg name=\"key\" type=\"s\" direction=\"out\"/>\n"
" <arg name=\"value\" type=\"s\" direction=\"out\"/>\n"),
ADD_METHOD(USB_MODE_RESCUE_OFF,
usb_moded_rescue_off_cb,
0),
Expand All @@ -999,29 +1000,25 @@ static const member_info_t usb_moded_members[] =
" <arg name=\"mode\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_TARGET_STATE_SIGNAL_NAME,
" <arg name=\"mode\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_TARGET_CONFIG_SIGNAL_NAME,
" <arg name=\"config\" type=\"a{sv}\"/>\n"
" <annotation name=\"org.qtproject.QtDBus.QtTypeName.In0\" value=\"QVariantMap\"/>\n"),
ADD_SIGNAL(USB_MODE_EVENT_SIGNAL_NAME,
" <arg name=\"event\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_ERROR_SIGNAL_NAME,
" <arg name=\"error\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_SUPPORTED_MODES_SIGNAL_NAME,
" <arg name=\"modes\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_AVAILABLE_MODES_SIGNAL_NAME,
" <arg name=\"modes\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_CONFIG_SIGNAL_NAME,
" <arg name=\"section\" type=\"s\"/>\n"
" <arg name=\"key\" type=\"s\"/>\n"
" <arg name=\"value\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_SUPPORTED_MODES_SIGNAL_NAME,
" <arg name=\"modes\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_AVAILABLE_MODES_SIGNAL_NAME,
" <arg name=\"modes\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_HIDDEN_MODES_SIGNAL_NAME,
" <arg name=\"modes\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_WHITELISTED_MODES_SIGNAL_NAME,
" <arg name=\"modes\" type=\"s\"/>\n"),
ADD_SIGNAL(USB_MODE_TARGET_CONFIG_SIGNAL_NAME,
" <arg name=\"config\" type=\"a{sv}\"/>\n"
" <annotation name=\"org.qtproject.QtDBus.QtTypeName.In0\" value=\"QVariantMap\"/>\n"),
ADD_METHOD(USB_MODE_TARGET_CONFIG_GET,
usb_moded_target_config_get_cb,
" <arg name=\"config\" type=\"a{sv}\" direction=\"out\"/>\n"
" <annotation name=\"org.qtproject.QtDBus.QtTypeName.Out0\" value=\"QVariantMap\"/>\n"),
ADD_SIGNAL(USB_MODE_ERROR_SIGNAL_NAME,
" <arg name=\"error\" type=\"s\"/>\n"),
ADD_SENTINEL
};

Expand Down

0 comments on commit 08f2c5a

Please sign in to comment.