Re: [Tracker] Request for review: support for Qt and support for Wayland compositor-less QGuiApplication initialisation



On 02/01/14 13:23, Philip Van Hoof wrote:
+#ifdef HAVE_QT5
+#include <QCoreApplication>
+#else
  #include <QApplication>
+#endif
  #include <QColor>
  #include <QPainter>

I personally would add a comment /* HAVE_QT4 */ by the "#else" so it's clear that we're not considering having NO QT as the else condition here. But that's me :) It's just easier for people not familiar with the code.

@@ -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);

Any reason why you're not using g_setenv() ?
More portable - supposedly.

Looks good, please commit :)

--
Regards,
Martyn

Founder & Director @ Lanedo GmbH.
http://www.linkedin.com/in/martynrussell


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