>From f4d6194b19026bdebaee3c8f78711b34f5b8d639 Mon Sep 17 00:00:00 2001 From: Philip Van Hoof 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 #include #ifdef HAVE_QT5 -#include +#include #else #include #endif @@ -38,12 +38,16 @@ #include +#ifdef HAVE_NEMO +#include +#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