[libmediaart/ebassi/no-more-qt4] Drop Qt4 support




commit f165236ffd6154b900af2089448effd8be3ed537
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Thu May 20 16:41:48 2021 +0100

    Drop Qt4 support
    
    Qt 4 was end-of-lifed in December 2015.

 configure.ac              | 28 ++--------------------------
 libmediaart/extractqt.cpp | 12 ------------
 libmediaart/meson.build   |  2 +-
 meson.build               | 16 ----------------
 4 files changed, 3 insertions(+), 55 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 9ae1292..01dfbfb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -134,7 +134,6 @@ GLIB_TESTS
 GLIB_REQUIRED=2.38.0
 GDKPIXBUF_REQUIRED=2.12.0
 QT5_REQUIRED=5.0.0
-QT4_REQUIRED=4.7.1
 
 # Check requirements for libmediaart
 LIBMEDIAART_REQUIRED="glib-2.0 >= $GLIB_REQUIRED
@@ -229,50 +228,27 @@ if test "x$enable_qt" != "xno" && test "x$enable_gdkpixbuf" != "xyes"; then
                          [have_qt5=yes],
                          [have_qt5=no])
    fi
-   if test "x$with_qt_version" == "xauto" || test "x$with_qt_version" == "x4"; then
-       PKG_CHECK_MODULES(QT4,
-                         [QtGui >= $QT4_REQUIRED],
-                         [have_qt4=yes],
-                         [have_qt4=no])
-   fi
 
    if test "x$have_qt5" = "xyes"; then
       BACKEND_CFLAGS="$QT5_CFLAGS -fPIC"
       BACKEND_LIBS="$QT5_LIBS"
 
       AC_DEFINE(HAVE_QT5, [], [Define if we have Qt5])
-      AC_DEFINE(HAVE_QT, [], [Define if we have Qt])
       LIBMEDIAART_BACKEND=Qt5Gui
 
       selected_for_media_art="yes (qt5)"
-   else
-      if test "x$have_qt4" = "xyes"; then
-         BACKEND_CFLAGS="$QT4_CFLAGS -fPIC"
-         BACKEND_LIBS="$QT4_LIBS"
-
-         AC_DEFINE(HAVE_QT4, [], [Define if we have Qt4])
-         AC_DEFINE(HAVE_QT, [], [Define if we have Qt])
-         LIBMEDIAART_BACKEND=QtGui
-
-         selected_for_media_art="yes (qt4)"
-      fi
    fi
 else
-   have_qt4="no  (disabled)"
    have_qt5="no  (disabled)"
 fi
 
 if test "x$enable_qt" = "xyes"; then
    if test "x$have_qt5" != "xyes"; then
-      if test "x$have_qt4" != "xyes"; then
-         AC_MSG_ERROR([Couldn't find Qt4 >= $QT4_REQUIRED or Qt5 >= $QT5_REQUIRED.])
-      fi
+       AC_MSG_ERROR([Couldn't find Qt5 >= $QT5_REQUIRED.])
    fi
 fi
 
-AM_CONDITIONAL(HAVE_QT4, test "x$have_qt4" = "xyes")
-AM_CONDITIONAL(HAVE_QT5, test "x$have_qt5" = "xyes")
-AM_CONDITIONAL(HAVE_QT, test "x$have_qt5" = "xyes" || test "x$have_qt4" = "xyes")
+AM_CONDITIONAL(HAVE_QT, test "x$have_qt5" = "xyes")
 
 if test "x$enable_gdkpixbuf" != "xno" && test "x$enable_qt" != "xyes"; then
    PKG_CHECK_MODULES(GDKPIXBUF,
diff --git a/libmediaart/extractqt.cpp b/libmediaart/extractqt.cpp
index 580f3dd..1e8e1b3 100644
--- a/libmediaart/extractqt.cpp
+++ b/libmediaart/extractqt.cpp
@@ -26,11 +26,7 @@
 #include <QBuffer>
 #include <QImageReader>
 #include <QImageWriter>
-#ifdef HAVE_QT5
 #include <QCoreApplication>
-#else
-#include <QApplication>
-#endif
 #include <QColor>
 #include <QPainter>
 
@@ -40,11 +36,7 @@
 
 G_BEGIN_DECLS
 
-#ifdef HAVE_QT5
 static QCoreApplication *app = NULL;
-#else  /* HAVE_QT4 (we fallback to Qt4) */
-static QApplication *app = NULL;
-#endif /* HAVE_QT5 */
 
 static gint max_width_in_bytes = 0;
 
@@ -58,15 +50,11 @@ media_art_plugin_init (gint max_width)
 
        max_width_in_bytes = max_width;
 
-#ifdef HAVE_QT5
        if (QCoreApplication::instance()) {
                // avoid a new instance if already running inside a qt app
                return;
        }
        app = new QCoreApplication (argc, argv);
-#else  /* HAVE_QT4 (we fallback to Qt4) */
-       app = new QApplication (argc, argv, QApplication::Tty);
-#endif /* HAVE_QT5 */
 }
 
 void
diff --git a/libmediaart/meson.build b/libmediaart/meson.build
index c43fb9e..56e00ab 100644
--- a/libmediaart/meson.build
+++ b/libmediaart/meson.build
@@ -17,7 +17,7 @@ libmediaart_sources = [
 
 if image_library_name == 'gdk-pixbuf-2.0'
   libmediaart_sources += 'extractpixbuf.c'
-elif image_library_name == 'QtGui' or image_library_name == 'Qt5Gui'
+elif image_library_name == 'Qt5Gui'
   add_languages('cpp', required : true)
   libmediaart_sources += 'extractqt.cpp'
 else
diff --git a/meson.build b/meson.build
index 704cba0..3b2dd09 100644
--- a/meson.build
+++ b/meson.build
@@ -24,7 +24,6 @@ glib = dependency('glib-2.0', version: '> ' + glib_required)
 gio = dependency('gio-2.0', version: '> ' + glib_required)
 gio_unix = dependency('gio-unix-2.0', version: '> ' + glib_required)
 gobject = dependency('gobject-2.0', version: '> ' + glib_required)
-qt4 = dependency('qt4', version: '> 4.7.1', modules: 'Gui', required: false)
 qt5 = dependency('qt5', version: '> 5.0.0', modules: 'Gui', required: false)
 
 ##################################################################
@@ -53,17 +52,6 @@ if image_library_name == ''
   endif
 endif
 
-if image_library_name == ''
-  if qt4.found()
-    if get_option('image_library') == 'auto' or get_option('image_library') == 'qt4'
-      image_library = qt4
-      image_library_name = 'QtGui'
-    endif
-  elif get_option('image_library') == 'qt4'
-    error('qt4 explicitly requested, but not found')
-  endif
-endif
-
 if image_library_name == ''
   error('No usable image processing backends were found.')
 endif
@@ -72,10 +60,6 @@ conf = configuration_data()
 
 conf.set('HAVE_GDKPIXBUF', (image_library_name == 'gdk-pixbuf-2.0'),
          description: 'Define if GdkPixbuf is available')
-conf.set('HAVE_QT', (image_library_name == 'QtGui' or image_library_name == 'Qt5Gui'),
-         description: 'Define if QtGui is available')
-conf.set('HAVE_QT4', (image_library_name == 'QtGui'),
-         description: 'Define if Qt4 is available')
 conf.set('HAVE_QT5', (image_library_name == 'Qt5Gui'),
          description: 'Define Qt5 is available')
 conf.set('LIBMEDIAART_VERSION', meson.project_version(),


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