[glibmm] Gio::TlsCertificate: Fix the create*() methods
- From: Kjell Ahlstedt <kjellahl src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glibmm] Gio::TlsCertificate: Fix the create*() methods
- Date: Fri, 8 Apr 2022 13:47:33 +0000 (UTC)
commit af947cc234c7e8c3b7514770f5fe6b5f6e718be4
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date: Fri Apr 8 15:13:16 2022 +0200
Gio::TlsCertificate: Fix the create*() methods
Don't call constructors that don't work because the g_tls_certificate_new_*()
functions do more than just call g_object_new().
gio/src/tlscertificate.ccg | 11 -----------
gio/src/tlscertificate.hg | 20 +++++++++++---------
2 files changed, 11 insertions(+), 20 deletions(-)
---
diff --git a/gio/src/tlscertificate.ccg b/gio/src/tlscertificate.ccg
index 3cb4910c..b6240c9a 100644
--- a/gio/src/tlscertificate.ccg
+++ b/gio/src/tlscertificate.ccg
@@ -17,14 +17,3 @@
#include <gio/gio.h>
#include <glibmm/bytearray.h>
#include <giomm/socketconnectable.h>
-
-namespace Gio
-{
-
-Glib::RefPtr<TlsCertificate>
-TlsCertificate::create_from_pem(const std::string& data, gssize length)
-{
- return Glib::make_refptr_for_instance<TlsCertificate>(new TlsCertificate(data, length));
-}
-
-} // namesapce Gio
diff --git a/gio/src/tlscertificate.hg b/gio/src/tlscertificate.hg
index b9ea6ef7..ddb7c7e1 100644
--- a/gio/src/tlscertificate.hg
+++ b/gio/src/tlscertificate.hg
@@ -48,20 +48,22 @@ class GIOMM_API TlsCertificate : public Glib::Object
_CLASS_GOBJECT(TlsCertificate, GTlsCertificate, G_TLS_CERTIFICATE, Glib::Object, GObject, , , GIOMM_API)
protected:
+ //TODO: These constructors don't work. Delete them when we can break ABI and API.
+ // There are no properties with the same names as the parameters.
+ // _WRAP_CTOR() is not useful here anyway. See the next comment.
_WRAP_CTOR(TlsCertificate(const std::string& data, gssize length), g_tls_certificate_new_from_pem,
errthrow)
_WRAP_CTOR(TlsCertificate(const std::string& file), g_tls_certificate_new_from_file, errthrow)
_WRAP_CTOR(TlsCertificate(const std::string& cert_file, const std::string& key_file),
g_tls_certificate_new_from_files, errthrow)
public:
- _WRAP_METHOD_DOCS_ONLY(g_tls_certificate_new_from_pem)
- static Glib::RefPtr<TlsCertificate>
- create_from_pem(const std::string& data, gssize length = -1);
-
- _WRAP_METHOD_DOCS_ONLY(g_tls_certificate_new_from_file)
- _WRAP_CREATE(const std::string& file)
-
- _WRAP_METHOD_DOCS_ONLY(g_tls_certificate_new_from_files)
- _WRAP_CREATE(const std::string& cert_file, const std::string& key_file)
+ // We can't use _WRAP_CTOR() and _WRAP_CREATE() because all the
+ // g_tls_certificate_new_*() functions do more than just call g_object_new().
+ _WRAP_METHOD(static Glib::RefPtr<TlsCertificate> create_from_pem(const std::string& data, gssize length =
-1),
+ g_tls_certificate_new_from_pem, errthrow)
+ _WRAP_METHOD(static Glib::RefPtr<TlsCertificate> create(const std::string& file),
+ g_tls_certificate_new_from_file, errthrow)
+ _WRAP_METHOD(static Glib::RefPtr<TlsCertificate> create(const std::string& cert_file, const std::string&
key_file),
+ g_tls_certificate_new_from_files, errthrow)
#m4 _CONVERSION(`GList*', `std::vector< Glib::RefPtr<TlsCertificate> >', `Glib::ListHandler<
Glib::RefPtr<TlsCertificate> >::list_to_vector($3, Glib::OWNERSHIP_DEEP)')
_WRAP_METHOD(static std::vector< Glib::RefPtr<TlsCertificate> > create_list_from_file(const std::string&
file), g_tls_certificate_list_new_from_file, errthrow)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]