-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Request for review:
The first patch implements support for Qt5's pixmap handling, the second patch further improves on this by setting the plugin for this to minimal for the Nemo OS and alters QCoreApplication to be QGuiApplication in all cases. Setting of the plugin should be done specific per OS. Unfortunately is tracker-extract activated over D-Bus, so setting environment variables that way is rather impractical. The reason why the minimal plugin should be loaded is that if the default plugin is used and the Wayland compositor isn't running yet, then QGuiApplication's constructor will assert, causing tracker-extract to get aborted. So this is to cover for early-boot with systemd; not having to depend on Wayland already running (race condition during early boot - bugfix for it, feature allowing super-early boots, you name it). Kind regards, Philip -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.20 (MingW32) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQEcBAEBAgAGBQJSxWhSAAoJEEP2NSGEz4aD4dQIAKDGZLYwbwT9hZQMgBHFSCGh C8Eap7Kv//Bpdv+c3cTrAh2PkTwWVQyZWlf16fcUFpvOLuWzBr9Xb7vIaa2xrwAP c8lEJeQTG2y6pHBkDNGM/SX5ihOE8610c5tdtADjNj92xQ5xNmIQ3MW2i/XiPyoj Nyj5smq4wpiJ4jW6kWNXhGywQtn+jX66YwF+X5xAtofsYQBu8GC7P5IPVlV0vZG6 UUq8D6FkJ3Y3D8m9SZZkKaiuUGoRDB9DPlDZYlpxnxNqE6QibaFeuLKZ8ob8ungg nzzq+8G2eMZ/Iptaxh1hcLKRahQpjec6ldfvFjD+gGXV8OrY/leBoiBsAbznhd4= =HWHe -----END PGP SIGNATURE-----
>From 2fa925aff042cb1075a675728cf932ead96043c3 Mon Sep 17 00:00:00 2001 From: Andrew den Exter <andrew.den.ex...@jollamobile.com> Date: Fri, 16 Aug 2013 06:55:43 +0000 Subject: [PATCH 1/2] Port to Qt5. --- configure.ac | 51 +++++++++++++++++++++------- src/tracker-extract/tracker-media-art-qt.cpp | 16 ++++++++- 2 files changed, 53 insertions(+), 14 deletions(-) diff --git a/configure.ac b/configure.ac index 090ebd2..57295ca 100644 --- a/configure.ac +++ b/configure.ac @@ -170,7 +170,8 @@ LIBNOTIFY_REQUIRED=0.4.3 HAL_REQUIRED=0.5 UPOWER_REQUIRED=0.9.0 GDKPIXBUF_REQUIRED=2.12.0 -QT_REQUIRED=4.7.1 +QT5_REQUIRED=5.0.0 +QT4_REQUIRED=4.7.1 MEEGOTOUCH_REQUIRED=0.20 POPPLER_REQUIRED=0.16.0 CAIRO_REQUIRED=1.0 @@ -1591,29 +1592,53 @@ selected_for_media_art="no (disabled)" ################################################################## if test "x$enable_qt" != "xno" && test "x$enable_gdkpixbuf" != "xyes"; then - PKG_CHECK_MODULES(QT, - [QtGui >= $QT_REQUIRED], - [have_qt=yes], - [have_qt=no]) + PKG_CHECK_MODULES(QT5, + [Qt5Gui >= $QT5_REQUIRED], + [have_qt5=yes], + [have_qt5=no]) - TRACKER_EXTRACT_CFLAGS="$TRACKER_EXTRACT_CFLAGS $QT_CFLAGS" - TRACKER_EXTRACT_LIBS="$TRACKER_EXTRACT_LIBS $QT_LIBS" + PKG_CHECK_MODULES(QT4, + [QtGui >= $QT4_REQUIRED], + [have_qt4=yes], + [have_qt4=no]) - if test "x$have_qt" = "xyes"; then + + if test "x$have_qt5" = "xyes"; then + TRACKER_EXTRACT_CFLAGS="$TRACKER_EXTRACT_CFLAGS $QT5_CFLAGS -fPIC" + TRACKER_EXTRACT_LIBS="$TRACKER_EXTRACT_LIBS $QT5_LIBS" + + AC_DEFINE(HAVE_QT5, [], [Define if we have Qt5]) AC_DEFINE(HAVE_QT, [], [Define if we have Qt]) - selected_for_media_art="yes (qt)" + + selected_for_media_art="yes (qt5)" + else + if test "x$have_qt4" = "xyes"; then + TRACKER_EXTRACT_CFLAGS="$TRACKER_EXTRACT_CFLAGS $QT4_CFLAGS -fPIC" + TRACKER_EXTRACT_LIBS="$TRACKER_EXTRACT_LIBS $QT4_LIBS" + + AC_DEFINE(HAVE_QT4, [], [Define if we have Qt4]) + AC_DEFINE(HAVE_QT, [], [Define if we have Qt]) + + selected_for_media_art="yes (qt4)" + fi fi else - have_qt="no (disabled)" + have_qt4="no (disabled)" + have_qt5="no (disabled)" fi if test "x$enable_qt" = "xyes"; then - if test "x$have_qt" != "xyes"; then - AC_MSG_ERROR([Couldn't find Qt >= $QT_REQUIRED.]) + 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 fi fi -AM_CONDITIONAL(HAVE_QT, test "x$have_qt" = "xyes") +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") + if test "x$enable_gdkpixbuf" != "xno" && test "x$enable_quill" != "xyes"; then PKG_CHECK_MODULES(GDKPIXBUF, diff --git a/src/tracker-extract/tracker-media-art-qt.cpp b/src/tracker-extract/tracker-media-art-qt.cpp index 74aad18..9b110c0 100644 --- a/src/tracker-extract/tracker-media-art-qt.cpp +++ b/src/tracker-extract/tracker-media-art-qt.cpp @@ -20,13 +20,19 @@ * Philip Van Hoof <phi...@codeminded.be> */ +#include "config.h" + #include "tracker-main.h" #include <QFile> #include <QBuffer> #include <QImageReader> #include <QImageWriter> +#ifdef HAVE_QT5 +#include <QCoreApplication> +#else #include <QApplication> +#endif #include <QColor> #include <QPainter> @@ -36,7 +42,11 @@ G_BEGIN_DECLS -static QApplication *app = NULL; +#ifdef HAVE_QT5 +static QCoreApplication *app = NULL; +#else +static QApplication *app = NULL +#endif void tracker_media_art_plugin_init (void) @@ -44,7 +54,11 @@ tracker_media_art_plugin_init (void) int argc = 0; char *argv[2] = { NULL, NULL }; +#ifdef HAVE_QT5 + app = new QCoreApplication (argc, argv); +#else app = new QApplication (argc, argv, QApplication::Tty); +#endif } void -- 1.8.4.2
>From f4d6194b19026bdebaee3c8f78711b34f5b8d639 Mon Sep 17 00:00:00 2001 From: Philip Van Hoof <phi...@codeminded.be> Date: Mon, 23 Dec 2013 19:16:41 +0100 Subject: [PATCH 2/2] Use minimal in Nemo for QGuiApplication for in case the compositor isn't running yet. Use QGuiApplication instead of QCoreApplication --- configure.ac | 17 +++++++++++++++++ src/tracker-extract/tracker-media-art-qt.cpp | 19 ++++++++++++++----- 2 files changed, 31 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 57295ca..8c74d72 100644 --- a/configure.ac +++ b/configure.ac @@ -624,6 +624,22 @@ if test "x$enable_maemo" = "xyes" ; then fi #################################################################### +# Check if we should install nemo specific features +#################################################################### + +AC_ARG_ENABLE(nemo, + AS_HELP_STRING([--enable-nemo], + [enable nemo specific [[default=no]]]), + [enable_nemo="$enableval"], + [enable_nemo=no]) + +AM_CONDITIONAL(HAVE_NEMO, test "x$enable_nemo" = "xyes") + +if test "x$enable_nemo" = "xyes" ; then + AC_DEFINE(HAVE_NEMO, 1, [Define if we enable Nemo specific features]) +fi + +#################################################################### # Check if we should disable the journal #################################################################### @@ -2674,6 +2690,7 @@ Writeback: Frameworks / Options: Support Maemo $enable_maemo + Support Nemo $enable_nemo Support libmeegotouch $have_meegotouch Support Guaranteed Metadata $enable_guarantee_metadata (e.g. guess nie:title from files) diff --git a/src/tracker-extract/tracker-media-art-qt.cpp b/src/tracker-extract/tracker-media-art-qt.cpp index 9b110c0..ab220c4 100644 --- a/src/tracker-extract/tracker-media-art-qt.cpp +++ b/src/tracker-extract/tracker-media-art-qt.cpp @@ -29,7 +29,7 @@ #include <QImageReader> #include <QImageWriter> #ifdef HAVE_QT5 -#include <QCoreApplication> +#include <QGuiApplication> #else #include <QApplication> #endif @@ -38,12 +38,16 @@ #include <glib.h> +#ifdef HAVE_NEMO +#include <stdlib.h> +#endif + #include "tracker-media-art-generic.h" G_BEGIN_DECLS #ifdef HAVE_QT5 -static QCoreApplication *app = NULL; +static QGuiApplication *app = NULL; #else static QApplication *app = NULL #endif @@ -51,11 +55,16 @@ static QApplication *app = NULL void tracker_media_art_plugin_init (void) { - int argc = 0; - char *argv[2] = { NULL, NULL }; + int argc = 1; + char *argv[2] = { (char*) "tracker-extract", NULL }; #ifdef HAVE_QT5 - app = new QCoreApplication (argc, argv); + +#ifdef HAVE_NEMO + setenv("QT_QPA_PLATFORM", "minimal", 1); +#endif + + app = new QGuiApplication (argc, argv); #else app = new QApplication (argc, argv, QApplication::Tty); #endif -- 1.8.4.2
_______________________________________________ tracker-list mailing list tracker-list@gnome.org https://mail.gnome.org/mailman/listinfo/tracker-list