From 2d3b8cd5fd6d7f7cc7dcb15d52432348c7b7617a Mon Sep 17 00:00:00 2001 From: Josh Klontz Date: Sat, 16 Mar 2013 21:42:16 -0400 Subject: [PATCH] hid QCoreApplication from API --- sdk/openbr_plugin.cpp | 13 +++++++------ sdk/openbr_plugin.h | 2 -- sdk/plugins/gallery.cpp | 2 +- sdk/plugins/youtube.cpp | 1 + 4 files changed, 9 insertions(+), 9 deletions(-) diff --git a/sdk/openbr_plugin.cpp b/sdk/openbr_plugin.cpp index bf52cef..2220fce 100644 --- a/sdk/openbr_plugin.cpp +++ b/sdk/openbr_plugin.cpp @@ -797,16 +797,17 @@ bool br::Context::checkSDKPath(const QString &sdkPath) void br::Context::initialize(int argc, char *argv[], const QString &sdkPath) { if (Globals == NULL) { - Globals = new Context(); - Globals->init(File()); - } - + // QApplication should be initialzed before anything else #ifndef BR_EMBEDDED - Globals->coreApplication = QSharedPointer(new QApplication(argc, argv)); + static QApplication application(argc, argv); #else - Globals->coreApplication = QSharedPointer(new QCoreApplication(argc, argv)); + static QCoreApplication coreApplication(argc, argv); #endif + Globals = new Context(); + Globals->init(File()); + } + initializeQt(sdkPath); #ifdef BR_DISTRIBUTED diff --git a/sdk/openbr_plugin.h b/sdk/openbr_plugin.h index bc50331..4966d9c 100644 --- a/sdk/openbr_plugin.h +++ b/sdk/openbr_plugin.h @@ -17,7 +17,6 @@ #ifndef __OPENBR_PLUGIN_H #define __OPENBR_PLUGIN_H -#include #include #include #include @@ -466,7 +465,6 @@ private: class BR_EXPORT Context : public Object { Q_OBJECT - QSharedPointer coreApplication; QFile logFile; public: diff --git a/sdk/plugins/gallery.cpp b/sdk/plugins/gallery.cpp index 50f1be6..e522d44 100644 --- a/sdk/plugins/gallery.cpp +++ b/sdk/plugins/gallery.cpp @@ -677,7 +677,7 @@ class googleGallery : public Gallery QNetworkReply *reply = networkAccessManager.get(request); while (!reply->isFinished()) - QCoreApplication::processEvents(); + QThread::yieldCurrentThread(); QString data(reply->readAll()); delete reply; diff --git a/sdk/plugins/youtube.cpp b/sdk/plugins/youtube.cpp index 442c4d3..6b4cca8 100644 --- a/sdk/plugins/youtube.cpp +++ b/sdk/plugins/youtube.cpp @@ -1,3 +1,4 @@ +#include #include #include -- libgit2 0.21.4