Re: How to use Gio::DBus::Connection::signal_subscribe?



Hi
 
I am doing C++, but that function in the C++ API is obviously based on
the C API function... Well, the implementation is:

  return g_dbus_connection_signal_subscribe(gobj(), sender.c_str(),
    interface_name.c_str(), member.c_str(), object_path.c_str(), arg0.c_str(),
    static_cast<GDBusSignalFlags>(flags),
    &DBusConnection_Signal_giomm_callback, slot_copy,
    &DBusConnection_Signal_giomm_callback_destroy);

And, of course, the documentation of the C++ API is also based on the
documentation of the C API (except that NULL has been replaced with
0). But the problem is that sender.c_str() can never be NULL (but
that's what I would need to achieve).

I try to help. what I wanted to point, is in general you can't just do that... I got some issue few
weeks ago because doing that... (not in gtkmm). But ok if you check the implementation, fine.

could you try to do something like this :

  Glib::ustring *sender = 0; // or nullptr

  ...->signal_subscribe( ..., *sender, ... );


regards,
nicolas


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]