diff options
author | Murray Cumming <murrayc@murrayc.com> | 2011-04-02 15:35:21 +0200 |
---|---|---|
committer | Murray Cumming <murrayc@murrayc.com> | 2011-04-02 15:35:21 +0200 |
commit | 4b9ebee2b336928bd4c8cef30d7aab39bcc6d8b9 (patch) | |
tree | 5141ba898ce72615351cedfcc27c17f84314754a | |
parent | 15288eecbacb6aa545886eeb3d5a34c62441fcc2 (diff) | |
download | glibmm-4b9ebee2b336928bd4c8cef30d7aab39bcc6d8b9.tar.gz |
Slight cleanup to D-Bus example code.
* examples/dbus/server.cc:
* examples/dbus/session_bus_service.cc: Remove code to handle the now
non-existant GetStdOut D-Bus method. That code was left over from an earlier
version of an example.
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | examples/dbus/server.cc | 36 | ||||
-rw-r--r-- | examples/dbus/session_bus_service.cc | 36 |
3 files changed, 9 insertions, 72 deletions
@@ -1,5 +1,14 @@ 2011-04-02 Murray Cumming <murrayc@murrayc.com> + Slight cleanup to D-Bus example code. + + * examples/dbus/server.cc: + * examples/dbus/session_bus_service.cc: Remove code to handle the now + non-existant GetStdOut D-Bus method. That code was left over from an earlier + version of an example. + +2011-04-02 Murray Cumming <murrayc@murrayc.com> + Gio::DBus::NodeInfo::lookup_interface(): Add a method overload with no name. * gio/src/dbusintrospection.[hg|ccg]: Add a lookup_interface() method overload diff --git a/examples/dbus/server.cc b/examples/dbus/server.cc index da62ac2d..64166d0f 100644 --- a/examples/dbus/server.cc +++ b/examples/dbus/server.cc @@ -99,42 +99,6 @@ static void on_method_call(const Glib::RefPtr<Gio::DBus::Connection>& connection invocation->return_error(error); } } - else if(method_name == "GetStdout") - { -#ifndef G_OS_WIN32 - if(connection->get_capabilities() & - Gio::DBus::CAPABILITY_FLAGS_UNIX_FD_PASSING) - { - Glib::RefPtr<Gio::UnixFDList> list = Gio::UnixFDList::create(); - try - { - list->append(STDOUT_FILENO); - - Glib::RefPtr<Gio::DBus::Message> reply = - Gio::DBus::Message::create_method_reply(invocation->get_message()); - - reply->set_unix_fd_list(list); - - connection->send_message(reply); - } - catch(const Glib::Error& ex) - { - std::cerr << "Error trying to send stdout to client: " << ex.what() << - std::endl; - return; - } - } - else - { - invocation->return_dbus_error("org.glibmm.DBus.Failed", "Your message " - "bus daemon does not support file descriptor passing (need D-Bus >= " - "1.3.0)"); - } -#else - invocation->return_dbus_error("org.glibmm.DBus.Failed", "Your message bus " - "daemon does not support file descriptor passing (need D-Bus >= 1.3.0)"); -#endif - } else { // Non-existent method on the interface. diff --git a/examples/dbus/session_bus_service.cc b/examples/dbus/session_bus_service.cc index 21b53c91..3a407869 100644 --- a/examples/dbus/session_bus_service.cc +++ b/examples/dbus/session_bus_service.cc @@ -97,42 +97,6 @@ static void on_method_call(const Glib::RefPtr<Gio::DBus::Connection>& connection invocation->return_error(error); } } - else if(method_name == "GetStdout") - { -#ifndef G_OS_WIN32 - if(connection->get_capabilities() & - Gio::DBus::CAPABILITY_FLAGS_UNIX_FD_PASSING) - { - Glib::RefPtr<Gio::UnixFDList> list = Gio::UnixFDList::create(); - try - { - list->append(STDOUT_FILENO); - - Glib::RefPtr<Gio::DBus::Message> reply = - Gio::DBus::Message::create_method_reply(invocation->get_message()); - - reply->set_unix_fd_list(list); - - connection->send_message(reply); - } - catch(const Glib::Error& ex) - { - std::cerr << "Error trying to send stdout to client: " << ex.what() << - std::endl; - return; - } - } - else - { - invocation->return_dbus_error("org.glibmm.DBusExample.Failed", "Your message " - "bus daemon does not support file descriptor passing (need D-Bus >= " - "1.3.0)"); - } -#else - invocation->return_dbus_error("org.glibmm.DBusExample.Failed", "Your message bus " - "daemon does not support file descriptor passing (need D-Bus >= 1.3.0)"); -#endif - } else { // Non-existent method on the interface. |