diff options
author | José Alburquerque <jaalburqu@svn.gnome.org> | 2012-09-18 01:36:46 -0400 |
---|---|---|
committer | José Alburquerque <jaalburqu@svn.gnome.org> | 2012-09-18 15:16:49 -0400 |
commit | 415d91884cd3300f3cb6836f4b7fdc5364e734b3 (patch) | |
tree | 779283f027ac17c8140c918af11395d542b0d733 | |
parent | de9decf59b525dff4ef4e65bb982343a180f68ac (diff) | |
download | glibmm-415d91884cd3300f3cb6836f4b7fdc5364e734b3.tar.gz |
Revert 'Gio::DBus::Connection: Add'
-rw-r--r-- | ChangeLog | 11 | ||||
-rw-r--r-- | gio/src/dbusconnection.ccg | 70 | ||||
-rw-r--r-- | gio/src/dbusconnection.hg | 80 | ||||
-rw-r--r-- | tools/m4/convert_gio.m4 | 1 |
4 files changed, 26 insertions, 136 deletions
@@ -82,17 +82,6 @@ rename delete to remove, because the sync vesion would be delete(), which uses a C++ keyword. -2012-09-16 Murray Cumming <murrayc@murrayc.com> - - Gio::DBus::Connection: Add - - * gio/src/dbusconnection.[hg|ccg]: Add call(), call_with_unix_fd_finish(), - and call_finishcall_sync() method overloads that wrap - g_dbus_connection_call_with_unix_fd_list(), - g_dbus_connection_call_with_unix_fd_list_finish() and - g_dbus_connection_call_with_unix_fd_list_sync() - * tools/m4/convert_gio.m4: Add a necessary conversion. - 2012-09-15 Murray Cumming <murrayc@murrayc.com> Simplified lots of code by using the {?} _WRAP_METHOD() syntax. diff --git a/gio/src/dbusconnection.ccg b/gio/src/dbusconnection.ccg index 5ae3ef41..930097e0 100644 --- a/gio/src/dbusconnection.ccg +++ b/gio/src/dbusconnection.ccg @@ -725,6 +725,9 @@ Glib::VariantContainerBase Connection::call_sync( return Glib::VariantContainerBase(gvariant, false); //Dont' take an extra reference. } +//TODO: Re-add the following two methods when the call_finish() method with a +//UnixFDList exists. +#if 0 #ifdef G_OS_LINUX // With a UnixFDList. void Connection::call( @@ -738,7 +741,8 @@ void Connection::call( const Glib::ustring& bus_name, int timeout_msec, CallFlags flags, - const Glib::VariantType& reply_type) + const Glib::VariantType& reply_type +) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -763,7 +767,8 @@ void Connection::call( const Glib::ustring& bus_name, int timeout_msec, CallFlags flags, - const Glib::VariantType& reply_type) + const Glib::VariantType& reply_type +) { // Create a copy of the slot. // A pointer to it will be passed through the callback's data parameter @@ -777,6 +782,7 @@ void Connection::call( 0, &SignalProxy_async_callback, slot_copy); } #endif // G_OS_LINUX +#endif // 0 void Connection::emit_signal( const Glib::ustring& object_path, @@ -878,66 +884,6 @@ guint Connection::register_subtree(const Glib::ustring& object_path, return result; } - -Glib::VariantContainerBase Connection::call_sync(const Glib::ustring& object_path, const Glib::ustring& interface_name, const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<UnixFDList>& fd_list, Glib::RefPtr<UnixFDList>& out_fd_list, const Glib::ustring& bus_name, int timeout_msec, CallFlags flags, const Glib::VariantType& reply_type) -{ - GError* gerror = 0; - GUnixFDList* cunixfdlist = 0; - Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_connection_call_with_unix_fd_list_sync(gobj(), bus_name.c_str(), object_path.c_str(), interface_name.c_str(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), (reply_type).gobj(), ((GDBusCallFlags)(flags)), timeout_msec, Glib::unwrap(fd_list), &cunixfdlist, const_cast<GCancellable*>(Glib::unwrap(cancellable)), &(gerror)), false); - - if(cunixfdlist) - out_fd_list = Glib::wrap(cunixfdlist); - - if(gerror) - ::Glib::Error::throw_exception(gerror); - - return retvalue; - -} - -Glib::VariantContainerBase Connection::call_sync(const Glib::ustring& object_path, const Glib::ustring& interface_name, const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<UnixFDList>& fd_list, Glib::RefPtr<UnixFDList>& out_fd_list, const Glib::ustring& bus_name, int timeout_msec, CallFlags flags, const Glib::VariantType& reply_type) -{ - GError* gerror = 0; - GUnixFDList* cunixfdlist = 0; - Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_connection_call_with_unix_fd_list_sync(gobj(), bus_name.c_str(), object_path.c_str(), interface_name.c_str(), method_name.c_str(), const_cast<GVariant*>((parameters).gobj()), (reply_type).gobj(), ((GDBusCallFlags)(flags)), timeout_msec, Glib::unwrap(fd_list), &cunixfdlist, 0, &(gerror)), false); - - if(cunixfdlist) - out_fd_list = Glib::wrap(cunixfdlist); - - if(gerror) - ::Glib::Error::throw_exception(gerror); - - return retvalue; - -} - -Glib::VariantContainerBase Connection::call_with_unix_fd_finish(const Glib::RefPtr<AsyncResult>& res, Glib::RefPtr<UnixFDList>& out_fd_list) -{ - GError* gerror = 0; - GUnixFDList* cunixfdlist = 0; - Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_connection_call_with_unix_fd_list_finish(gobj(), &cunixfdlist, Glib::unwrap(res), &(gerror)), false); - - if(cunixfdlist) - out_fd_list = Glib::wrap(cunixfdlist); - - if(gerror) - ::Glib::Error::throw_exception(gerror); - - - return retvalue; -} - -Glib::VariantContainerBase Connection::call_with_unix_fd_finish(const Glib::RefPtr<AsyncResult>& res) -{ - GError* gerror = 0; - Glib::VariantContainerBase retvalue = Glib::VariantContainerBase(g_dbus_connection_call_with_unix_fd_list_finish(gobj(), 0, Glib::unwrap(res), &(gerror)), false); - - if(gerror) - ::Glib::Error::throw_exception(gerror); - - return retvalue; -} - } //namespace DBus } // namespace Gio diff --git a/gio/src/dbusconnection.hg b/gio/src/dbusconnection.hg index 1be60e7c..d4ab3cda 100644 --- a/gio/src/dbusconnection.hg +++ b/gio/src/dbusconnection.hg @@ -732,16 +732,13 @@ public: const Glib::VariantType& reply_type = Glib::VariantType() ); +// TODO: Re-add the following two methods when the call_finish() method with a +// UnixFDList is wrapped. +#if 0 #ifdef G_OS_LINUX /** Like call() but also takes a GUnixFDList object. * This method is only available on UNIX. * - * This is an asynchronous method. When the operation is finished, callback - * will be invoked in the thread-default main loop of the thread you are - * calling this method from. You can then call call_with_unix_fd_finish() to get the - * result of the operation. See call_sync() for the synchronous version of - * this function. - * * @param object_path Path of remote object. * @param interface_name D-Bus interface to invoke method on. * @param method_name The name of the method to invoke. @@ -756,7 +753,7 @@ public: * timeout or G_MAXINT for no timeout. * @param flags Flags from the Gio::DBus::CallFlags enumeration. * @param reply_type The expected type of the reply, or <tt>0</tt>. - * @newin{2,34} + * @newin{2,32} */ void call( const Glib::ustring& object_path, @@ -771,11 +768,9 @@ public: CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType() ); - _IGNORE(g_dbus_connection_call_with_unix_fd_list) + _IGNORE(g_dbus_connection_call_with_uinx_fd_list) - /** A non-cancellable version of call() (with a UnixFDList). - * @newin{2,34} - */ + /// A non-cancellable version of call() (with a UnixFDList). void call( const Glib::ustring& object_path, const Glib::ustring& interface_name, @@ -789,27 +784,18 @@ public: const Glib::VariantType& reply_type = Glib::VariantType() ); #endif // G_OS_LINUX - - - //We do not use _WRAP_METHOD() because it cannot (yet) handle the out_fd_list output parameter: - //_WRAP_METHOD(Glib::VariantContainerBase call_with_unix_fd_finish(const Glib::RefPtr<AsyncResult>& res{.}, Glib::RefPtr<UnixFDList>& out_fd_list{.?}), g_dbus_connection_call_with_unix_fd_list_finish, errthrow) - - /** Finishes an operation started with call() (with a UnixFDList). - * @param res A AsyncResult obtained from the SlotAsyncReady passed to - * call(). - * @result A Variant tuple with return values. - * @throw Glib::Error. - * @newin{2,32} - */ - Glib::VariantContainerBase call_with_unix_fd_finish(const Glib::RefPtr<AsyncResult>& res, Glib::RefPtr<UnixFDList>& out_fd_list); - - /// A call_with_unix_fd_finish() convenience overload. - Glib::VariantContainerBase call_with_unix_fd_finish(const Glib::RefPtr<AsyncResult>& res); - _IGNORE(g_dbus_connection_call_with_unix_fd_list_finish) - - - //We do not use _WRAP_METHOD() because it cannot (yet) handle the out_fd_list output parameter: - /* +#endif // 0 + + ///** Finishes an operation started with call() (with a UnixFDList). + //* @param res A AsyncResult obtained from the SlotAsyncReady passed to + //* call(). + //* @result A Variant tuple with return values. + //* @throw Glib::Error. + //* @newin{2,32} + //*/ + //TODO: _WRAP_METHOD(Glib::VariantContainerBase call_with_unix_fd_finish(const Glib::RefPtr<AsyncResult>& res{.}, Glib::RefPtr<UnixFDList>& out_fd_list{.?}), g_dbus_connection_call_with_unix_fd_list_finish, errthrow) + + /* TODO: _WRAP_METHOD( Glib::VariantContainerBase call_sync( const Glib::ustring& object_path{.}, @@ -828,36 +814,6 @@ public: ) */ - /** Like call_sync() but also takes and returns UnixFDList objects. - * - * This method is only available on UNIX. - * - * @newin{2,34} - * @param bus_name A unique or well-known bus name. - * @param object_path Path of remote object. - * @param interface_name D-Bus interface to invoke method on. - * @param method_name The name of the method to invoke. - * @param parameters A Variant tuple with parameters for the method - * or <tt>0</tt> if not passing parameters. - * @param reply_type The expected type of the reply, or <tt>0</tt>. - * @param flags Flags from the DBusCallFlags enumeration. - * @param timeout_msec The timeout in milliseconds, -1 to use the default - * timeout or MAXINT for no timeout. - * @param fd_list A UnixFDList or <tt>0</tt>. - * @param out_fd_list Return location for a UnixFDList or <tt>0</tt>. - * @param cancellable A Cancellable or <tt>0</tt>. - * @return <tt>0</tt> if @a error is set. Otherwise a Variant tuple with - * return values. Free with Glib::variant_unref(). - */ - Glib::VariantContainerBase call_sync(const Glib::ustring& object_path, const Glib::ustring& interface_name, const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<Cancellable>& cancellable, const Glib::RefPtr<UnixFDList>& fd_list, Glib::RefPtr<UnixFDList>& out_fd_list, const Glib::ustring& bus_name = Glib::ustring(), int timeout_msec = -1, CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType()); - - /** A call_sync() convenience overload. - * @newin{2,34} - */ - Glib::VariantContainerBase call_sync(const Glib::ustring& object_path, const Glib::ustring& interface_name, const Glib::ustring& method_name, const Glib::VariantContainerBase& parameters, const Glib::RefPtr<UnixFDList>& fd_list, Glib::RefPtr<UnixFDList>& out_fd_list, const Glib::ustring& bus_name = Glib::ustring(), int timeout_msec = -1, CallFlags flags = Gio::DBus::CALL_FLAGS_NONE, const Glib::VariantType& reply_type = Glib::VariantType()); - _IGNORE(g_dbus_connection_call_with_unix_fd_list_sync) - - /** Emits a signal. * * This can only fail if @a parameters is not compatible with the D-Bus diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4 index 4ae5d9f8..e8a67805 100644 --- a/tools/m4/convert_gio.m4 +++ b/tools/m4/convert_gio.m4 @@ -7,7 +7,6 @@ _CONV_ENUM(G,ConverterResult) _CONV_ENUM(G,CredentialsType) _CONV_ENUM(G,DataStreamByteOrder) _CONV_ENUM(G,DataStreamNewlineType) -_CONV_ENUM(GDBus,CallFlags) _CONV_ENUM(GDBus,CapabilityFlags) _CONV_ENUM(GDBus,MessageFlags) _CONV_ENUM(GDBus,MessageHeaderField) |