c - GDBus 相当于 dbus_connection_setup_with_g_main()

标签 c glib dbus bus gdbus

我正在将代码从 dbus-glib 迁移到 GDBus,因为前者已弃用。 我无法在 GDBus 中找到 dbus_connection_setup_with_g_main() 的等效函数。 https://dbus.freedesktop.org/doc/dbus-glib/dbus-glib-DBus-GLib-low-level.html#dbus-connection-setup-with-g-main

有人能给我指出 GDBus 中的等效函数或执行类似工作的函数吗?

最佳答案

不完全相同,但您可以使用 g_main_context_push_thread_default()如果您需要更改当前运行线程的默认上下文。

如果这不是您想要做的,您可能需要稍微扩展一下问题。

关于c - GDBus 相当于 dbus_connection_setup_with_g_main(),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56788812/

相关文章:

c++ - 使用 QT/C++ 中的 DBUS 连接到新的 Bluez HDP 插件

c++ - "pragma pack 1"是否有助于避免堆碎片?

检查矩阵的行是否在 O(1) 时间内充满 1

c - libwebsockets 教程问题 : ‘libwebsocket_internal_extensions’ undeclared and error: too many arguments to function ‘libwebsocket_create_context’

c - DBus同步调用超时

c - 如何将数据从 GHashTable 存储到 C 中的结构

gstreamer - 如何从 gstreamer 中检索错误消息? (C API)

python - Dbus.Array(从 python 读取 pidgin 消息)

python - libvlc 和 dbus 接口(interface)

c - 写入分配的字符缓冲区