Browse Source

Fix DBus file dialog for Gtk/GNOME

Signed-off-by: falkTX <falktx@falktx.com>
pull/351/head
falkTX 3 years ago
parent
commit
d290ac2fe0
Signed by: falkTX <falktx@falktx.com> GPG Key ID: CDBAA37ABC74FBA0
1 changed files with 19 additions and 2 deletions
  1. +19
    -2
      distrho/extra/FileBrowserDialog.cpp

+ 19
- 2
distrho/extra/FileBrowserDialog.cpp View File

@@ -473,12 +473,29 @@ bool fileBrowserIdle(const FileBrowserHandle handle)
DBusMessageIter dict;
dbus_message_iter_recurse(&dictArray, &dict);

// start with the string "uris"
// look for dict with string "uris"
DISTRHO_SAFE_ASSERT_BREAK(dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_STRING);

const char* key = nullptr;
dbus_message_iter_get_basic(&dict, &key);
DISTRHO_SAFE_ASSERT_BREAK(key != nullptr && std::strcmp(key, "uris") == 0);
DISTRHO_SAFE_ASSERT_BREAK(key != nullptr);

// keep going until we find it
while (std::strcmp(key, "uris") != 0)
{
key = nullptr;
dbus_message_iter_next(&dictArray);
DISTRHO_SAFE_ASSERT_BREAK(dbus_message_iter_get_arg_type(&dictArray) == DBUS_TYPE_DICT_ENTRY);

dbus_message_iter_recurse(&dictArray, &dict);
DISTRHO_SAFE_ASSERT_BREAK(dbus_message_iter_get_arg_type(&dict) == DBUS_TYPE_STRING);

dbus_message_iter_get_basic(&dict, &key);
DISTRHO_SAFE_ASSERT_BREAK(key != nullptr);
}

if (key == nullptr)
break;

// then comes variant
dbus_message_iter_next(&dict);


Loading…
Cancel
Save