Commit 2d3b8cd5fd6d7f7cc7dcb15d52432348c7b7617a
1 parent
2a792b66
hid QCoreApplication from API
Showing
4 changed files
with
9 additions
and
9 deletions
sdk/openbr_plugin.cpp
| @@ -797,16 +797,17 @@ bool br::Context::checkSDKPath(const QString &sdkPath) | @@ -797,16 +797,17 @@ bool br::Context::checkSDKPath(const QString &sdkPath) | ||
| 797 | void br::Context::initialize(int argc, char *argv[], const QString &sdkPath) | 797 | void br::Context::initialize(int argc, char *argv[], const QString &sdkPath) |
| 798 | { | 798 | { |
| 799 | if (Globals == NULL) { | 799 | if (Globals == NULL) { |
| 800 | - Globals = new Context(); | ||
| 801 | - Globals->init(File()); | ||
| 802 | - } | ||
| 803 | - | 800 | + // QApplication should be initialzed before anything else |
| 804 | #ifndef BR_EMBEDDED | 801 | #ifndef BR_EMBEDDED |
| 805 | - Globals->coreApplication = QSharedPointer<QCoreApplication>(new QApplication(argc, argv)); | 802 | + static QApplication application(argc, argv); |
| 806 | #else | 803 | #else |
| 807 | - Globals->coreApplication = QSharedPointer<QCoreApplication>(new QCoreApplication(argc, argv)); | 804 | + static QCoreApplication coreApplication(argc, argv); |
| 808 | #endif | 805 | #endif |
| 809 | 806 | ||
| 807 | + Globals = new Context(); | ||
| 808 | + Globals->init(File()); | ||
| 809 | + } | ||
| 810 | + | ||
| 810 | initializeQt(sdkPath); | 811 | initializeQt(sdkPath); |
| 811 | 812 | ||
| 812 | #ifdef BR_DISTRIBUTED | 813 | #ifdef BR_DISTRIBUTED |
sdk/openbr_plugin.h
| @@ -17,7 +17,6 @@ | @@ -17,7 +17,6 @@ | ||
| 17 | #ifndef __OPENBR_PLUGIN_H | 17 | #ifndef __OPENBR_PLUGIN_H |
| 18 | #define __OPENBR_PLUGIN_H | 18 | #define __OPENBR_PLUGIN_H |
| 19 | 19 | ||
| 20 | -#include <QCoreApplication> | ||
| 21 | #include <QDataStream> | 20 | #include <QDataStream> |
| 22 | #include <QDebug> | 21 | #include <QDebug> |
| 23 | #include <QDir> | 22 | #include <QDir> |
| @@ -466,7 +465,6 @@ private: | @@ -466,7 +465,6 @@ private: | ||
| 466 | class BR_EXPORT Context : public Object | 465 | class BR_EXPORT Context : public Object |
| 467 | { | 466 | { |
| 468 | Q_OBJECT | 467 | Q_OBJECT |
| 469 | - QSharedPointer<QCoreApplication> coreApplication; | ||
| 470 | QFile logFile; | 468 | QFile logFile; |
| 471 | 469 | ||
| 472 | public: | 470 | public: |
sdk/plugins/gallery.cpp
| @@ -677,7 +677,7 @@ class googleGallery : public Gallery | @@ -677,7 +677,7 @@ class googleGallery : public Gallery | ||
| 677 | QNetworkReply *reply = networkAccessManager.get(request); | 677 | QNetworkReply *reply = networkAccessManager.get(request); |
| 678 | 678 | ||
| 679 | while (!reply->isFinished()) | 679 | while (!reply->isFinished()) |
| 680 | - QCoreApplication::processEvents(); | 680 | + QThread::yieldCurrentThread(); |
| 681 | 681 | ||
| 682 | QString data(reply->readAll()); | 682 | QString data(reply->readAll()); |
| 683 | delete reply; | 683 | delete reply; |