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:
456932846b
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
This commit is contained in:
parent
de6e70d933
commit
07f58ed82b
11
configure.ac
11
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()
|
||||
|
|
19
src/Utils.cc
19
src/Utils.cc
|
@ -22,11 +22,7 @@
|
|||
#include <sstream>
|
||||
#include <fstream>
|
||||
#include <iomanip>
|
||||
#ifdef HAVE_GLIB_REGEX
|
||||
#include <glibmm/regex.h>
|
||||
#else
|
||||
#include <regex.h>
|
||||
#endif
|
||||
#include <locale.h>
|
||||
#include <uuid/uuid.h>
|
||||
#include <cerrno>
|
||||
|
@ -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<Glib::ustring> results;
|
||||
Glib::RefPtr<Glib::Regex> 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" */ )
|
||||
|
|
Loading…
Reference in New Issue