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