[glibmm] Glib, Gio: Add some methods for glibmm 2.70



commit a4dba878ffa79c044b16eeb9172fcdc8818925f4
Author: Kjell Ahlstedt <kjellahlstedt gmail com>
Date:   Tue Oct 5 10:57:19 2021 +0200

    Glib, Gio: Add some methods for glibmm 2.70
    
    * configure.ac:
    * meson.build: Require glib-2.0 >= 2.69.1.
    * glib/src/binding.[ccg|hg]: Add dup_source(), dup_target(),
    Deprecate get_source(), get_target().
    * glib/src/spawn.[ccg|hg]: Change parameter name, exit_status to wait_status.
    * glib/src/timezone.[ccg|hg]: Add operator bool(), create_identifier().
    Deprecate create().
    * gio/src/fileinfo.hg: Add get/set_access_date(), get/set_creation_date().
    * gio/src/notification.hg: Add set_category().
    * gio/src/tlscertificate.hg: Add property/get_not_valid_before(),
    property/get_not_valid_after(), property/get_subject_name(),
    property/get_issuer_name().
    * gio/src/tlsconnection.hg: Add enum Gio::TlsProtocolVersion,
    property/get_protocol_version(), property/get_ciphersuite_name().
    * tools/m4/convert_gio.m4: Add conversion for enum TlsProtocolVersion.

 configure.ac              |  2 +-
 gio/src/fileinfo.hg       |  5 +++
 gio/src/notification.hg   |  1 +
 gio/src/tlscertificate.hg | 10 ++++++
 gio/src/tlsconnection.hg  |  6 ++++
 glib/src/binding.ccg      | 32 +++----------------
 glib/src/binding.hg       | 81 +++++++++++++----------------------------------
 glib/src/spawn.ccg        | 12 +++----
 glib/src/spawn.hg         | 24 +++++++-------
 glib/src/timezone.ccg     | 10 ++----
 glib/src/timezone.hg      | 19 ++++++-----
 meson.build               |  9 +++++-
 tools/m4/convert_gio.m4   |  1 +
 13 files changed, 90 insertions(+), 122 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 593af2bb..bdfc16c8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -83,7 +83,7 @@ AS_IF([test "x$enable_static" = xyes],
   AC_DEFINE([GIOMM_STATIC_LIB],  [1], [Define if giomm is built as a static library])
 ])
 
-glibreq='2.0 >= 2.63.0'
+glibreq='2.0 >= 2.69.1'
 
 GLIBMM_MODULES="sigc++-3.0 >= 3.0.0 glib-$glibreq gobject-$glibreq gmodule-$glibreq"
 GIOMM_MODULES="$GLIBMM_MODULES gio-$glibreq"
diff --git a/gio/src/fileinfo.hg b/gio/src/fileinfo.hg
index 043b37bb..62e487b2 100644
--- a/gio/src/fileinfo.hg
+++ b/gio/src/fileinfo.hg
@@ -167,6 +167,8 @@ public:
   _WRAP_METHOD(goffset get_size() const, g_file_info_get_size)
 
   _WRAP_METHOD(Glib::DateTime get_modification_date_time() const, g_file_info_get_modification_date_time)
+  _WRAP_METHOD(Glib::DateTime get_access_date_time() const, g_file_info_get_access_date_time)
+  _WRAP_METHOD(Glib::DateTime get_creation_date_time() const, g_file_info_get_creation_date_time)
 
   _WRAP_METHOD(std::string get_symlink_target() const, g_file_info_get_symlink_target)
 
@@ -196,6 +198,9 @@ public:
   _WRAP_METHOD(void set_size(goffset size), g_file_info_set_size)
 
   _WRAP_METHOD(void set_modification_date_time(const Glib::DateTime& mtime), 
g_file_info_set_modification_date_time)
+  _WRAP_METHOD(void set_access_date_time(const Glib::DateTime& atime), g_file_info_set_access_date_time)
+  _WRAP_METHOD(void set_creation_date_time(const Glib::DateTime& creation_time), 
g_file_info_set_creation_date_time)
+
   _WRAP_METHOD(void set_symlink_target(const std::string& symlink_target), g_file_info_set_symlink_target)
   _WRAP_METHOD(void set_sort_order(gint32 sort_order), g_file_info_set_sort_order)
 };
diff --git a/gio/src/notification.hg b/gio/src/notification.hg
index 4b94054d..03d4532a 100644
--- a/gio/src/notification.hg
+++ b/gio/src/notification.hg
@@ -74,6 +74,7 @@ public:
   _WRAP_METHOD(void set_icon(const Glib::RefPtr<Icon>& icon), g_notification_set_icon)
   _IGNORE(g_notification_set_urgent)
   _WRAP_METHOD(void set_priority(Priority priority = Priority::NORMAL), g_notification_set_priority, newin 
"2,44")
+  _WRAP_METHOD(void set_category(const Glib::ustring& category), g_notification_set_category)
 
   _WRAP_METHOD(void add_button(const Glib::ustring& label, const Glib::ustring& detailed_action), 
g_notification_add_button)
 
diff --git a/gio/src/tlscertificate.hg b/gio/src/tlscertificate.hg
index 4b1af5ab..cfc791d3 100644
--- a/gio/src/tlscertificate.hg
+++ b/gio/src/tlscertificate.hg
@@ -17,6 +17,7 @@
 _CONFIGINCLUDE(giommconfig.h)
 
 #include <glibmm/object.h>
+#include <glibmm/datetime.h>
 #include <giomm/enums.h>
 
 _DEFS(giomm,gio)
@@ -71,9 +72,18 @@ public:
   _WRAP_METHOD(TlsCertificateFlags verify(const Glib::RefPtr<const SocketConnectable>& identity{?}, const 
Glib::RefPtr<const TlsCertificate>& trusted_ca{?}) const, g_tls_certificate_verify)
   _WRAP_METHOD(bool is_same(const Glib::RefPtr<const TlsCertificate>& cert_two) const, 
g_tls_certificate_is_same)
 
+  _WRAP_METHOD(Glib::DateTime get_not_valid_before() const, g_tls_certificate_get_not_valid_before)
+  _WRAP_METHOD(Glib::DateTime get_not_valid_after() const, g_tls_certificate_get_not_valid_after)
+  _WRAP_METHOD(Glib::ustring get_subject_name() const, g_tls_certificate_get_subject_name)
+  _WRAP_METHOD(Glib::ustring get_issuer_name() const, g_tls_certificate_get_issuer_name)
+
   _WRAP_PROPERTY("certificate", Glib::RefPtr<Glib::ByteArray>)
   _WRAP_PROPERTY("certificate-pem", std::string)
   _WRAP_PROPERTY("issuer", Glib::RefPtr<TlsCertificate>)
+  _WRAP_PROPERTY("not-valid-before", Glib::DateTime)
+  _WRAP_PROPERTY("not-valid-after", Glib::DateTime)
+  _WRAP_PROPERTY("subject-name", Glib::ustring)
+  _WRAP_PROPERTY("issuer-name", Glib::ustring)
 
   // Write-only and construct-only
   //_WRAP_PROPERTY("private-key", Glib::RefPtr<Glib::ByteArray>)
diff --git a/gio/src/tlsconnection.hg b/gio/src/tlsconnection.hg
index c7bcc832..c76c5dc1 100644
--- a/gio/src/tlsconnection.hg
+++ b/gio/src/tlsconnection.hg
@@ -25,6 +25,7 @@ _PINCLUDE(giomm/private/iostream_p.h)
 
 namespace Gio
 {
+_WRAP_ENUM(TlsProtocolVersion, GTlsProtocolVersion, decl_prefix GIOMM_API)
 
 class GIOMM_API Cancellable;
 class GIOMM_API TlsDatabase;
@@ -77,6 +78,9 @@ public:
   _WRAP_METHOD(void handshake_async(const SlotAsyncReady& slot{callback}, const Glib::RefPtr<Cancellable>& 
cancellable{.?}, int io_priority{.} = Glib::PRIORITY_DEFAULT), g_tls_connection_handshake_async, slot_name 
slot, slot_callback SignalProxy_async_callback)
   _WRAP_METHOD(bool handshake_finish(const Glib::RefPtr<AsyncResult>& result), 
g_tls_connection_handshake_finish, errthrow)
 
+  _WRAP_METHOD(TlsProtocolVersion get_protocol_version() const, g_tls_connection_get_protocol_version)
+  _WRAP_METHOD(Glib::ustring get_ciphersuite_name() const, g_tls_connection_get_ciphersuite_name)
+
   _WRAP_METHOD(bool emit_accept_certificate(const Glib::RefPtr<const TlsCertificate>& peer_cert, 
TlsCertificateFlags errors), g_tls_connection_emit_accept_certificate)
 
   _WRAP_PROPERTY("base-io-stream", Glib::RefPtr<IOStream>)
@@ -86,6 +90,8 @@ public:
   _WRAP_PROPERTY("peer-certificate", Glib::RefPtr<TlsCertificate>)
   _WRAP_PROPERTY("peer-certificate-errors", TlsCertificateFlags)
   _WRAP_PROPERTY("require-close-notify", bool)
+  _WRAP_PROPERTY("protocol-version", TlsProtocolVersion)
+  _WRAP_PROPERTY("ciphersuite-name", Glib::ustring)
   _IGNORE_PROPERTY("use-system-certdb", "rehandshake-mode")dnl // deprecated
 
 #m4 _CONVERSION(`GTlsCertificate*',`const Glib::RefPtr<const TlsCertificate>&',`Glib::wrap($3, true)')
diff --git a/glib/src/binding.ccg b/glib/src/binding.ccg
index a1b40e91..ff753380 100644
--- a/glib/src/binding.ccg
+++ b/glib/src/binding.ccg
@@ -117,38 +117,16 @@ Binding::bind_property_value(const PropertyProxy_Base& source_property,
   return Glib::make_refptr_for_instance<Binding>(new Binding(binding));
 }
 
-// We hand-code get_source() and get_target().
-// g_binding_get_source() and g_binding_get_target() are deprecated in glib 2.68.
-// We can't use the replacements g_binding_dup_source() and g_binding_dup_target(),
-// which are new in glib 2.68. This version of glibmm does not require glib 2.68.
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-Glib::ObjectBase* Binding::get_source()
-{
-  return Glib::wrap_auto(g_binding_get_source(gobj()));
-}
-
-const Glib::ObjectBase* Binding::get_source() const
-{
-  return const_cast<Binding*>(this)->get_source();
-}
-
-Glib::ObjectBase* Binding::get_target()
-{
-  return Glib::wrap_auto(g_binding_get_target(gobj()));
-}
-
-const Glib::ObjectBase* Binding::get_target() const
-{
-  return const_cast<Binding*>(this)->get_target();
-}
-
 void
 Binding::unbind()
 {
   // Call g_binding_unbind() only once. It always calls g_object_unref().
-  if (g_binding_get_source(gobj()))
+  GObject* source = g_binding_dup_source(gobj());
+  if (source)
+  {
     g_binding_unbind(gobj());
+    g_object_unref(source);
+  }
 }
-G_GNUC_END_IGNORE_DEPRECATIONS
 
 } // namespace Glib
diff --git a/glib/src/binding.hg b/glib/src/binding.hg
index dbd64480..54af2d0c 100644
--- a/glib/src/binding.hg
+++ b/glib/src/binding.hg
@@ -93,8 +93,9 @@ namespace Glib
  * The binding between the two properties is broken whenever either one of the
  * Glib::ObjectBase instances it refers to is deleted or when unbind() is called.
  * If a RefPtr<Binding> remains after the binding has been broken, get_source()
- * and get_target() return a <tt>nullptr</tt>. It's not necessary to keep a
- * RefPtr<Binding> in order to keep the binding alive.
+ * and get_target() return a <tt>nullptr</tt>, and dup_source() and dup_target()
+ * return an empty RefPtr. It's not necessary to keep a RefPtr<Binding>
+ * in order to keep the binding alive.
  *
  * @newin{2,44}
  */
@@ -381,68 +382,30 @@ public:
       slot_transform_from.empty() ? SlotTransform() : TransformProp<T_target, 
T_source>(slot_transform_from));
   }
 
-  // We hand-code get_source() and get_target().
-  // g_binding_get_source() and g_binding_get_target() are deprecated in glib 2.68.
-  // We can't use the replacements g_binding_dup_source() and g_binding_dup_target(),
-  // which are new in glib 2.68. This version of glibmm does not require glib 2.68.
-  //#m4 _CONVERSION(`GObject*',`Glib::ObjectBase*',`Glib::wrap_auto($3)')
-  //_WRAP_METHOD(Glib::ObjectBase* get_source(), g_binding_get_source, newin "2,44")
-  //_WRAP_METHOD(const Glib::ObjectBase* get_source() const, g_binding_get_source, constversion, newin 
"2,44")
-  _IGNORE(g_binding_get_source)
+  #m4 _CONVERSION(`GObject*',`Glib::ObjectBase*',`Glib::wrap_auto($3)')
+  _WRAP_METHOD(Glib::ObjectBase* get_source(), g_binding_get_source,
+    newin "2,44", deprecated "Use dup_source() instead.")
+  _WRAP_METHOD(const Glib::ObjectBase* get_source() const, g_binding_get_source,
+    constversion, newin "2,44", deprecated "Use dup_source() instead.")
 
-  /** Retrieves the Glib::ObjectBase instance used as the source of the binding.
-   *
-   * A %Glib::Binding can outlive the source Glib::ObjectBase as the binding does not hold a
-   * strong reference to the source. If the source is destroyed before the
-   * binding then this function will return a <tt>nullptr</tt>.
-   *
-   * @newin{2,44}
-   *
-   * @return The source Glib::ObjectBase.
-   */
-  Glib::ObjectBase* get_source();
-
-  /** Retrieves the Glib::ObjectBase instance used as the source of the binding.
-   *
-   * A %Glib::Binding can outlive the source Glib::ObjectBase as the binding does not hold a
-   * strong reference to the source. If the source is destroyed before the
-   * binding then this function will return a <tt>nullptr</tt>.
-   *
-   * @newin{2,44}
-   *
-   * @return The source Glib::ObjectBase.
-   */
-  const Glib::ObjectBase* get_source() const;
+  // Don't use Glib::RefPtr<Glib::Object> Glib::wrap(GObject* object, bool take_copy).
+  // The object may be an interface object, e.g. Gio::Action. Such an object can't be
+  // cast to Glib::Object. https://gitlab.gnome.org/GNOME/glibmm/-/issues/93
+#m4 
_CONVERSION(`GObject*',`Glib::RefPtr<Glib::ObjectBase>',`Glib::make_refptr_for_instance<Glib::ObjectBase>(Glib::wrap_auto($3))')
+  _WRAP_METHOD(Glib::RefPtr<Glib::Object> dup_source(), g_binding_dup_source, newin "2,70")
+  _WRAP_METHOD(Glib::RefPtr<const Glib::Object> dup_source() const, g_binding_dup_source,
+    constversion, newin "2,70")
 
   _WRAP_METHOD(Glib::ustring get_source_property() const, g_binding_get_source_property, newin "2,44")
 
-  //_WRAP_METHOD(Glib::ObjectBase* get_target(), g_binding_get_target, newin "2,44")
-  //_WRAP_METHOD(const Glib::ObjectBase* get_target() const, g_binding_get_target, constversion, newin 
"2,44")
-  _IGNORE(g_binding_get_target)
+  _WRAP_METHOD(Glib::ObjectBase* get_target(), g_binding_get_target,
+    newin "2,44", deprecated "Use dup_target() instead.")
+  _WRAP_METHOD(const Glib::ObjectBase* get_target() const, g_binding_get_target,
+    constversion, newin "2,44", deprecated "Use dup_target() instead.")
 
-  /** Retrieves the Glib::ObjectBase instance used as the target of the binding.
-   *
-   * A %Glib::Binding can outlive the target Glib::ObjectBase as the binding does not hold a
-   * strong reference to the target. If the target is destroyed before the
-   * binding then this function will return a <tt>nullptr</tt>.
-   *
-   * @newin{2,44}
-   *
-   * @return The target Glib::ObjectBase.
-   */
-  Glib::ObjectBase* get_target();
-
-  /** Retrieves the Glib::ObjectBase instance used as the target of the binding.
-   *
-   * A %Glib::Binding can outlive the target Glib::ObjectBase as the binding does not hold a
-   * strong reference to the target. If the target is destroyed before the
-   * binding then this function will return a <tt>nullptr</tt>.
-   *
-   * @newin{2,44}
-   *
-   * @return The target Glib::ObjectBase.
-   */
-  const Glib::ObjectBase* get_target() const;
+  _WRAP_METHOD(Glib::RefPtr<Glib::Object> dup_target(), g_binding_dup_target, newin "2,70")
+  _WRAP_METHOD(Glib::RefPtr<const Glib::Object> dup_target() const, g_binding_dup_target,
+    constversion, newin "2,70")
 
   _WRAP_METHOD(Glib::ustring get_target_property() const, g_binding_get_target_property, newin "2,44")
   _WRAP_METHOD(Flags get_flags() const, g_binding_get_flags, newin "2,44")
diff --git a/glib/src/spawn.ccg b/glib/src/spawn.ccg
index 84752443..22b8895c 100644
--- a/glib/src/spawn.ccg
+++ b/glib/src/spawn.ccg
@@ -138,7 +138,7 @@ void
 spawn_sync(const std::string& working_directory, const std::vector<std::string>& argv,
   const std::vector<std::string>& envp, SpawnFlags flags,
   const SlotSpawnChildSetup& child_setup, std::string* standard_output, std::string* standard_error,
-  int* exit_status)
+  int* wait_status)
 {
   const bool setup_slot = !child_setup.empty();
   auto child_setup_ = child_setup;
@@ -150,7 +150,7 @@ spawn_sync(const std::string& working_directory, const std::vector<std::string>&
     const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(envp).data()), 
static_cast<GSpawnFlags>(unsigned(flags)),
     (setup_slot) ? &child_setup_callback : nullptr, (setup_slot) ? &child_setup_ : nullptr,
     (standard_output) ? &pch_buf_standard_output : nullptr,
-    (standard_error) ? &pch_buf_standard_error : nullptr, exit_status, &gerror);
+    (standard_error) ? &pch_buf_standard_error : nullptr, wait_status, &gerror);
   auto buf_standard_output = make_unique_ptr_gfree(pch_buf_standard_output);
   auto buf_standard_error = make_unique_ptr_gfree(pch_buf_standard_error);
 
@@ -164,7 +164,7 @@ spawn_sync(const std::string& working_directory, const std::vector<std::string>&
 void
 spawn_sync(const std::string& working_directory, const std::vector<std::string>& argv,
   SpawnFlags flags, const SlotSpawnChildSetup& child_setup, std::string* standard_output,
-  std::string* standard_error, int* exit_status)
+  std::string* standard_error, int* wait_status)
 {
   const bool setup_slot = !child_setup.empty();
   auto child_setup_ = child_setup;
@@ -176,7 +176,7 @@ spawn_sync(const std::string& working_directory, const std::vector<std::string>&
   g_spawn_sync(Glib::c_str_or_nullptr(working_directory), 
const_cast<char**>(Glib::ArrayHandler<std::string>::vector_to_array(argv).data()), nullptr,
     static_cast<GSpawnFlags>(unsigned(flags)), (setup_slot) ? &child_setup_callback : nullptr,
     (setup_slot) ? &child_setup_ : nullptr, (standard_output) ? &pch_buf_standard_output : nullptr,
-    (standard_error) ? &pch_buf_standard_error : nullptr, exit_status, &gerror);
+    (standard_error) ? &pch_buf_standard_error : nullptr, wait_status, &gerror);
   auto buf_standard_output = make_unique_ptr_gfree(pch_buf_standard_output);
   auto buf_standard_error = make_unique_ptr_gfree(pch_buf_standard_error);
 
@@ -199,7 +199,7 @@ spawn_command_line_async(const std::string& command_line)
 
 void
 spawn_command_line_sync(const std::string& command_line, std::string* standard_output,
-  std::string* standard_error, int* exit_status)
+  std::string* standard_error, int* wait_status)
 {
   char* pch_buf_standard_output = nullptr;
   char* pch_buf_standard_error = nullptr;
@@ -207,7 +207,7 @@ spawn_command_line_sync(const std::string& command_line, std::string* standard_o
 
   g_spawn_command_line_sync(command_line.c_str(),
     (standard_output) ? &pch_buf_standard_output : nullptr,
-    (standard_error) ? &pch_buf_standard_error : nullptr, exit_status, &gerror);
+    (standard_error) ? &pch_buf_standard_error : nullptr, wait_status, &gerror);
   auto buf_standard_output = make_unique_ptr_gfree(pch_buf_standard_output);
   auto buf_standard_error = make_unique_ptr_gfree(pch_buf_standard_error);
 
diff --git a/glib/src/spawn.hg b/glib/src/spawn.hg
index c13ab808..c20ad9a8 100644
--- a/glib/src/spawn.hg
+++ b/glib/src/spawn.hg
@@ -283,13 +283,13 @@ void spawn_async(const std::string& working_directory,
  * if those parameters are non-nullptr. Note that you must set the
  * SpawnFlags::STDOUT_TO_DEV_NULL and SpawnFlags::STDERR_TO_DEV_NULL flags when
  * passing nullptr for @a standard_output and @a standard_error.
- * If @a exit_status is non-nullptr, the exit status of the child is stored
+ * If @a wait_status is non-nullptr, the wait status of the child is stored
  * there as it would be returned by waitpid(); standard UNIX macros such
- * as WIFEXITED() and WEXITSTATUS() must be used to evaluate the exit status.
- * Note that this function calls waitpid() even if @a exit_status is nullptr, and
+ * as WIFEXITED() and WEXITSTATUS() must be used to evaluate the wait status.
+ * Note that this function calls waitpid() even if @a wait_status is nullptr, and
  * does not accept the SpawnFlags::DO_NOT_REAP_CHILD flag.
  * If an error occurs, no data is returned in @a standard_output,
- * @a standard_error, or @a exit_status.
+ * @a standard_error, or @a wait_status.
  *
  * This function calls spawn_async_with_pipes() internally; see that
  * function for full details on the other parameters and details on
@@ -302,7 +302,7 @@ void spawn_async(const std::string& working_directory,
  * @param child_setup Slot to run in the child just before exec(), or an empty slot.
  * @param standard_output Return location for file descriptor to read child's stdout, or nullptr.
  * @param standard_error Return location for file descriptor to read child's stderr, or nullptr.
- * @param exit_status Return location for child exit status, as returned by waitpid(), or nullptr
+ * @param wait_status Return location for child wait status, as returned by waitpid(), or nullptr
  *
  * @throws SpawnError Errors are reported even if they occur in the child (for example if the
  * executable in argv[0] is not found). Typically
@@ -318,7 +318,7 @@ void spawn_sync(const std::string& working_directory,
                 const SlotSpawnChildSetup& child_setup = {},
                 std::string* standard_output = nullptr,
                 std::string* standard_error = nullptr,
-                int* exit_status = nullptr);
+                int* wait_status = nullptr);
 
 /** Like the main spawn_sync() method, but inheriting the parent's environment.
  *
@@ -328,7 +328,7 @@ void spawn_sync(const std::string& working_directory,
  * @param child_setup Slot to run in the child just before exec(), or an empty slot.
  * @param standard_output Return location for file descriptor to read child's stdout, or nullptr.
  * @param standard_error Return location for file descriptor to read child's stderr, or nullptr.
- * @param exit_status Return location for child exit status, as returned by waitpid(), or nullptr
+ * @param wait_status Return location for child wait status, as returned by waitpid(), or nullptr
  *
  * @throws SpawnError Errors are reported even if they occur in the child (for example if the
  * executable in argv[0] is not found). Typically
@@ -343,7 +343,7 @@ void spawn_sync(const std::string& working_directory,
                 const SlotSpawnChildSetup& child_setup = {},
                 std::string* standard_output = nullptr,
                 std::string* standard_error = nullptr,
-                int* exit_status = nullptr);
+                int* wait_status = nullptr);
 
 /** A simple version of spawn_async() that parses a command line with
  * shell_parse_argv() and passes it to spawn_async(). It runs a
@@ -373,9 +373,9 @@ void spawn_command_line_async(const std::string& command_line);
  * implications, so consider using spawn_sync() directly if
  * appropriate.
  *
- * If @a exit_status is non-nullptr, the exit status of the child is stored there as
+ * If @a wait_status is non-nullptr, the wait status of the child is stored there as
  * it would be returned by waitpid(); standard UNIX macros such as WIFEXITED()
- * and WEXITSTATUS() must be used to evaluate the exit status.
+ * and WEXITSTATUS() must be used to evaluate the wait status.
  *
  * On Windows, please note the implications of shell_parse_argv()
  * parsing @a command_line. Parsing is done according to Unix shell rules, not
@@ -390,7 +390,7 @@ void spawn_command_line_async(const std::string& command_line);
  * @param command_line A command line.
  * @param standard_output Return location for child output.
  * @param standard_error Return location for child errors.
- * @param exit_status Return location for child exit status, as returned by waitpid().
+ * @param wait_status Return location for child wait status, as returned by waitpid().
  *
  * @throws SpawnError Errors are reported even if they occur in the child (for example if the
  * executable in argv[0] is not found). Typically
@@ -402,7 +402,7 @@ GLIBMM_API
 void spawn_command_line_sync(const std::string& command_line,
                              std::string* standard_output = nullptr,
                              std::string* standard_error = nullptr,
-                             int* exit_status = nullptr);
+                             int* wait_status = nullptr);
 
 /** On some platforms, notably WIN32, the Pid type represents a resource
  * which must be closed to prevent resource leaking. close_pid()
diff --git a/glib/src/timezone.ccg b/glib/src/timezone.ccg
index b2af6cb5..0a6db6b9 100644
--- a/glib/src/timezone.ccg
+++ b/glib/src/timezone.ccg
@@ -19,15 +19,9 @@
 namespace Glib
 {
 
-// We hand-code create(const Glib::ustring& identifier).
-// g_time_zone_new() is deprecated in glib 2.68.
-// We can't use the replacement g_time_zone_new_identifier(),
-// which is new in glib 2.68. This version of glibmm does not require glib 2.68.
-G_GNUC_BEGIN_IGNORE_DEPRECATIONS
-TimeZone TimeZone::create(const Glib::ustring& identifier)
+TimeZone::operator bool() const
 {
-  return Glib::wrap(g_time_zone_new(identifier.c_str()));
+  return gobject_ != nullptr;
 }
-G_GNUC_END_IGNORE_DEPRECATIONS
 
 } // namespace Glib
diff --git a/glib/src/timezone.hg b/glib/src/timezone.hg
index 8d28c4e4..bba1051d 100644
--- a/glib/src/timezone.hg
+++ b/glib/src/timezone.hg
@@ -61,17 +61,20 @@ class GLIBMM_API TimeZone
   _IGNORE(g_time_zone_ref, g_time_zone_unref)
 
 public:
-  // We hand-code create(const Glib::ustring& identifier).
-  // g_time_zone_new() is deprecated in glib 2.68.
-  // We can't use the replacement g_time_zone_new_identifier(),
-  // which is new in glib 2.68. This version of glibmm does not require glib 2.68.
-  //_WRAP_METHOD(static TimeZone create(const Glib::ustring& identifier), g_time_zone_new_identifier)
-  _WRAP_METHOD_DOCS_ONLY(g_time_zone_new)
-  static TimeZone create(const Glib::ustring& identifier);
-
+  _WRAP_METHOD(static TimeZone create(const Glib::ustring& identifier),
+    g_time_zone_new, deprecated "Use create_identifier() instead.")
+  _WRAP_METHOD(static TimeZone create_identifier(const Glib::ustring& identifier),
+    g_time_zone_new_identifier, newin "2,70")
   _WRAP_METHOD(static TimeZone create_local(), g_time_zone_new_local)
   _WRAP_METHOD(static TimeZone create_utc(), g_time_zone_new_utc)
 
+  /** Returns true if the %TimeZone object is valid.
+   * This will return false, for instance, if create_identifier()
+   * has been called with an @a identifier that cannot be parsed or loaded.
+   * @newin{2,70}
+   */
+  explicit operator bool() const;
+
   _WRAP_METHOD(int find_interval(TimeType type, gint64 time) const, g_time_zone_find_interval)
   _WRAP_METHOD(int adjust_time(TimeType type, gint64& time) const, g_time_zone_adjust_time)
   _WRAP_METHOD(Glib::ustring get_abbreviation(int interval) const, g_time_zone_get_abbreviation)
diff --git a/meson.build b/meson.build
index f9478207..4d11c87e 100644
--- a/meson.build
+++ b/meson.build
@@ -100,7 +100,7 @@ install_pkgconfigdir = install_libdir / 'pkgconfig'
 #   Dependencies when using the <pkg>mm library.
 
 sigcxx_req = '>= 3.0.0'
-glib_req = '>= 2.63.0'
+glib_req = '>= 2.69.1'
 
 # There are pkg-config files for sigc++ and glib on MSVC, so just use that.
 sigcxx_dep = dependency('sigc++-3.0', version: sigcxx_req)
@@ -266,12 +266,19 @@ if can_add_dist_script
     python3.path(), dist_changelog_py,
     project_source_root,
   )
+
+  # Don't distribute these files.
+  dont_distribute = [
+    'HACKING',
+    '.gitlab-ci.yml',
+  ]
   # Add build scripts to the distribution directory, and delete .gitignore
   # files and an empty $MESON_PROJECT_DIST_ROOT/build/ directory.
   meson.add_dist_script(
     python3.path(), dist_build_scripts_py,
     project_source_root,
     'untracked' / 'build_scripts',
+    dont_distribute,
   )
 endif
 
diff --git a/tools/m4/convert_gio.m4 b/tools/m4/convert_gio.m4
index cfddc891..a8498630 100644
--- a/tools/m4/convert_gio.m4
+++ b/tools/m4/convert_gio.m4
@@ -80,6 +80,7 @@ _CONV_GIO_INCLASS_ENUM(TlsDatabase,VerifyFlags)
 _CONV_GIO_INCLASS_ENUM(TlsDatabase,LookupFlags)
 _CONV_GIO_ENUM(TlsInteractionResult)
 _CONV_GIO_INCLASS_ENUM(TlsPassword,Flags)
+_CONV_GIO_ENUM(TlsProtocolVersion)
 _CONV_GIO_INCLASS_ENUM(UnixSocketAddress,Type)
 _CONV_GIO_ENUM(ZlibCompressorFormat)
 


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