From 07f58ed82bca9d7d6e01516206cfa46b919222a6 Mon Sep 17 00:00:00 2001 From: Mike Fleetwood Date: Tue, 6 Mar 2018 21:09:11 +0000 Subject: [PATCH] Raise minimum required glibmm version to 2.14.0 (#794253) Increase the minimum required version of glibmm to 2.14.0, thus allowing removal of the HAVE_GLIB_REGEX autoconf definition and associated conditional code. This is reversing commit, except for the new glibmm minimum check: 456932846bfbfbd77bbf49165b9eb6c2b84e0da6 Implement fallback if Glib::Regex class is missing (#695279) Bug 794253 - Desupport RHEL / CentOS 5 and raise minimum required versions to glibmm 2.14.0 and gtkmm 2.16.0 --- configure.ac | 11 ++--------- src/Utils.cc | 19 ------------------- 2 files changed, 2 insertions(+), 28 deletions(-) diff --git a/configure.ac b/configure.ac index e8b7e7c7..fe4d4e43 100644 --- a/configure.ac +++ b/configure.ac @@ -224,15 +224,8 @@ AC_SUBST([GTKMM_LIBS]) AC_SUBST([GTKMM_CFLAGS]) -dnl Check for glibmm >= 2.14 to determine availability of Glib::Regex class -AC_MSG_CHECKING([for Glib::Regex class]) -PKG_CHECK_EXISTS( - [glibmm-2.4 >= 2.14.0], - [AC_DEFINE([HAVE_GLIB_REGEX], 1, [Define to 1 if glibmm provides Glib::Regex class.]) - AC_MSG_RESULT([yes]) - ], - [AC_MSG_RESULT([no])] -) +dnl Check for glibmm minimum required version. +PKG_CHECK_MODULES([GLIBMM], [glibmm-2.4 >= 2.14.0]) dnl Check for gtkmm >= 2.11.1 to determine availability of Gtk::Window::set_default_icon_name() diff --git a/src/Utils.cc b/src/Utils.cc index 39ef1673..a955f6a5 100644 --- a/src/Utils.cc +++ b/src/Utils.cc @@ -22,11 +22,7 @@ #include #include #include -#ifdef HAVE_GLIB_REGEX #include -#else -#include -#endif #include #include #include @@ -665,7 +661,6 @@ Glib::ustring Utils::regexp_label( const Glib::ustring & text { //Extract text from a regular sub-expression or pattern. // E.g., "text we don't want (text we want)" -#ifdef HAVE_GLIB_REGEX std::vector results; Glib::RefPtr myregexp = Glib::Regex::create( pattern @@ -678,20 +673,6 @@ Glib::ustring Utils::regexp_label( const Glib::ustring & text return results[ 1 ] ; else return "" ; -#else /* ! HAVE_GLIB_REGEX */ - Glib::ustring label = "" ; - regex_t preg ; - int nmatch = 2 ; - regmatch_t pmatch[ 2 ] ; - int rc = regcomp( &preg, pattern .c_str(), REG_EXTENDED | REG_ICASE | REG_NEWLINE ) ; - if ( rc == 0 ) - { - if ( regexec( &preg, text .c_str(), nmatch, pmatch, 0 ) == 0 ) - label = text .substr( pmatch[ 1 ] .rm_so, pmatch[ 1 ] .rm_eo - pmatch[ 1 ] .rm_so ) ; - regfree( &preg ) ; - } - return label ; -#endif } Glib::ustring Utils::trim( const Glib::ustring & src, const Glib::ustring & c /* = " \t\r\n" */ )