summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@theqtcompany.com>2015-06-30 13:28:31 +0200
committerTor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>2015-10-16 18:07:32 +0000
commitc751cef8d6fe3e6bee1ec9a0466094b3255ca037 (patch)
tree5726e6c2da79343d03bae35978efe3a13f63822c
parent40b4c305d82e75d23842348a537972a0d2f15887 (diff)
Move QEventDispatcherCoreFoundation to QtCore
Export it for use by the iOS platform plugin. Also move QCFSocketNotifier, and export for use by the Cocoa platform plugin. This is a pure code move with no intended behavior changes, in anticipation of using the Core Foundation event dispatcher as the default Qt Core event dispatcher on OS X. Change-Id: I43677d2f6f3c1d0ed0415c964225aa97d2f13078 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
-rw-r--r--src/corelib/kernel/kernel.pri13
-rw-r--r--src/corelib/kernel/qcfsocketnotifier.cpp (renamed from src/platformsupport/cfsocketnotifier/qcfsocketnotifier.cpp)8
-rw-r--r--src/corelib/kernel/qcfsocketnotifier_p.h (renamed from src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h)4
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf.mm (renamed from src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm)2
-rw-r--r--src/corelib/kernel/qeventdispatcher_cf_p.h (renamed from src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h)6
-rw-r--r--src/platformsupport/cfsocketnotifier/cfsocketnotifier.pri4
-rw-r--r--src/platformsupport/eventdispatchers/eventdispatchers.pri8
-rw-r--r--src/platformsupport/platformsupport.pro1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaeventdispatcher.h2
-rw-r--r--src/plugins/platforms/ios/qioseventdispatcher.h2
10 files changed, 23 insertions, 27 deletions
diff --git a/src/corelib/kernel/kernel.pri b/src/corelib/kernel/kernel.pri
index 65dc44def2..600c28b5d7 100644
--- a/src/corelib/kernel/kernel.pri
+++ b/src/corelib/kernel/kernel.pri
@@ -100,9 +100,11 @@ winrt {
mac {
HEADERS += \
+ kernel/qcfsocketnotifier_p.h \
kernel/qcore_mac_p.h
SOURCES += \
+ kernel/qcfsocketnotifier.cpp \
kernel/qcoreapplication_mac.cpp \
kernel/qcore_mac.cpp
@@ -113,8 +115,15 @@ mac {
osx: LIBS_PRIVATE += -framework CoreServices
- # We need UIKit for UIDevice
- ios: LIBS_PRIVATE += -framework UIKit
+ ios {
+ OBJECTIVE_SOURCES += \
+ kernel/qeventdispatcher_cf.mm
+ HEADERS += \
+ kernel/qeventdispatcher_cf_p.h
+
+ # We need UIKit for UIDevice
+ LIBS_PRIVATE += -framework UIKit
+ }
}
nacl {
diff --git a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier.cpp b/src/corelib/kernel/qcfsocketnotifier.cpp
index c58e0ea78d..19f9e744b8 100644
--- a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier.cpp
+++ b/src/corelib/kernel/qcfsocketnotifier.cpp
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@@ -32,7 +32,7 @@
****************************************************************************/
#include "qcfsocketnotifier_p.h"
-#include <QtGui/qguiapplication.h>
+#include <QtCore/qcoreapplication.h>
#include <QtCore/qsocketnotifier.h>
#include <QtCore/qthread.h>
@@ -57,12 +57,12 @@ void qt_mac_socket_callback(CFSocketRef s, CFSocketCallBackType callbackType, CF
if (callbackType == kCFSocketReadCallBack) {
if (socketInfo->readNotifier && socketInfo->readEnabled) {
socketInfo->readEnabled = false;
- QGuiApplication::sendEvent(socketInfo->readNotifier, &notifierEvent);
+ QCoreApplication::sendEvent(socketInfo->readNotifier, &notifierEvent);
}
} else if (callbackType == kCFSocketWriteCallBack) {
if (socketInfo->writeNotifier && socketInfo->writeEnabled) {
socketInfo->writeEnabled = false;
- QGuiApplication::sendEvent(socketInfo->writeNotifier, &notifierEvent);
+ QCoreApplication::sendEvent(socketInfo->writeNotifier, &notifierEvent);
}
}
diff --git a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h b/src/corelib/kernel/qcfsocketnotifier_p.h
index 9bccc1bf98..947efecca3 100644
--- a/src/platformsupport/cfsocketnotifier/qcfsocketnotifier_p.h
+++ b/src/corelib/kernel/qcfsocketnotifier_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the QtGui module of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@@ -75,7 +75,7 @@ typedef void (*MaybeCancelWaitForMoreEventsFn)(QAbstractEventDispatcher *hostEve
// setHostEventDispatcher() should be called at startup.
// removeSocketNotifiers() should be called at shutdown.
//
-class QCFSocketNotifier
+class Q_CORE_EXPORT QCFSocketNotifier
{
public:
QCFSocketNotifier();
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm b/src/corelib/kernel/qeventdispatcher_cf.mm
index 0273fe5ed4..5b9ad38b28 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf.mm
+++ b/src/corelib/kernel/qeventdispatcher_cf.mm
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
diff --git a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h b/src/corelib/kernel/qeventdispatcher_cf_p.h
index 2fe5dea3d8..5e8d2f0c85 100644
--- a/src/platformsupport/eventdispatchers/qeventdispatcher_cf_p.h
+++ b/src/corelib/kernel/qeventdispatcher_cf_p.h
@@ -3,7 +3,7 @@
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
-** This file is part of the plugins of the Qt Toolkit.
+** This file is part of the QtCore module of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL21$
** Commercial License Usage
@@ -83,8 +83,8 @@
#include <QtCore/qabstracteventdispatcher.h>
#include <QtCore/private/qtimerinfo_unix_p.h>
+#include <QtCore/private/qcfsocketnotifier_p.h>
#include <QtCore/qdebug.h>
-#include <QtPlatformSupport/private/qcfsocketnotifier_p.h>
#include <CoreFoundation/CoreFoundation.h>
#ifdef __OBJC__
@@ -196,7 +196,7 @@ private:
CFRunLoopObserverRef m_observer;
};
-class QEventDispatcherCoreFoundation : public QAbstractEventDispatcher
+class Q_CORE_EXPORT QEventDispatcherCoreFoundation : public QAbstractEventDispatcher
{
Q_OBJECT
diff --git a/src/platformsupport/cfsocketnotifier/cfsocketnotifier.pri b/src/platformsupport/cfsocketnotifier/cfsocketnotifier.pri
deleted file mode 100644
index 9a19d3c278..0000000000
--- a/src/platformsupport/cfsocketnotifier/cfsocketnotifier.pri
+++ /dev/null
@@ -1,4 +0,0 @@
-mac {
- HEADERS += $$PWD/qcfsocketnotifier_p.h
- SOURCES += $$PWD/qcfsocketnotifier.cpp
-}
diff --git a/src/platformsupport/eventdispatchers/eventdispatchers.pri b/src/platformsupport/eventdispatchers/eventdispatchers.pri
index c9bbe1f5b7..6e16a46b34 100644
--- a/src/platformsupport/eventdispatchers/eventdispatchers.pri
+++ b/src/platformsupport/eventdispatchers/eventdispatchers.pri
@@ -8,14 +8,6 @@ HEADERS +=\
$$PWD/qgenericunixeventdispatcher_p.h\
}
-ios {
-OBJECTIVE_SOURCES +=\
- $$PWD/qeventdispatcher_cf.mm
-
-HEADERS +=\
- $$PWD/qeventdispatcher_cf_p.h
-}
-
contains(QT_CONFIG, glib) {
SOURCES +=$$PWD/qeventdispatcher_glib.cpp
HEADERS +=$$PWD/qeventdispatcher_glib_p.h
diff --git a/src/platformsupport/platformsupport.pro b/src/platformsupport/platformsupport.pro
index 34e2ed3c9b..1ea6d0eb69 100644
--- a/src/platformsupport/platformsupport.pro
+++ b/src/platformsupport/platformsupport.pro
@@ -7,7 +7,6 @@ mac:LIBS_PRIVATE += -lz
DEFINES += QT_NO_CAST_FROM_ASCII
PRECOMPILED_HEADER = ../corelib/global/qt_pch.h
-include(cfsocketnotifier/cfsocketnotifier.pri)
include(cglconvenience/cglconvenience.pri)
include(eglconvenience/eglconvenience.pri)
include(eventdispatchers/eventdispatchers.pri)
diff --git a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
index 4a2cb42f87..8a2a478a72 100644
--- a/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
+++ b/src/plugins/platforms/cocoa/qcocoaeventdispatcher.h
@@ -83,8 +83,8 @@
#include <QtCore/qstack.h>
#include <QtGui/qwindowdefs.h>
#include <QtCore/private/qabstracteventdispatcher_p.h>
+#include <QtCore/private/qcfsocketnotifier_p.h>
#include <QtCore/private/qtimerinfo_unix_p.h>
-#include <QtPlatformSupport/private/qcfsocketnotifier_p.h>
#include <CoreFoundation/CoreFoundation.h>
diff --git a/src/plugins/platforms/ios/qioseventdispatcher.h b/src/plugins/platforms/ios/qioseventdispatcher.h
index e8ea1cc28b..98977eb670 100644
--- a/src/plugins/platforms/ios/qioseventdispatcher.h
+++ b/src/plugins/platforms/ios/qioseventdispatcher.h
@@ -34,7 +34,7 @@
#ifndef QIOSEVENTDISPATCHER_H
#define QIOSEVENTDISPATCHER_H
-#include <QtPlatformSupport/private/qeventdispatcher_cf_p.h>
+#include <QtCore/private/qeventdispatcher_cf_p.h>
QT_BEGIN_NAMESPACE