[glibmm] Slight cleanup to D-Bus example code.



commit 4b9ebee2b336928bd4c8cef30d7aab39bcc6d8b9
Author: Murray Cumming <murrayc murrayc com>
Date:   Sat Apr 2 15:35:21 2011 +0200

    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.

 ChangeLog                            |    9 ++++++++
 examples/dbus/server.cc              |   36 ----------------------------------
 examples/dbus/session_bus_service.cc |   36 ----------------------------------
 3 files changed, 9 insertions(+), 72 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index c317fd2..f9afb20 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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 da62ac2..64166d0 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 21b53c9..3a40786 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.



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