[glibmm] UnixSocketAddress: Correct the wrapping of create() methods.



commit 61d3f7d345df46d5ef8439cab8217e4cd1b296f3
Author: José Alburquerque <jaalburqu svn gnome org>
Date:   Sun Nov 7 20:57:43 2010 -0500

    	UnixSocketAddress: Correct the wrapping of create() methods.
    
    	* gio/src/unixsocketaddress.hg: Remove the multi-parameter constructor
    	and create() method, handwriting the create() method instead to wrap
    	g_unix_socket_address_new_with_type() because the C function does more
    	than call g_object_new().
    
    	* gio/src/filelist.am: Typo.

 ChangeLog                     |   11 +++++++++++
 gio/src/filelist.am           |    2 +-
 gio/src/unixsocketaddress.ccg |    7 +++++++
 gio/src/unixsocketaddress.hg  |   18 ++++++++++++++++--
 4 files changed, 35 insertions(+), 3 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 88b24de..1066344 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
 2010-11-07  José Alburquerque  <jaalburqu svn gnome org>
 
+	UnixSocketAddress: Correct the wrapping of create() methods.
+
+	* gio/src/unixsocketaddress.hg: Remove the multi-parameter constructor
+	and create() method, handwriting the create() method instead to wrap
+	g_unix_socket_address_new_with_type() because the C function does more
+	than call g_object_new().
+
+	* gio/src/filelist.am: Typo.
+
+2010-11-07  José Alburquerque  <jaalburqu svn gnome org>
+
 	giomm: Add UnixSocketAddress.
 
 	* tools/extra_defs_gen/generate_defs_gio.cc:
diff --git a/gio/src/filelist.am b/gio/src/filelist.am
index b85a219..4a96daa 100644
--- a/gio/src/filelist.am
+++ b/gio/src/filelist.am
@@ -94,7 +94,7 @@ giomm_files_posix_hg =			\
 	desktopappinfo.hg		\
 	unixconnection.hg		\
 	unixcredentialsmessage.hg \
-	unixfdlist.hg\
+	unixfdlist.hg \
 	unixfdmessage.hg \
 	unixinputstream.hg		\
 	unixoutputstream.hg \
diff --git a/gio/src/unixsocketaddress.ccg b/gio/src/unixsocketaddress.ccg
index 07d2dd8..3c2eb1c 100644
--- a/gio/src/unixsocketaddress.ccg
+++ b/gio/src/unixsocketaddress.ccg
@@ -22,4 +22,11 @@
 namespace Gio
 {
 
+Glib::RefPtr<UnixSocketAddress>
+UnixSocketAddress::create(const std::string& path, UnixSocketAddressType type,
+  int path_len)
+{
+  return Glib::wrap(reinterpret_cast<GUnixSocketAddress*>(g_unix_socket_address_new_with_type(path.c_str(), path_len, static_cast<GUnixSocketAddressType>(type))));
+}
+
 } //namespace Gio
diff --git a/gio/src/unixsocketaddress.hg b/gio/src/unixsocketaddress.hg
index 8527885..68c0e6e 100644
--- a/gio/src/unixsocketaddress.hg
+++ b/gio/src/unixsocketaddress.hg
@@ -49,11 +49,25 @@ class UnixSocketAddress
   _CLASS_GOBJECT(UnixSocketAddress, GUnixSocketAddress, G_UNIX_SOCKET_ADDRESS, SocketAddress, GSocketAddress)
 
 protected:
- _WRAP_CTOR(UnixSocketAddress(const std::string& path, int path_len = -1, UnixSocketAddressType type = Gio::UNIX_SOCKET_ADDRESS_PATH), g_unix_socket_address_new_with_type)
+ _WRAP_CTOR(UnixSocketAddress(const std::string& path), g_unix_socket_address_new)
+
+ //TODO: Possibly add when g_unix_socket_address_new_with_type() does not do
+ //more than call g_object_new() (maybe file a bug).
+ //_WRAP_CTOR(UnixSocketAddress(const std::string& path, int path_len = -1, UnixSocketAddressType type = Gio::UNIX_SOCKET_ADDRESS_PATH), g_unix_socket_address_new_with_type)
 
 public:
+ _WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new)
+ _WRAP_CREATE(const std::string& path)
+
+ //TODO: Add when the above constructor is included, removing the handwritten
+ //create() method for it below.
+ //_WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new_with_type)
+ //_WRAP_CREATE(const std::string& path, int path_len = -1, UnixSocketAddressType type = Gio::UNIX_SOCKET_ADDRESS_PATH)
+
  _WRAP_METHOD_DOCS_ONLY(g_unix_socket_address_new_with_type)
- _WRAP_CREATE(const std::string& path, int path_len = -1, UnixSocketAddressType type = Gio::UNIX_SOCKET_ADDRESS_PATH)
+ static Glib::RefPtr<UnixSocketAddress> create(const std::string& path,
+   UnixSocketAddressType type = Gio::UNIX_SOCKET_ADDRESS_ABSTRACT,
+   int path_len = -1);
 
  // Deprecated.
  _IGNORE(g_unix_socket_address_get_is_abstract)



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