Skip to content

Commit 59e47a6

Browse files
committed
Update to use KeysValues
1 parent 623cb7c commit 59e47a6

File tree

1 file changed

+20
-16
lines changed

1 file changed

+20
-16
lines changed

src/core/linux/SDL_dbus.c

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -637,22 +637,19 @@ int SDL_DBus_StartLocation(void)
637637
goto failure;
638638
}
639639

640-
/* Dictionnary with session_handle_token */
641640
dbus.message_iter_init_append(msg, &iterInit);
642-
if (!SDL_DBus_AppendDictWithKeyValue(&iterInit, "session_handle_token", session_handle_token)) {
643-
goto failure;
644-
}
645-
#if 0
646-
/* optional */
647-
if (!SDL_DBus_AppendDictWithKeyValue(&iterInit, "distance-threshold", "0")) {
648-
goto failure;
649-
}
650641

651-
/* optional */
652-
if (!SDL_DBus_AppendDictWithKeyValue(&iterInit, "time-threshold", "0")) {
653-
goto failure;
642+
/* a{sv} */
643+
{
644+
const char *keys[1];
645+
const char *values[1];
646+
keys[0] = "session_handle_token";
647+
values[0] = session_handle_token;
648+
if (!SDL_DBus_AppendDictWithKeysValues(&iterInit, keys, values, 1)) {
649+
goto failure;
650+
}
654651
}
655-
#endif
652+
656653
if (SDL_DBus_CallWithBasicReply(dbus.session_conn, msg, DBUS_TYPE_OBJECT_PATH, &session_path)) {
657654
session_path = SDL_strdup(session_path);
658655
} else {
@@ -699,10 +696,17 @@ int SDL_DBus_StartLocation(void)
699696
goto failure;
700697
}
701698

702-
/* Dictionnary with handle_token */
703699
dbus.message_iter_init_append(msg, &iterInit);
704-
if (!SDL_DBus_AppendDictWithKeyValue(&iterInit, "handle_token", handle_token)) {
705-
goto failure;
700+
701+
/* a{sv} */
702+
{
703+
const char *keys[1];
704+
const char *values[1];
705+
keys[0] = "handle_token";
706+
values[0] = handle_token;
707+
if (!SDL_DBus_AppendDictWithKeysValues(&iterInit, keys, values, 1)) {
708+
goto failure;
709+
}
706710
}
707711

708712
if (SDL_DBus_CallWithBasicReply(dbus.session_conn, msg, DBUS_TYPE_OBJECT_PATH, &request_path)) {

0 commit comments

Comments
 (0)