Factor out usage of a private symbol by the iOS platform plugin.

This fixes a link error due to symbol visibility when the iOS
platform plugin is built as a shared library.

Change-Id: I0b454c5c5033c6b598cede11ce5e3a85e5704c4a
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
Jake Petroules 2016-02-17 09:17:16 -08:00
parent 34adce75c4
commit d40aca0840
3 changed files with 11 additions and 5 deletions

View File

@ -210,6 +210,13 @@ QEventDispatcherCoreFoundation::~QEventDispatcherCoreFoundation()
m_cfSocketNotifier.removeSocketNotifiers();
}
QEventLoop *QEventDispatcherCoreFoundation::currentEventLoop() const
{
QEventLoop *eventLoop = QThreadData::current()->eventLoops.top();
Q_ASSERT(eventLoop);
return eventLoop;
}
/*!
Processes all pending events that match \a flags until there are no
more events to process. Returns \c true if pending events were handled;
@ -302,10 +309,7 @@ bool QEventDispatcherCoreFoundation::processEvents(QEventLoop::ProcessEventsFlag
// to exit, and then unwind back to the previous event loop which will break
// immediately, since it has already been exited.
QEventLoop *currentEventLoop = QThreadData::current()->eventLoops.top();
Q_ASSERT(currentEventLoop);
if (!currentEventLoop->isRunning()) {
if (!currentEventLoop()->isRunning()) {
qEventDispatcherDebug() << "Top level event loop was exited";
break;
} else {

View File

@ -228,6 +228,8 @@ public:
void flush();
protected:
QEventLoop *currentEventLoop() const;
virtual bool processPostedEvents();
struct ProcessEventsState

View File

@ -493,7 +493,7 @@ void QIOSEventDispatcher::handleRunLoopExit(CFRunLoopActivity activity)
Q_UNUSED(activity);
Q_ASSERT(activity == kCFRunLoopExit);
if (m_processEventLevel == 1 && !QThreadData::current()->eventLoops.top()->isRunning()) {
if (m_processEventLevel == 1 && !currentEventLoop()->isRunning()) {
qEventDispatcherDebug() << "Root runloop level exited";
interruptEventLoopExec();
}