Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
aea6d354
Commit
aea6d354
authored
Jun 03, 2018
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
lib/dbus/ObjectManager: use TypeTraits instead of CPP macro
parent
d3793dfe
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
22 deletions
+15
-22
ObjectManager.hxx
src/lib/dbus/ObjectManager.hxx
+13
-20
UdisksNeighborPlugin.cxx
src/neighbor/plugins/UdisksNeighborPlugin.cxx
+2
-2
No files found.
src/lib/dbus/ObjectManager.hxx
View file @
aea6d354
...
...
@@ -21,35 +21,28 @@
#define ODBUS_OBJECT_MANAGER_HXX
#include "ReadIter.hxx"
#include "Types.hxx"
#include <dbus/dbus.h>
#define DBUS_OM_INTERFACE "org.freedesktop.DBus.ObjectManager"
#define DBUS_OM_PROPERTIES_SIGNATURE \
DBUS_TYPE_ARRAY_AS_STRING \
DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_STRING_AS_STRING \
DBUS_TYPE_VARIANT_AS_STRING \
DBUS_DICT_ENTRY_END_CHAR_AS_STRING
namespace
ODBus
{
#define DBUS_OM_INTERFACES_SIGNATURE \
DBUS_TYPE_ARRAY_AS_STRING \
DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING \
DBUS_TYPE_STRING_AS_STRING \
DBUS_OM_PROPERTIES_SIGNATURE \
DBUS_DICT_ENTRY_END_CHAR_AS_STRING
using
PropertiesType
=
ArrayTypeTraits
<
DictEntryTypeTraits
<
StringTypeTraits
,
VariantTypeTraits
>>
;
#define DBUS_OM_INTERFACES_ADDED_SIGNATURE \
DBUS_TYPE_OBJECT_PATH_AS_STRING \
DBUS_OM_INTERFACES_SIGNATURE
using
InterfacesType
=
ArrayTypeTraits
<
DictEntryTypeTraits
<
StringTypeTraits
,
PropertiesType
>>
;
#define DBUS_OM_INTERFACES_REMOVED_SIGNATURE \
DBUS_TYPE_OBJECT_PATH_AS_STRING \
DBUS_TYPE_ARRAY_AS_STRING \
DBUS_TYPE_STRING_AS_STRING
using
InterfacesAddedType
=
ConcatTypeAsString
<
ObjectPathTypeTraits
,
InterfacesType
>
;
namespace
ODBus
{
using
InterfacesRemovedType
=
ConcatTypeAsString
<
ObjectPathTypeTraits
,
ArrayTypeTraits
<
StringTypeTraits
>>
;
template
<
typename
F
>
inline
void
...
...
src/neighbor/plugins/UdisksNeighborPlugin.cxx
View file @
aea6d354
...
...
@@ -353,7 +353,7 @@ UdisksNeighborExplorer::HandleMessage(DBusConnection *, DBusMessage *message) no
if
(
dbus_message_is_signal
(
message
,
DBUS_OM_INTERFACE
,
"InterfacesAdded"
)
&&
dbus_message_has_signature
(
message
,
DBUS_OM_INTERFACES_ADDED_SIGNATURE
))
{
dbus_message_has_signature
(
message
,
InterfacesAddedType
::
value
))
{
RecurseInterfaceDictEntry
(
ReadMessageIter
(
*
message
),
[
this
](
const
char
*
path
,
auto
&&
i
){
UdisksObject
o
(
path
);
if
(
ParseObject
(
o
,
std
::
move
(
i
))
&&
o
.
IsValid
())
...
...
@@ -363,7 +363,7 @@ UdisksNeighborExplorer::HandleMessage(DBusConnection *, DBusMessage *message) no
return
DBUS_HANDLER_RESULT_HANDLED
;
}
else
if
(
dbus_message_is_signal
(
message
,
DBUS_OM_INTERFACE
,
"InterfacesRemoved"
)
&&
dbus_message_has_signature
(
message
,
DBUS_OM_INTERFACES_REMOVED_SIGNATURE
))
{
dbus_message_has_signature
(
message
,
InterfacesRemovedType
::
value
))
{
Remove
(
ReadMessageIter
(
*
message
).
GetString
());
return
DBUS_HANDLER_RESULT_HANDLED
;
}
else
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment