diff options
author | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2022-04-08 15:13:16 +0200 |
---|---|---|
committer | Kjell Ahlstedt <kjellahlstedt@gmail.com> | 2022-04-08 15:13:16 +0200 |
commit | af947cc234c7e8c3b7514770f5fe6b5f6e718be4 (patch) | |
tree | 1de86f0064cac25a75f07416b91e273a3fcc68b8 | |
parent | 54f68a7652cca2d5393ee6e50e153e88bc502f45 (diff) | |
download | glibmm-af947cc234c7e8c3b7514770f5fe6b5f6e718be4.tar.gz |
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().
-rw-r--r-- | gio/src/tlscertificate.ccg | 11 | ||||
-rw-r--r-- | 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) |