(message), )
/* dbus-misc.h */
-DEFINEFUNC(void , dbus_get_version , (int *major_version_p,
- int *minor_version_p,
- int *micro_version_p),
- (major_version_p, minor_version_p, micro_version_p), )
DEFINEFUNC(char* , dbus_get_local_machine_id , (void), (), return)
/* dbus-thread.h */
DEFINEFUNC(dbus_bool_t , dbus_threads_init_default, (), (), return)
-
-/* D-Bus 1.4 symbols */
-#if !defined(QT_LINKED_LIBDBUS) || (DBUS_VERSION >= 0x010400)
-DEFINEFUNC(dbus_bool_t , dbus_connection_can_send_type , (DBusConnection *connection,
- int type),
- (connection, type), return)
-#endif
-
QT_END_NAMESPACE
#endif // QT_NO_DBUS
static QDBusConnection::ConnectionCapabilities connectionCapabilies(DBusConnection *connection)
{
QDBusConnection::ConnectionCapabilities result = 0;
+ typedef dbus_bool_t (*can_send_type_t)(DBusConnection *, int);
+ static can_send_type_t can_send_type = 0;
-#if defined(QT_LINKED_LIBDBUS) && DBUS_VERSION < 0x010400
- // no capabilities are possible
+#if defined(QT_LINKED_LIBDBUS)
+# if DBUS_VERSION-0 >= 0x010400
+ can_send_type = dbus_connection_can_send_type;
+# endif
#else
-# if !defined(QT_LINKED_LIBDBUS)
// run-time check if the next functions are available
- int major, minor, micro;
- q_dbus_get_version(&major, &minor, µ);
- if (major == 1 && minor < 4)
- return result;
-# endif
+ can_send_type = (can_send_type_t)qdbus_resolve_conditionally("dbus_connection_can_send_type");
+#endif
#ifndef DBUS_TYPE_UNIX_FD
# define DBUS_TYPE_UNIX_FD int('h')
#endif
- if (q_dbus_connection_can_send_type(connection, DBUS_TYPE_UNIX_FD))
+ if (can_send_type && can_send_type(connection, DBUS_TYPE_UNIX_FD))
result |= QDBusConnection::UnixFileDescriptorPassing;
-#endif
return result;
}