[tracker] Port to Qt5.
- From: Philip Van Hoof <pvanhoof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] Port to Qt5.
- Date: Thu, 9 Jan 2014 13:21:48 +0000 (UTC)
commit 601be18db49cf2b40cf5f6f3bac7cdf2a2081159
Author: Andrew den Exter <andrew den exter jollamobile com>
Date: Fri Aug 16 06:55:43 2013 +0000
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 b713a8d..2e4c1dc 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 <philip 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
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]