summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2019-10-17 09:41:36 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2019-10-17 09:41:36 +0200
commit02164e0288f714f1ea93afb32548548686773d1d (patch)
treed7ed16267f7659af63e78c8de8915ed0208b598b /src/plugins
parent4a7e7103e713448c05d9d30cab8b7e52406b46a6 (diff)
parent6f27bb135246b7fe9d11ba58e05d2b7661bc2080 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/bearer/android/src/qandroidbearerengine.cpp2
-rw-r--r--src/plugins/bearer/android/src/qandroidbearerengine.h2
-rw-r--r--src/plugins/bearer/android/src/src.pro7
-rw-r--r--src/plugins/bearer/connman/connman.pro7
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.cpp2
-rw-r--r--src/plugins/bearer/connman/qconnmanengine.h2
-rw-r--r--src/plugins/bearer/corewlan/corewlan.pro7
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.h2
-rw-r--r--src/plugins/bearer/corewlan/qcorewlanengine.mm11
-rw-r--r--src/plugins/bearer/generic/generic.pro3
-rw-r--r--src/plugins/bearer/generic/qgenericengine.cpp2
-rw-r--r--src/plugins/bearer/generic/qgenericengine.h2
-rw-r--r--src/plugins/bearer/nativewifi/nativewifi.pro7
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.cpp2
-rw-r--r--src/plugins/bearer/nativewifi/qnativewifiengine.h2
-rw-r--r--src/plugins/bearer/networkmanager/networkmanager.pro7
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp2
-rw-r--r--src/plugins/bearer/networkmanager/qnetworkmanagerengine.h2
-rw-r--r--src/plugins/bearer/nla/nla.pro7
-rw-r--r--src/plugins/bearer/nla/qnlaengine.cpp2
-rw-r--r--src/plugins/bearer/nla/qnlaengine.h2
-rw-r--r--src/plugins/bearer/qbearerengine_impl.h81
-rw-r--r--src/plugins/bearer/qnetworksession_impl.cpp435
-rw-r--r--src/plugins/bearer/qnetworksession_impl.h130
-rw-r--r--src/plugins/platforms/android/android.pro1
-rw-r--r--src/plugins/platforms/android/androidplatformplugin.cpp64
-rw-r--r--src/plugins/platforms/android/main.cpp1
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibility.h6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h2
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplication.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm2
-rw-r--r--src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.h10
-rw-r--r--src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm21
-rw-r--r--src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm4
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenu.h5
-rw-r--r--src/plugins/platforms/cocoa/qcocoamenubar.mm6
-rw-r--r--src/plugins/platforms/cocoa/qcocoansmenu.h13
-rw-r--r--src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm11
-rw-r--r--src/plugins/platforms/cocoa/qcocoatheme.h2
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h19
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm26
-rw-r--r--src/plugins/platforms/cocoa/qnsview_accessibility.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_complextext.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview_dragging.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_drawing.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_gestures.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_keys.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview_menus.mm4
-rw-r--r--src/plugins/platforms/cocoa/qnsview_mouse.mm8
-rw-r--r--src/plugins/platforms/cocoa/qnsview_tablet.mm2
-rw-r--r--src/plugins/platforms/cocoa/qnsview_touch.mm2
-rw-r--r--src/plugins/platforms/cocoa/qprintengine_mac_p.h6
-rw-r--r--src/plugins/platforms/windows/qwindowscontext.cpp26
-rw-r--r--src/plugins/platforms/windows/qwindowsservices.cpp27
56 files changed, 119 insertions, 913 deletions
diff --git a/src/plugins/bearer/android/src/qandroidbearerengine.cpp b/src/plugins/bearer/android/src/qandroidbearerengine.cpp
index a43ed69570..ad9895e0cf 100644
--- a/src/plugins/bearer/android/src/qandroidbearerengine.cpp
+++ b/src/plugins/bearer/android/src/qandroidbearerengine.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qandroidbearerengine.h"
-#include "../../qnetworksession_impl.h"
+#include <private/qnetworksession_impl_p.h>
#include "wrappers/androidconnectivitymanager.h"
#ifndef QT_NO_BEARERMANAGEMENT
diff --git a/src/plugins/bearer/android/src/qandroidbearerengine.h b/src/plugins/bearer/android/src/qandroidbearerengine.h
index 837b02232d..867d04d886 100644
--- a/src/plugins/bearer/android/src/qandroidbearerengine.h
+++ b/src/plugins/bearer/android/src/qandroidbearerengine.h
@@ -40,7 +40,7 @@
#ifndef QANDROIDBEARERENGINE_H
#define QANDROIDBEARERENGINE_H
-#include "../../qbearerengine_impl.h"
+#include <private/qbearerengine_impl_p.h>
#include <QAbstractEventDispatcher>
#include <QAbstractNativeEventFilter>
diff --git a/src/plugins/bearer/android/src/src.pro b/src/plugins/bearer/android/src/src.pro
index eb0738386c..fcd599dffe 100644
--- a/src/plugins/bearer/android/src/src.pro
+++ b/src/plugins/bearer/android/src/src.pro
@@ -2,13 +2,10 @@ TARGET = qandroidbearer
QT = core-private network-private
-HEADERS += qandroidbearerengine.h \
- ../../qnetworksession_impl.h \
- ../../qbearerengine_impl.h
+HEADERS += qandroidbearerengine.h
SOURCES += main.cpp \
- qandroidbearerengine.cpp \
- ../../qnetworksession_impl.cpp
+ qandroidbearerengine.cpp
include(wrappers/wrappers.pri)
diff --git a/src/plugins/bearer/connman/connman.pro b/src/plugins/bearer/connman/connman.pro
index 065ed11dad..d6577e9d7f 100644
--- a/src/plugins/bearer/connman/connman.pro
+++ b/src/plugins/bearer/connman/connman.pro
@@ -4,15 +4,12 @@ QT = core network-private dbus
HEADERS += qconnmanservice_linux_p.h \
../linux_common/qofonoservice_linux_p.h \
- qconnmanengine.h \
- ../qnetworksession_impl.h \
- ../qbearerengine_impl.h
+ qconnmanengine.h
SOURCES += main.cpp \
qconnmanservice_linux.cpp \
../linux_common/qofonoservice_linux.cpp \
- qconnmanengine.cpp \
- ../qnetworksession_impl.cpp
+ qconnmanengine.cpp
OTHER_FILES += connman.json
diff --git a/src/plugins/bearer/connman/qconnmanengine.cpp b/src/plugins/bearer/connman/qconnmanengine.cpp
index 8b2076bd18..a673834825 100644
--- a/src/plugins/bearer/connman/qconnmanengine.cpp
+++ b/src/plugins/bearer/connman/qconnmanengine.cpp
@@ -39,7 +39,7 @@
#include "qconnmanengine.h"
#include "qconnmanservice_linux_p.h"
-#include "../qnetworksession_impl.h"
+#include <private/qnetworksession_impl_p.h>
#include <QtNetwork/private/qnetworkconfiguration_p.h>
diff --git a/src/plugins/bearer/connman/qconnmanengine.h b/src/plugins/bearer/connman/qconnmanengine.h
index ef80d38fa2..eb79dbec1b 100644
--- a/src/plugins/bearer/connman/qconnmanengine.h
+++ b/src/plugins/bearer/connman/qconnmanengine.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include "../qbearerengine_impl.h"
+#include <private/qbearerengine_impl_p.h>
#include "qconnmanservice_linux_p.h"
#include "../linux_common/qofonoservice_linux_p.h"
diff --git a/src/plugins/bearer/corewlan/corewlan.pro b/src/plugins/bearer/corewlan/corewlan.pro
index 1dc09ebdd6..4f08eaba71 100644
--- a/src/plugins/bearer/corewlan/corewlan.pro
+++ b/src/plugins/bearer/corewlan/corewlan.pro
@@ -7,12 +7,9 @@ qtConfig(corewlan) {
LIBS += -framework CoreWLAN -framework Security
}
-HEADERS += qcorewlanengine.h \
- ../qnetworksession_impl.h \
- ../qbearerengine_impl.h
+HEADERS += qcorewlanengine.h
-SOURCES += main.cpp \
- ../qnetworksession_impl.cpp
+SOURCES += main.cpp
OBJECTIVE_SOURCES += qcorewlanengine.mm
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.h b/src/plugins/bearer/corewlan/qcorewlanengine.h
index 6dddee66a4..8775474c09 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.h
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.h
@@ -40,7 +40,7 @@
#ifndef QCOREWLANENGINE_H
#define QCOREWLANENGINE_H
-#include "../qbearerengine_impl.h"
+#include <private/qbearerengine_impl_p.h>
#include <QMap>
#include <QTimer>
diff --git a/src/plugins/bearer/corewlan/qcorewlanengine.mm b/src/plugins/bearer/corewlan/qcorewlanengine.mm
index 4644b5af9f..01c6df74d5 100644
--- a/src/plugins/bearer/corewlan/qcorewlanengine.mm
+++ b/src/plugins/bearer/corewlan/qcorewlanengine.mm
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qcorewlanengine.h"
-#include "../qnetworksession_impl.h"
+#include <private/qnetworksession_impl_p.h>
#include <QtNetwork/private/qnetworkconfiguration_p.h>
@@ -62,12 +62,11 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
#include <ifaddrs.h>
@interface QT_MANGLE_NAMESPACE(QNSListener) : NSObject <CWEventDelegate>
-
@property (assign) QCoreWlanEngine* engine;
-
@end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSListener);
-@implementation QT_MANGLE_NAMESPACE(QNSListener) {
+@implementation QNSListener {
NSNotificationCenter *notificationCenter;
CWWiFiClient *client;
QCoreWlanEngine *engine;
@@ -88,7 +87,7 @@ extern "C" { // Otherwise it won't find CWKeychain* symbols at link time
return self;
}
-static QT_MANGLE_NAMESPACE(QNSListener) *listener = 0;
+static QNSListener *listener = 0;
-(void)dealloc
{
@@ -415,7 +414,7 @@ void QCoreWlanEngine::initialize()
QMacAutoReleasePool pool;
if ([[CWWiFiClient interfaceNames] count] > 0 && !listener) {
- listener = [[QT_MANGLE_NAMESPACE(QNSListener) alloc] init];
+ listener = [QNSListener alloc] init];
listener.engine = this;
hasWifi = true;
} else {
diff --git a/src/plugins/bearer/generic/generic.pro b/src/plugins/bearer/generic/generic.pro
index f30bdc4951..14b858b301 100644
--- a/src/plugins/bearer/generic/generic.pro
+++ b/src/plugins/bearer/generic/generic.pro
@@ -3,11 +3,8 @@ TARGET = qgenericbearer
QT = core-private network-private
HEADERS += qgenericengine.h \
- ../qnetworksession_impl.h \
- ../qbearerengine_impl.h \
../platformdefs_win.h
SOURCES += qgenericengine.cpp \
- ../qnetworksession_impl.cpp \
main.cpp
OTHER_FILES += generic.json
diff --git a/src/plugins/bearer/generic/qgenericengine.cpp b/src/plugins/bearer/generic/qgenericengine.cpp
index b1f28849a7..a5fba15789 100644
--- a/src/plugins/bearer/generic/qgenericengine.cpp
+++ b/src/plugins/bearer/generic/qgenericengine.cpp
@@ -41,7 +41,7 @@
#define WIN32_LEAN_AND_MEAN 1
#include "qgenericengine.h"
-#include "../qnetworksession_impl.h"
+#include <private/qnetworksession_impl_p.h>
#include <QtNetwork/private/qnetworkconfiguration_p.h>
diff --git a/src/plugins/bearer/generic/qgenericengine.h b/src/plugins/bearer/generic/qgenericengine.h
index 79c71ca7a3..6b8fb4cd0f 100644
--- a/src/plugins/bearer/generic/qgenericengine.h
+++ b/src/plugins/bearer/generic/qgenericengine.h
@@ -40,7 +40,7 @@
#ifndef QGENERICENGINE_H
#define QGENERICENGINE_H
-#include "../qbearerengine_impl.h"
+#include <private/qbearerengine_impl_p.h>
#include <QMap>
#include <QTimer>
diff --git a/src/plugins/bearer/nativewifi/nativewifi.pro b/src/plugins/bearer/nativewifi/nativewifi.pro
index da7f2da353..41bde99341 100644
--- a/src/plugins/bearer/nativewifi/nativewifi.pro
+++ b/src/plugins/bearer/nativewifi/nativewifi.pro
@@ -3,13 +3,10 @@ TARGET = qnativewifibearer
QT = core-private network-private
HEADERS += qnativewifiengine.h \
- platformdefs.h \
- ../qnetworksession_impl.h \
- ../qbearerengine_impl.h
+ platformdefs.h
SOURCES += main.cpp \
- qnativewifiengine.cpp \
- ../qnetworksession_impl.cpp
+ qnativewifiengine.cpp
OTHER_FILES += nativewifi.json
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
index 777b4eea59..ca8700e63b 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.cpp
@@ -39,7 +39,7 @@
#include "qnativewifiengine.h"
#include "platformdefs.h"
-#include "../qnetworksession_impl.h"
+#include <private/qnetworksession_impl_p.h>
#include <QtNetwork/private/qnetworkconfiguration_p.h>
diff --git a/src/plugins/bearer/nativewifi/qnativewifiengine.h b/src/plugins/bearer/nativewifi/qnativewifiengine.h
index ab8d949c9a..24e97bf6df 100644
--- a/src/plugins/bearer/nativewifi/qnativewifiengine.h
+++ b/src/plugins/bearer/nativewifi/qnativewifiengine.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include "../qbearerengine_impl.h"
+#include <private/qbearerengine_impl_p.h>
#include <QtCore/qtimer.h>
diff --git a/src/plugins/bearer/networkmanager/networkmanager.pro b/src/plugins/bearer/networkmanager/networkmanager.pro
index e71c93f66f..3fbad07ef5 100644
--- a/src/plugins/bearer/networkmanager/networkmanager.pro
+++ b/src/plugins/bearer/networkmanager/networkmanager.pro
@@ -4,15 +4,12 @@ QT = core network-private dbus
HEADERS += qnetworkmanagerservice.h \
qnetworkmanagerengine.h \
- ../linux_common/qofonoservice_linux_p.h \
- ../qnetworksession_impl.h \
- ../qbearerengine_impl.h
+ ../linux_common/qofonoservice_linux_p.h
SOURCES += main.cpp \
qnetworkmanagerservice.cpp \
qnetworkmanagerengine.cpp \
- ../linux_common/qofonoservice_linux.cpp \
- ../qnetworksession_impl.cpp
+ ../linux_common/qofonoservice_linux.cpp
OTHER_FILES += networkmanager.json
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
index e74b1cf744..d686bc4e51 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.cpp
@@ -39,7 +39,7 @@
#include "qnetworkmanagerengine.h"
#include "qnetworkmanagerservice.h"
-#include "../qnetworksession_impl.h"
+#include <private/qnetworksession_impl_p.h>
#include <QtNetwork/private/qnetworkconfiguration_p.h>
diff --git a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
index a95c68abdf..c6c5280eca 100644
--- a/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
+++ b/src/plugins/bearer/networkmanager/qnetworkmanagerengine.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include "../qbearerengine_impl.h"
+#include <private/qbearerengine_impl_p.h>
#include "qnetworkmanagerservice.h"
diff --git a/src/plugins/bearer/nla/nla.pro b/src/plugins/bearer/nla/nla.pro
index 76f3279d25..2582dc7cd4 100644
--- a/src/plugins/bearer/nla/nla.pro
+++ b/src/plugins/bearer/nla/nla.pro
@@ -5,13 +5,10 @@ QT = core core-private network network-private
QMAKE_USE_PRIVATE += ws2_32
HEADERS += qnlaengine.h \
- ../platformdefs_win.h \
- ../qnetworksession_impl.h \
- ../qbearerengine_impl.h
+ ../platformdefs_win.h
SOURCES += main.cpp \
- qnlaengine.cpp \
- ../qnetworksession_impl.cpp
+ qnlaengine.cpp
OTHER_FILES += nla.json
diff --git a/src/plugins/bearer/nla/qnlaengine.cpp b/src/plugins/bearer/nla/qnlaengine.cpp
index e1e60389f1..ab3c0d0e3a 100644
--- a/src/plugins/bearer/nla/qnlaengine.cpp
+++ b/src/plugins/bearer/nla/qnlaengine.cpp
@@ -38,7 +38,7 @@
****************************************************************************/
#include "qnlaengine.h"
-#include "../qnetworksession_impl.h"
+#include <private/qnetworksession_impl_p.h>
#include <QtNetwork/private/qnetworkconfiguration_p.h>
diff --git a/src/plugins/bearer/nla/qnlaengine.h b/src/plugins/bearer/nla/qnlaengine.h
index ab014ff776..90efa50201 100644
--- a/src/plugins/bearer/nla/qnlaengine.h
+++ b/src/plugins/bearer/nla/qnlaengine.h
@@ -51,7 +51,7 @@
// We mean it.
//
-#include "../qbearerengine_impl.h"
+#include <private/qbearerengine_impl_p.h>
#include <QtNetwork/private/qnativesocketengine_p.h>
diff --git a/src/plugins/bearer/qbearerengine_impl.h b/src/plugins/bearer/qbearerengine_impl.h
deleted file mode 100644
index 5c003aaaf6..0000000000
--- a/src/plugins/bearer/qbearerengine_impl.h
+++ /dev/null
@@ -1,81 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QBEARERENGINE_IMPL_H
-#define QBEARERENGINE_IMPL_H
-
-#include <QtNetwork/private/qbearerengine_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QBearerEngineImpl : public QBearerEngine
-{
- Q_OBJECT
-
-public:
- enum ConnectionError {
- InterfaceLookupError = 0,
- ConnectError,
- OperationNotSupported,
- DisconnectionError,
- };
-
- QBearerEngineImpl(QObject *parent = nullptr) : QBearerEngine(parent) {}
- ~QBearerEngineImpl() {}
-
- virtual void connectToId(const QString &id) = 0;
- virtual void disconnectFromId(const QString &id) = 0;
-
- virtual QString getInterfaceFromId(const QString &id) = 0;
-
- virtual QNetworkSession::State sessionStateForId(const QString &id) = 0;
-
- virtual quint64 bytesWritten(const QString &) { return Q_UINT64_C(0); }
- virtual quint64 bytesReceived(const QString &) { return Q_UINT64_C(0); }
- virtual quint64 startTime(const QString &) { return Q_UINT64_C(0); }
-
-Q_SIGNALS:
- void connectionError(const QString &id, QBearerEngineImpl::ConnectionError error);
-};
-
-QT_END_NAMESPACE
-
-Q_DECLARE_METATYPE(QBearerEngineImpl::ConnectionError)
-
-#endif // QBEARERENGINE_IMPL_H
diff --git a/src/plugins/bearer/qnetworksession_impl.cpp b/src/plugins/bearer/qnetworksession_impl.cpp
deleted file mode 100644
index c6b678ab20..0000000000
--- a/src/plugins/bearer/qnetworksession_impl.cpp
+++ /dev/null
@@ -1,435 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-// see comment in ../platformdefs_win.h.
-#define WIN32_LEAN_AND_MEAN 1
-
-#include "qnetworksession_impl.h"
-#include "qbearerengine_impl.h"
-
-#include <QtNetwork/qnetworksession.h>
-#include <QtNetwork/private/qnetworkconfigmanager_p.h>
-
-#include <QtCore/qdatetime.h>
-#include <QtCore/qdebug.h>
-#include <QtCore/qmutex.h>
-#include <QtCore/qstringlist.h>
-
-QT_BEGIN_NAMESPACE
-
-static QBearerEngineImpl *getEngineFromId(const QString &id)
-{
- QNetworkConfigurationManagerPrivate *priv = qNetworkConfigurationManagerPrivate();
- if (priv) {
- const auto engines = priv->engines();
- for (QBearerEngine *engine : engines) {
- QBearerEngineImpl *engineImpl = qobject_cast<QBearerEngineImpl *>(engine);
- if (engineImpl && engineImpl->hasIdentifier(id))
- return engineImpl;
- }
- }
-
- return 0;
-}
-
-class QNetworkSessionManagerPrivate : public QObject
-{
- Q_OBJECT
-
-public:
- QNetworkSessionManagerPrivate(QObject *parent = 0) : QObject(parent) {}
- ~QNetworkSessionManagerPrivate() {}
-
- inline void forceSessionClose(const QNetworkConfiguration &config)
- { emit forcedSessionClose(config); }
-
-Q_SIGNALS:
- void forcedSessionClose(const QNetworkConfiguration &config);
-};
-
-Q_GLOBAL_STATIC(QNetworkSessionManagerPrivate, sessionManager);
-
-void QNetworkSessionPrivateImpl::syncStateWithInterface()
-{
- connect(sessionManager(), SIGNAL(forcedSessionClose(QNetworkConfiguration)),
- this, SLOT(forcedSessionClose(QNetworkConfiguration)));
-
- opened = false;
- isOpen = false;
- state = QNetworkSession::Invalid;
- lastError = QNetworkSession::UnknownSessionError;
-
- qRegisterMetaType<QBearerEngineImpl::ConnectionError>();
-
- switch (publicConfig.type()) {
- case QNetworkConfiguration::InternetAccessPoint:
- activeConfig = publicConfig;
- engine = getEngineFromId(activeConfig.identifier());
- if (engine) {
- qRegisterMetaType<QNetworkConfigurationPrivatePointer>();
- connect(engine, SIGNAL(configurationChanged(QNetworkConfigurationPrivatePointer)),
- this, SLOT(configurationChanged(QNetworkConfigurationPrivatePointer)),
- Qt::QueuedConnection);
- connect(engine, SIGNAL(connectionError(QString,QBearerEngineImpl::ConnectionError)),
- this, SLOT(connectionError(QString,QBearerEngineImpl::ConnectionError)),
- Qt::QueuedConnection);
- }
- break;
- case QNetworkConfiguration::ServiceNetwork:
- serviceConfig = publicConfig;
- // Defer setting engine and signals until open().
- Q_FALLTHROUGH();
- case QNetworkConfiguration::UserChoice:
- // Defer setting serviceConfig and activeConfig until open().
- Q_FALLTHROUGH();
- default:
- engine = 0;
- }
-
- networkConfigurationsChanged();
-}
-
-void QNetworkSessionPrivateImpl::open()
-{
- if (serviceConfig.isValid()) {
- lastError = QNetworkSession::OperationNotSupportedError;
- emit QNetworkSessionPrivate::error(lastError);
- } else if (!isOpen) {
- if ((activeConfig.state() & QNetworkConfiguration::Discovered) != QNetworkConfiguration::Discovered) {
- lastError = QNetworkSession::InvalidConfigurationError;
- state = QNetworkSession::Invalid;
- emit stateChanged(state);
- emit QNetworkSessionPrivate::error(lastError);
- return;
- }
- opened = true;
-
- if ((activeConfig.state() & QNetworkConfiguration::Active) != QNetworkConfiguration::Active &&
- (activeConfig.state() & QNetworkConfiguration::Discovered) == QNetworkConfiguration::Discovered) {
- state = QNetworkSession::Connecting;
- emit stateChanged(state);
-
- engine->connectToId(activeConfig.identifier());
- }
-
- isOpen = (activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active;
- if (isOpen)
- emit quitPendingWaitsForOpened();
- }
-}
-
-void QNetworkSessionPrivateImpl::close()
-{
- if (serviceConfig.isValid()) {
- lastError = QNetworkSession::OperationNotSupportedError;
- emit QNetworkSessionPrivate::error(lastError);
- } else if (isOpen) {
- opened = false;
- isOpen = false;
- emit closed();
- }
-}
-
-void QNetworkSessionPrivateImpl::stop()
-{
- if (serviceConfig.isValid()) {
- lastError = QNetworkSession::OperationNotSupportedError;
- emit QNetworkSessionPrivate::error(lastError);
- } else {
- if ((activeConfig.state() & QNetworkConfiguration::Active) == QNetworkConfiguration::Active) {
- state = QNetworkSession::Closing;
- emit stateChanged(state);
-
- engine->disconnectFromId(activeConfig.identifier());
-
- sessionManager()->forceSessionClose(activeConfig);
- }
-
- opened = false;
- isOpen = false;
- emit closed();
- }
-}
-
-void QNetworkSessionPrivateImpl::migrate()
-{
-}
-
-void QNetworkSessionPrivateImpl::accept()
-{
-}
-
-void QNetworkSessionPrivateImpl::ignore()
-{
-}
-
-void QNetworkSessionPrivateImpl::reject()
-{
-}
-
-#ifndef QT_NO_NETWORKINTERFACE
-QNetworkInterface QNetworkSessionPrivateImpl::currentInterface() const
-{
- if (!engine || state != QNetworkSession::Connected || !publicConfig.isValid())
- return QNetworkInterface();
-
- QString iface = engine->getInterfaceFromId(activeConfig.identifier());
- if (iface.isEmpty())
- return QNetworkInterface();
- return QNetworkInterface::interfaceFromName(iface);
-}
-#endif
-
-QVariant QNetworkSessionPrivateImpl::sessionProperty(const QString &key) const
-{
- if (key == QLatin1String("AutoCloseSessionTimeout")) {
- if (engine && engine->requiresPolling() &&
- !(engine->capabilities() & QNetworkConfigurationManager::CanStartAndStopInterfaces)) {
- return sessionTimeout >= 0 ? sessionTimeout * 10000 : -1;
- }
- }
-
- return QVariant();
-}
-
-void QNetworkSessionPrivateImpl::setSessionProperty(const QString &key, const QVariant &value)
-{
- if (key == QLatin1String("AutoCloseSessionTimeout")) {
- if (engine && engine->requiresPolling() &&
- !(engine->capabilities() & QNetworkConfigurationManager::CanStartAndStopInterfaces)) {
- int timeout = value.toInt();
- if (timeout >= 0) {
- connect(engine, SIGNAL(updateCompleted()),
- this, SLOT(decrementTimeout()), Qt::UniqueConnection);
- sessionTimeout = timeout / 10000; // convert to poll intervals
- } else {
- disconnect(engine, SIGNAL(updateCompleted()), this, SLOT(decrementTimeout()));
- sessionTimeout = -1;
- }
- }
- }
-}
-
-QString QNetworkSessionPrivateImpl::errorString() const
-{
- switch (lastError) {
- case QNetworkSession::UnknownSessionError:
- return tr("Unknown session error.");
- case QNetworkSession::SessionAbortedError:
- return tr("The session was aborted by the user or system.");
- case QNetworkSession::OperationNotSupportedError:
- return tr("The requested operation is not supported by the system.");
- case QNetworkSession::InvalidConfigurationError:
- return tr("The specified configuration cannot be used.");
- case QNetworkSession::RoamingError:
- return tr("Roaming was aborted or is not possible.");
- default:
- break;
- }
-
- return QString();
-}
-
-QNetworkSession::SessionError QNetworkSessionPrivateImpl::error() const
-{
- return lastError;
-}
-
-quint64 QNetworkSessionPrivateImpl::bytesWritten() const
-{
- if (engine && state == QNetworkSession::Connected)
- return engine->bytesWritten(activeConfig.identifier());
- return Q_UINT64_C(0);
-}
-
-quint64 QNetworkSessionPrivateImpl::bytesReceived() const
-{
- if (engine && state == QNetworkSession::Connected)
- return engine->bytesReceived(activeConfig.identifier());
- return Q_UINT64_C(0);
-}
-
-quint64 QNetworkSessionPrivateImpl::activeTime() const
-{
- if (state == QNetworkSession::Connected && startTime != Q_UINT64_C(0))
- return QDateTime::currentSecsSinceEpoch() - startTime;
- return Q_UINT64_C(0);
-}
-
-QNetworkSession::UsagePolicies QNetworkSessionPrivateImpl::usagePolicies() const
-{
- return currentPolicies;
-}
-
-void QNetworkSessionPrivateImpl::setUsagePolicies(QNetworkSession::UsagePolicies newPolicies)
-{
- if (newPolicies != currentPolicies) {
- currentPolicies = newPolicies;
- emit usagePoliciesChanged(currentPolicies);
- }
-}
-
-void QNetworkSessionPrivateImpl::updateStateFromServiceNetwork()
-{
- QNetworkSession::State oldState = state;
-
- const auto configs = serviceConfig.children();
- for (const QNetworkConfiguration &config : configs) {
- if ((config.state() & QNetworkConfiguration::Active) != QNetworkConfiguration::Active)
- continue;
-
- if (activeConfig != config) {
- if (engine) {
- disconnect(engine, SIGNAL(connectionError(QString,QBearerEngineImpl::ConnectionError)),
- this, SLOT(connectionError(QString,QBearerEngineImpl::ConnectionError)));
- }
-
- activeConfig = config;
- engine = getEngineFromId(activeConfig.identifier());
-
- if (engine) {
- connect(engine, SIGNAL(connectionError(QString,QBearerEngineImpl::ConnectionError)),
- this, SLOT(connectionError(QString,QBearerEngineImpl::ConnectionError)),
- Qt::QueuedConnection);
- }
- emit newConfigurationActivated();
- }
-
- state = QNetworkSession::Connected;
- if (state != oldState)
- emit stateChanged(state);
-
- return;
- }
-
- if (serviceConfig.children().isEmpty())
- state = QNetworkSession::NotAvailable;
- else
- state = QNetworkSession::Disconnected;
-
- if (state != oldState)
- emit stateChanged(state);
-}
-
-void QNetworkSessionPrivateImpl::updateStateFromActiveConfig()
-{
- if (!engine)
- return;
-
- QNetworkSession::State oldState = state;
- state = engine->sessionStateForId(activeConfig.identifier());
-
- bool oldActive = isOpen;
- isOpen = (state == QNetworkSession::Connected) ? opened : false;
-
- if (!oldActive && isOpen)
- emit quitPendingWaitsForOpened();
- if (oldActive && !isOpen)
- emit closed();
-
- if (oldState != state)
- emit stateChanged(state);
-}
-
-void QNetworkSessionPrivateImpl::networkConfigurationsChanged()
-{
- if (serviceConfig.isValid())
- updateStateFromServiceNetwork();
- else
- updateStateFromActiveConfig();
-
- if (engine)
- startTime = engine->startTime(activeConfig.identifier());
-}
-
-void QNetworkSessionPrivateImpl::configurationChanged(QNetworkConfigurationPrivatePointer config)
-{
- if (serviceConfig.isValid() &&
- (config->id == serviceConfig.identifier() || config->id == activeConfig.identifier())) {
- updateStateFromServiceNetwork();
- } else if (config->id == activeConfig.identifier()) {
- updateStateFromActiveConfig();
- }
-}
-
-void QNetworkSessionPrivateImpl::forcedSessionClose(const QNetworkConfiguration &config)
-{
- if (activeConfig == config) {
- opened = false;
- isOpen = false;
-
- emit closed();
-
- lastError = QNetworkSession::SessionAbortedError;
- emit QNetworkSessionPrivate::error(lastError);
- }
-}
-
-void QNetworkSessionPrivateImpl::connectionError(const QString &id, QBearerEngineImpl::ConnectionError error)
-{
- if (activeConfig.identifier() == id) {
- networkConfigurationsChanged();
- switch (error) {
- case QBearerEngineImpl::OperationNotSupported:
- lastError = QNetworkSession::OperationNotSupportedError;
- opened = false;
- break;
- case QBearerEngineImpl::InterfaceLookupError:
- case QBearerEngineImpl::ConnectError:
- case QBearerEngineImpl::DisconnectionError:
- default:
- lastError = QNetworkSession::UnknownSessionError;
- }
-
- emit QNetworkSessionPrivate::error(lastError);
- }
-}
-
-void QNetworkSessionPrivateImpl::decrementTimeout()
-{
- if (--sessionTimeout <= 0) {
- disconnect(engine, SIGNAL(updateCompleted()), this, SLOT(decrementTimeout()));
- sessionTimeout = -1;
- close();
- }
-}
-
-QT_END_NAMESPACE
-
-#include "qnetworksession_impl.moc"
diff --git a/src/plugins/bearer/qnetworksession_impl.h b/src/plugins/bearer/qnetworksession_impl.h
deleted file mode 100644
index 0f8e014900..0000000000
--- a/src/plugins/bearer/qnetworksession_impl.h
+++ /dev/null
@@ -1,130 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef QNETWORKSESSION_IMPL_H
-#define QNETWORKSESSION_IMPL_H
-
-//
-// W A R N I N G
-// -------------
-//
-// This file is not part of the Qt API. It exists purely as an
-// implementation detail. This header file may change from version to
-// version without notice, or even be removed.
-//
-// We mean it.
-//
-
-#include "qbearerengine_impl.h"
-
-#include <QtNetwork/private/qnetworkconfigmanager_p.h>
-#include <QtNetwork/private/qnetworksession_p.h>
-
-QT_BEGIN_NAMESPACE
-
-class QBearerEngineImpl;
-
-class QNetworkSessionPrivateImpl : public QNetworkSessionPrivate
-{
- Q_OBJECT
-
-public:
- QNetworkSessionPrivateImpl()
- : engine(nullptr), startTime(0), lastError(QNetworkSession::UnknownSessionError), sessionTimeout(-1), currentPolicies(QNetworkSession::NoPolicy), opened(false)
- {}
- ~QNetworkSessionPrivateImpl()
- {}
-
- //called by QNetworkSession constructor and ensures
- //that the state is immediately updated (w/o actually opening
- //a session). Also this function should take care of
- //notification hooks to discover future state changes.
- void syncStateWithInterface() override;
-
-#ifndef QT_NO_NETWORKINTERFACE
- QNetworkInterface currentInterface() const override;
-#endif
- QVariant sessionProperty(const QString& key) const override;
- void setSessionProperty(const QString& key, const QVariant& value) override;
-
- void open() override;
- void close() override;
- void stop() override;
- void migrate() override;
- void accept() override;
- void ignore() override;
- void reject() override;
-
- QString errorString() const override; //must return translated string
- QNetworkSession::SessionError error() const override;
-
- quint64 bytesWritten() const override;
- quint64 bytesReceived() const override;
- quint64 activeTime() const override;
-
- QNetworkSession::UsagePolicies usagePolicies() const override;
- void setUsagePolicies(QNetworkSession::UsagePolicies) override;
-
-private Q_SLOTS:
- void networkConfigurationsChanged();
- void configurationChanged(QNetworkConfigurationPrivatePointer config);
- void forcedSessionClose(const QNetworkConfiguration &config);
- void connectionError(const QString &id, QBearerEngineImpl::ConnectionError error);
- void decrementTimeout();
-
-private:
- void updateStateFromServiceNetwork();
- void updateStateFromActiveConfig();
-
-private:
- QBearerEngineImpl *engine;
-
- quint64 startTime;
-
- QNetworkSession::SessionError lastError;
-
- int sessionTimeout;
- QNetworkSession::UsagePolicies currentPolicies;
-
- bool opened;
-};
-
-QT_END_NAMESPACE
-
-#endif // QNETWORKSESSION_IMPL_H
diff --git a/src/plugins/platforms/android/android.pro b/src/plugins/platforms/android/android.pro
index 730247cd7f..61cac51633 100644
--- a/src/plugins/platforms/android/android.pro
+++ b/src/plugins/platforms/android/android.pro
@@ -16,7 +16,6 @@ INCLUDEPATH += \
$$QT_SOURCE_TREE/src/3rdparty/android
SOURCES += $$PWD/main.cpp \
- $$PWD/androidplatformplugin.cpp \
$$PWD/androidcontentfileengine.cpp \
$$PWD/androiddeadlockprotector.cpp \
$$PWD/androidjnimain.cpp \
diff --git a/src/plugins/platforms/android/androidplatformplugin.cpp b/src/plugins/platforms/android/androidplatformplugin.cpp
deleted file mode 100644
index 297e167f47..0000000000
--- a/src/plugins/platforms/android/androidplatformplugin.cpp
+++ /dev/null
@@ -1,64 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2012 BogDan Vatra <bogdan@kde.org>
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the plugins of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include <qpa/qplatformintegrationplugin.h>
-#include "qandroidplatformintegration.h"
-
-QT_BEGIN_NAMESPACE
-
-class QAndroidPlatformIntegrationPlugin: public QPlatformIntegrationPlugin
-{
- Q_OBJECT
- Q_PLUGIN_METADATA(IID QPlatformIntegrationFactoryInterface_iid FILE "android.json")
-public:
- QPlatformIntegration *create(const QString &key, const QStringList &paramList) override;
-};
-
-
-QPlatformIntegration *QAndroidPlatformIntegrationPlugin::create(const QString &key, const QStringList &paramList)
-{
- Q_UNUSED(paramList);
- if (!key.compare(QLatin1String("android"), Qt::CaseInsensitive))
- return new QAndroidPlatformIntegration(paramList);
- return 0;
-}
-
-QT_END_NAMESPACE
-#include "androidplatformplugin.moc"
-
diff --git a/src/plugins/platforms/android/main.cpp b/src/plugins/platforms/android/main.cpp
index c304fc8d69..4841d0425c 100644
--- a/src/plugins/platforms/android/main.cpp
+++ b/src/plugins/platforms/android/main.cpp
@@ -61,3 +61,4 @@ QPlatformIntegration *QAndroidIntegrationPlugin::create(const QString& system, c
}
QT_END_NAMESPACE
+#include "main.moc"
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibility.h b/src/plugins/platforms/cocoa/qcocoaaccessibility.h
index 457c158ddc..539d876094 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibility.h
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibility.h
@@ -44,9 +44,9 @@
#include <QtGui>
#include <qpa/qplatformaccessibility.h>
-#ifndef QT_NO_ACCESSIBILITY
+#include "qcocoaaccessibilityelement.h"
-@class QT_MANGLE_NAMESPACE(QMacAccessibilityElement);
+#ifndef QT_NO_ACCESSIBILITY
QT_BEGIN_NAMESPACE
@@ -84,7 +84,7 @@ namespace QCocoaAccessible {
NSString *macRole(QAccessibleInterface *interface);
NSString *macSubrole(QAccessibleInterface *interface);
bool shouldBeIgnored(QAccessibleInterface *interface);
-NSArray<QT_MANGLE_NAMESPACE(QMacAccessibilityElement) *> *unignoredChildren(QAccessibleInterface *interface);
+NSArray<QMacAccessibilityElement *> *unignoredChildren(QAccessibleInterface *interface);
NSString *getTranslatedAction(const QString &qtAction);
QString translateAction(NSString *nsAction, QAccessibleInterface *interface);
bool hasValueAttribute(QAccessibleInterface *interface);
diff --git a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
index 7fbe729381..141ce6bf1a 100644
--- a/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
+++ b/src/plugins/platforms/cocoa/qcocoaaccessibilityelement.h
@@ -50,8 +50,6 @@
#import <qaccessible.h>
-@class QT_MANGLE_NAMESPACE(QMacAccessibilityElement);
-
@interface QT_MANGLE_NAMESPACE(QMacAccessibilityElement) : NSObject <NSAccessibilityElement>
- (instancetype)initWithId:(QAccessible::Id)anId;
diff --git a/src/plugins/platforms/cocoa/qcocoaapplication.mm b/src/plugins/platforms/cocoa/qcocoaapplication.mm
index 340191622a..c6029bcf03 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplication.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplication.mm
@@ -144,7 +144,7 @@ static void qt_maybeSendKeyEquivalentUpEvent(NSEvent *event)
}
}
-@implementation QT_MANGLE_NAMESPACE(QNSApplication)
+@implementation QNSApplication
- (void)QT_MANGLE_NAMESPACE(qt_sendEvent_original):(NSEvent *)event
{
@@ -188,7 +188,7 @@ void qt_redirectNSApplicationSendEvent()
// can be unloaded.
return;
- if ([NSApp isMemberOfClass:[QT_MANGLE_NAMESPACE(QNSApplication) class]]) {
+ if ([NSApp isMemberOfClass:[QNSApplication class]]) {
// No need to change implementation since Qt
// already controls a subclass of NSApplication
return;
@@ -201,7 +201,7 @@ void qt_redirectNSApplicationSendEvent()
qt_cocoa_change_implementation(
[NSApplication class],
@selector(sendEvent:),
- [QT_MANGLE_NAMESPACE(QNSApplication) class],
+ [QNSApplication class],
@selector(QT_MANGLE_NAMESPACE(qt_sendEvent_replacement):),
@selector(QT_MANGLE_NAMESPACE(qt_sendEvent_original):));
}
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
index 0816730c54..8ec9d6fbe0 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.h
@@ -89,8 +89,7 @@
#include <qglobal.h>
#include <private/qcore_mac_p.h>
-
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem));
+#include "qcocoansmenu.h"
@interface QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) : NSObject <NSApplicationDelegate>
@property (nonatomic, retain) NSMenu *dockMenu;
@@ -100,8 +99,9 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem));
- (bool)inLaunch;
@end
-@interface QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) (MenuAPI)
-- (void)qt_itemFired:(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem) *)item;
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaApplicationDelegate);
+
+@interface QCocoaApplicationDelegate (MenuAPI)
+- (void)qt_itemFired:(QCocoaNSMenuItem *)item;
@end
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaApplicationDelegate);
diff --git a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
index 2df85c791b..00f5a1bf09 100644
--- a/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
+++ b/src/plugins/platforms/cocoa/qcocoaapplicationdelegate.mm
@@ -145,7 +145,7 @@ QT_USE_NAMESPACE
[[NSApp mainMenu] cancelTracking];
bool handle_quit = true;
- NSMenuItem *quitMenuItem = [[QT_MANGLE_NAMESPACE(QCocoaMenuLoader) sharedMenuLoader] quitMenuItem];
+ NSMenuItem *quitMenuItem = [[QCocoaMenuLoader sharedMenuLoader] quitMenuItem];
if (!QGuiApplicationPrivate::instance()->modalWindowList.isEmpty()
&& [quitMenuItem isEnabled]) {
int visible = 0;
diff --git a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
index d7850b1481..c9fa035d87 100644
--- a/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoacolordialoghelper.mm
@@ -293,7 +293,7 @@ class QCocoaColorPanel
public:
QCocoaColorPanel()
{
- mDelegate = [[QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) alloc] init];
+ mDelegate = [[QNSColorPanelDelegate alloc] init];
}
~QCocoaColorPanel()
@@ -366,7 +366,7 @@ public:
}
private:
- QT_MANGLE_NAMESPACE(QNSColorPanelDelegate) *mDelegate;
+ QNSColorPanelDelegate *mDelegate;
};
Q_GLOBAL_STATIC(QCocoaColorPanel, sharedColorPanel)
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
index 2ddda14289..dd0afbefe6 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.h
@@ -43,10 +43,16 @@
#include <QObject>
#include <QtWidgets/qtwidgetsglobal.h>
#include <qpa/qplatformdialoghelper.h>
+#include <QtCore/private/qcore_mac_p.h>
+
+#import <AppKit/NSSavePanel.h>
QT_REQUIRE_CONFIG(filedialog);
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate));
+@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) : NSObject<NSOpenSavePanelDelegate>
+@end
+
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
QT_BEGIN_NAMESPACE
@@ -84,7 +90,7 @@ public:
void QNSOpenSavePanelDelegate_filterSelected(int menuIndex);
private:
- QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate) *mDelegate;
+ QNSOpenSavePanelDelegate *mDelegate;
QUrl mDir;
};
diff --git a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
index 03677ef0bc..6aa21d78d1 100644
--- a/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafiledialoghelper.mm
@@ -76,27 +76,6 @@ QT_USE_NAMESPACE
typedef QSharedPointer<QFileDialogOptions> SharedPointerFileDialogOptions;
-@interface QT_MANGLE_NAMESPACE(QNSOpenSavePanelDelegate)
- : NSObject<NSOpenSavePanelDelegate>
-
-- (NSString *)strip:(const QString &)label;
-- (BOOL)panel:(id)sender shouldEnableURL:(NSURL *)url;
-- (void)filterChanged:(id)sender;
-- (void)showModelessPanel;
-- (BOOL)runApplicationModalPanel;
-- (void)showWindowModalSheet:(QWindow *)docWidget;
-- (void)updateProperties;
-- (QStringList)acceptableExtensionsForSave;
-- (QString)removeExtensions:(const QString &)filter;
-- (void)createTextField;
-- (void)createPopUpButton:(const QString &)selectedFilter hideDetails:(BOOL)hideDetails;
-- (QStringList)findStrippedFilterWithVisualFilterName:(QString)name;
-- (void)createAccessory;
-
-@end
-
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSOpenSavePanelDelegate);
-
@implementation QNSOpenSavePanelDelegate {
@public
NSOpenPanel *mOpenPanel;
diff --git a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
index 8c0af97a68..7748c304e3 100644
--- a/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
+++ b/src/plugins/platforms/cocoa/qcocoafontdialoghelper.mm
@@ -283,7 +283,7 @@ class QCocoaFontPanel
public:
QCocoaFontPanel()
{
- mDelegate = [[QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) alloc] init];
+ mDelegate = [[QNSFontPanelDelegate alloc] init];
}
~QCocoaFontPanel()
@@ -356,7 +356,7 @@ public:
}
private:
- QT_MANGLE_NAMESPACE(QNSFontPanelDelegate) *mDelegate;
+ QNSFontPanelDelegate *mDelegate;
};
Q_GLOBAL_STATIC(QCocoaFontPanel, sharedFontPanel)
diff --git a/src/plugins/platforms/cocoa/qcocoamenu.h b/src/plugins/platforms/cocoa/qcocoamenu.h
index a957710a88..1dccf0621c 100644
--- a/src/plugins/platforms/cocoa/qcocoamenu.h
+++ b/src/plugins/platforms/cocoa/qcocoamenu.h
@@ -44,8 +44,7 @@
#include <QtCore/QList>
#include <qpa/qplatformmenu.h>
#include "qcocoamenuitem.h"
-
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenu));
+#include "qcocoansmenu.h"
QT_BEGIN_NAMESPACE
@@ -107,7 +106,7 @@ private:
void scheduleUpdate();
QList<QCocoaMenuItem *> m_menuItems;
- QT_MANGLE_NAMESPACE(QCocoaNSMenu) *m_nativeMenu;
+ QCocoaNSMenu *m_nativeMenu;
NSMenuItem *m_attachedItem;
int m_updateTimer;
bool m_enabled:1;
diff --git a/src/plugins/platforms/cocoa/qcocoamenubar.mm b/src/plugins/platforms/cocoa/qcocoamenubar.mm
index 30bff78a36..363defdd28 100644
--- a/src/plugins/platforms/cocoa/qcocoamenubar.mm
+++ b/src/plugins/platforms/cocoa/qcocoamenubar.mm
@@ -278,12 +278,11 @@ void QCocoaMenuBar::updateMenuBarImmediately()
// we still have to update the menubar.
if ((win->flags() & Qt::WindowType_Mask) != Qt::Tool)
return;
- typedef QT_MANGLE_NAMESPACE(QCocoaApplicationDelegate) AppDelegate;
NSApplication *app = [NSApplication sharedApplication];
- if (![app.delegate isKindOfClass:[AppDelegate class]])
+ if (![app.delegate isKindOfClass:[QCocoaApplicationDelegate class]])
return;
// We apply this logic _only_ during the startup.
- AppDelegate *appDelegate = app.delegate;
+ QCocoaApplicationDelegate *appDelegate = app.delegate;
if (!appDelegate.inLaunch)
return;
}
@@ -403,3 +402,4 @@ QCocoaWindow *QCocoaMenuBar::cocoaWindow() const
QT_END_NAMESPACE
+#include "moc_qcocoamenubar.cpp"
diff --git a/src/plugins/platforms/cocoa/qcocoansmenu.h b/src/plugins/platforms/cocoa/qcocoansmenu.h
index 6cbb6e4a01..0c77e2f1aa 100644
--- a/src/plugins/platforms/cocoa/qcocoansmenu.h
+++ b/src/plugins/platforms/cocoa/qcocoansmenu.h
@@ -59,31 +59,20 @@ QT_FORWARD_DECLARE_CLASS(QCocoaMenu);
QT_FORWARD_DECLARE_CLASS(QCocoaMenuItem);
@interface QT_MANGLE_NAMESPACE(QCocoaNSMenuDelegate) : NSObject <NSMenuDelegate>
-
+ (instancetype)sharedMenuDelegate;
-
-- (NSMenuItem *)findItemInMenu:(NSMenu *)menu
- forKey:(NSString *)key
- modifiers:(NSUInteger)modifiers;
-
+- (NSMenuItem *)findItemInMenu:(NSMenu *)menu forKey:(NSString *)key modifiers:(NSUInteger)modifiers;
@end
@interface QT_MANGLE_NAMESPACE(QCocoaNSMenu) : NSMenu
-
@property (readonly, nonatomic) QCocoaMenu *platformMenu;
-
- (instancetype)initWithPlatformMenu:(QCocoaMenu *)menu;
-
@end
@interface QT_MANGLE_NAMESPACE(QCocoaNSMenuItem) : NSMenuItem
-
@property (nonatomic) QCocoaMenuItem *platformMenuItem;
-
+ (instancetype)separatorItemWithPlatformMenuItem:(QCocoaMenuItem *)menuItem;
- (instancetype)initWithPlatformMenuItem:(QCocoaMenuItem *)menuItem;
- (instancetype)init;
-
@end
QT_NAMESPACE_ALIAS_OBJC_CLASS(QCocoaNSMenu);
diff --git a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
index 1390ace632..559188aa5f 100644
--- a/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
+++ b/src/plugins/platforms/cocoa/qcocoasystemtrayicon.mm
@@ -80,6 +80,8 @@
#include <qimagewriter.h>
#include <qdebug.h>
+#include <QtCore/private/qcore_mac_p.h>
+
#include "qcocoamenu.h"
#include "qt_mac_p.h"
@@ -92,8 +94,6 @@
QT_USE_NAMESPACE
-@class QT_MANGLE_NAMESPACE(QNSImageView);
-
@interface QT_MANGLE_NAMESPACE(QNSStatusItem) : NSObject <NSUserNotificationCenterDelegate>
@property (nonatomic, assign) QCocoaMenu *menu;
@property (nonatomic, assign) QIcon icon;
@@ -104,12 +104,13 @@ QT_USE_NAMESPACE
- (void)doubleClickSelector:(id)sender;
@end
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSStatusItem);
+
@interface QT_MANGLE_NAMESPACE(QNSImageView) : NSImageView
@property (nonatomic, assign) BOOL down;
-@property (nonatomic, assign) QT_MANGLE_NAMESPACE(QNSStatusItem) *parent;
+@property (nonatomic, assign) QNSStatusItem *parent;
@end
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSStatusItem);
QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSImageView);
QT_BEGIN_NAMESPACE
@@ -364,7 +365,7 @@ QT_END_NAMESPACE
@implementation QNSStatusItem {
QCocoaSystemTrayIcon *systray;
NSStatusItem *item;
- QT_MANGLE_NAMESPACE(QNSImageView) *imageCell;
+ QNSImageView *imageCell;
}
@synthesize menu = menu;
diff --git a/src/plugins/platforms/cocoa/qcocoatheme.h b/src/plugins/platforms/cocoa/qcocoatheme.h
index 788b616e78..a00cbdfea3 100644
--- a/src/plugins/platforms/cocoa/qcocoatheme.h
+++ b/src/plugins/platforms/cocoa/qcocoatheme.h
@@ -43,8 +43,6 @@
#include <QtCore/QHash>
#include <qpa/qplatformtheme.h>
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaThemeAppAppearanceObserver));
-
#include <QtCore/private/qcore_mac_p.h>
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index b40dfe0d14..74d0735b4c 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -51,37 +51,30 @@ class QCocoaGLContext;
class QPointF;
QT_END_NAMESPACE
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
-Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QCocoaNSMenuItem));
-
@interface QT_MANGLE_NAMESPACE(QNSView) : NSView
-
@property (nonatomic, retain) NSCursor *cursor;
-
- (instancetype)initWithCocoaWindow:(QCocoaWindow *)platformWindow;
-
- (void)convertFromScreen:(NSPoint)mouseLocation toWindowPoint:(QPointF *)qtWindowPoint andScreenPoint:(QPointF *)qtScreenPoint;
-
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (MouseAPI)
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSView);
+
+@interface QNSView (MouseAPI)
- (void)handleFrameStrutMouseEvent:(NSEvent *)theEvent;
- (void)resetMouseButtons;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (KeysAPI)
+@interface QNSView (KeysAPI)
+ (Qt::KeyboardModifiers)convertKeyModifiers:(ulong)modifierFlags;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (ComplexTextAPI)
+@interface QNSView (ComplexTextAPI)
- (void)unmarkText;
- (void)cancelComposingText;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (QtExtras)
+@interface QNSView (QtExtras)
@property (nonatomic, readonly) QCocoaWindow *platformWindow;
@end
-QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSView);
-
#endif //QNSVIEW_H
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 5309449dce..a6e5ca5f7b 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -66,13 +66,13 @@
#include "qcocoaintegration.h"
// Private interface
-@interface QT_MANGLE_NAMESPACE(QNSView) ()
+@interface QNSView ()
- (BOOL)isTransparentForUserInput;
@property (assign) NSView* previousSuperview;
@property (assign) NSWindow* previousWindow;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Drawing) <CALayerDelegate>
+@interface QNSView (Drawing) <CALayerDelegate>
- (void)initDrawing;
@end
@@ -84,7 +84,9 @@
- (void)cursorUpdate:(NSEvent *)theEvent;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Mouse)
+QT_NAMESPACE_ALIAS_OBJC_CLASS(QNSViewMouseMoveHelper);
+
+@interface QNSView (Mouse)
- (void)initMouse;
- (NSPoint)screenMousePoint:(NSEvent *)theEvent;
- (void)mouseMovedImpl:(NSEvent *)theEvent;
@@ -92,28 +94,28 @@
- (void)mouseExitedImpl:(NSEvent *)theEvent;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Touch)
+@interface QNSView (Touch)
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Tablet)
+@interface QNSView (Tablet)
- (bool)handleTabletEvent:(NSEvent *)theEvent;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Gestures)
+@interface QNSView (Gestures)
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Dragging)
+@interface QNSView (Dragging)
-(void)registerDragTypes;
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (Keys)
+@interface QNSView (Keys)
@end
-@interface QT_MANGLE_NAMESPACE(QNSView) (ComplexText) <NSTextInputClient>
+@interface QNSView (ComplexText) <NSTextInputClient>
- (void)textInputContextKeyboardSelectionDidChangeNotification:(NSNotification *)textInputContextKeyboardSelectionDidChangeNotification;
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) {
+@implementation QNSView {
QPointer<QCocoaWindow> m_platformWindow;
Qt::MouseButtons m_buttons;
Qt::MouseButtons m_acceptedMouseDowns;
@@ -125,7 +127,7 @@
bool m_sendUpAsRightButton;
Qt::KeyboardModifiers m_currentWheelModifiers;
NSString *m_inputSource;
- QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) *m_mouseMoveHelper;
+ QNSViewMouseMoveHelper *m_mouseMoveHelper;
bool m_resendKeyEvent;
bool m_scrolling;
bool m_updatingDrag;
@@ -379,7 +381,7 @@
// -----------------------------------------------------
-@implementation QT_MANGLE_NAMESPACE(QNSView) (QtExtras)
+@implementation QNSView (QtExtras)
- (QCocoaWindow*)platformWindow
{
diff --git a/src/plugins/platforms/cocoa/qnsview_accessibility.mm b/src/plugins/platforms/cocoa/qnsview_accessibility.mm
index 32ec0b74d4..7041e14da7 100644
--- a/src/plugins/platforms/cocoa/qnsview_accessibility.mm
+++ b/src/plugins/platforms/cocoa/qnsview_accessibility.mm
@@ -47,7 +47,7 @@
#import <AppKit/NSAccessibility.h>
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Accessibility)
+@implementation QNSView (Accessibility)
- (id)childAccessibleElement
{
diff --git a/src/plugins/platforms/cocoa/qnsview_complextext.mm b/src/plugins/platforms/cocoa/qnsview_complextext.mm
index 6ff9b26ca4..5926840cf3 100644
--- a/src/plugins/platforms/cocoa/qnsview_complextext.mm
+++ b/src/plugins/platforms/cocoa/qnsview_complextext.mm
@@ -39,7 +39,7 @@
// This file is included from qnsview.mm, and only used to organize the code
-@implementation QT_MANGLE_NAMESPACE(QNSView) (ComplexTextAPI)
+@implementation QNSView (ComplexTextAPI)
- (void)cancelComposingText
{
@@ -80,7 +80,7 @@
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (ComplexText)
+@implementation QNSView (ComplexText)
- (void)insertNewline:(id)sender
{
diff --git a/src/plugins/platforms/cocoa/qnsview_dragging.mm b/src/plugins/platforms/cocoa/qnsview_dragging.mm
index 41b96b2df6..650612e7ff 100644
--- a/src/plugins/platforms/cocoa/qnsview_dragging.mm
+++ b/src/plugins/platforms/cocoa/qnsview_dragging.mm
@@ -39,7 +39,7 @@
// This file is included from qnsview.mm, and only used to organize the code
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Dragging)
+@implementation QNSView (Dragging)
-(void)registerDragTypes
{
diff --git a/src/plugins/platforms/cocoa/qnsview_drawing.mm b/src/plugins/platforms/cocoa/qnsview_drawing.mm
index ce5488ead0..eb9286519d 100644
--- a/src/plugins/platforms/cocoa/qnsview_drawing.mm
+++ b/src/plugins/platforms/cocoa/qnsview_drawing.mm
@@ -39,7 +39,7 @@
// This file is included from qnsview.mm, and only used to organize the code
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Drawing)
+@implementation QNSView (Drawing)
- (void)initDrawing
{
diff --git a/src/plugins/platforms/cocoa/qnsview_gestures.mm b/src/plugins/platforms/cocoa/qnsview_gestures.mm
index f6cd3af4da..a80261fd6a 100644
--- a/src/plugins/platforms/cocoa/qnsview_gestures.mm
+++ b/src/plugins/platforms/cocoa/qnsview_gestures.mm
@@ -43,7 +43,7 @@
Q_LOGGING_CATEGORY(lcQpaGestures, "qt.qpa.input.gestures")
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Gestures)
+@implementation QNSView (Gestures)
- (bool)handleGestureAsBeginEnd:(NSEvent *)event
{
diff --git a/src/plugins/platforms/cocoa/qnsview_keys.mm b/src/plugins/platforms/cocoa/qnsview_keys.mm
index ad751279bb..847adca207 100644
--- a/src/plugins/platforms/cocoa/qnsview_keys.mm
+++ b/src/plugins/platforms/cocoa/qnsview_keys.mm
@@ -39,7 +39,7 @@
// This file is included from qnsview.mm, and only used to organize the code
-@implementation QT_MANGLE_NAMESPACE(QNSView) (KeysAPI)
+@implementation QNSView (KeysAPI)
+ (Qt::KeyboardModifiers)convertKeyModifiers:(ulong)modifierFlags
{
@@ -60,7 +60,7 @@
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Keys)
+@implementation QNSView (Keys)
- (int)convertKeyCode:(QChar)keyChar
{
diff --git a/src/plugins/platforms/cocoa/qnsview_menus.mm b/src/plugins/platforms/cocoa/qnsview_menus.mm
index f0489552aa..a55fd97eb7 100644
--- a/src/plugins/platforms/cocoa/qnsview_menus.mm
+++ b/src/plugins/platforms/cocoa/qnsview_menus.mm
@@ -53,11 +53,11 @@ static bool selectorIsCutCopyPaste(SEL selector)
|| selector == @selector(selectAll:));
}
-@interface QT_MANGLE_NAMESPACE(QNSView) (Menus)
+@interface QNSView (Menus)
- (void)qt_itemFired:(QCocoaNSMenuItem *)item;
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Menus)
+@implementation QNSView (Menus)
- (BOOL)validateMenuItem:(NSMenuItem*)item
{
diff --git a/src/plugins/platforms/cocoa/qnsview_mouse.mm b/src/plugins/platforms/cocoa/qnsview_mouse.mm
index 30613eca32..9e2761f850 100644
--- a/src/plugins/platforms/cocoa/qnsview_mouse.mm
+++ b/src/plugins/platforms/cocoa/qnsview_mouse.mm
@@ -55,7 +55,7 @@
interact with the responder chain by e.g. calling super if Qt does not
accept the mouse event
*/
-@implementation QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) {
+@implementation QNSViewMouseMoveHelper {
QNSView *view;
}
@@ -89,7 +89,7 @@
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (MouseAPI)
+@implementation QNSView (MouseAPI)
- (void)resetMouseButtons
{
@@ -178,7 +178,7 @@
}
@end
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Mouse)
+@implementation QNSView (Mouse)
- (void)initMouse
{
@@ -193,7 +193,7 @@
m_dontOverrideCtrlLMB = qt_mac_resolveOption(false, m_platformWindow->window(),
"_q_platform_MacDontOverrideCtrlLMB", "QT_MAC_DONT_OVERRIDE_CTRL_LMB");
- m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self];
+ m_mouseMoveHelper = [[QNSViewMouseMoveHelper alloc] initWithView:self];
NSUInteger trackingOptions = NSTrackingActiveInActiveApp
| NSTrackingMouseEnteredAndExited | NSTrackingCursorUpdate;
diff --git a/src/plugins/platforms/cocoa/qnsview_tablet.mm b/src/plugins/platforms/cocoa/qnsview_tablet.mm
index 43b0aa0960..ba1fa55892 100644
--- a/src/plugins/platforms/cocoa/qnsview_tablet.mm
+++ b/src/plugins/platforms/cocoa/qnsview_tablet.mm
@@ -54,7 +54,7 @@ struct QCocoaTabletDeviceData
typedef QHash<uint, QCocoaTabletDeviceData> QCocoaTabletDeviceDataHash;
Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Tablet)
+@implementation QNSView (Tablet)
- (bool)handleTabletEvent:(NSEvent *)theEvent
{
diff --git a/src/plugins/platforms/cocoa/qnsview_touch.mm b/src/plugins/platforms/cocoa/qnsview_touch.mm
index 9330844aec..8dfae27c63 100644
--- a/src/plugins/platforms/cocoa/qnsview_touch.mm
+++ b/src/plugins/platforms/cocoa/qnsview_touch.mm
@@ -41,7 +41,7 @@
Q_LOGGING_CATEGORY(lcQpaTouch, "qt.qpa.input.touch")
-@implementation QT_MANGLE_NAMESPACE(QNSView) (Touch)
+@implementation QNSView (Touch)
- (bool)shouldSendSingleTouch
{
diff --git a/src/plugins/platforms/cocoa/qprintengine_mac_p.h b/src/plugins/platforms/cocoa/qprintengine_mac_p.h
index 3d94227ae4..6a1ed2e263 100644
--- a/src/plugins/platforms/cocoa/qprintengine_mac_p.h
+++ b/src/plugins/platforms/cocoa/qprintengine_mac_p.h
@@ -64,11 +64,7 @@
#include "qpaintengine_mac_p.h"
-#ifdef __OBJC__
-@class NSPrintInfo;
-#else
-typedef void NSPrintInfo;
-#endif
+Q_FORWARD_DECLARE_OBJC_CLASS(NSPrintInfo);
QT_BEGIN_NAMESPACE
diff --git a/src/plugins/platforms/windows/qwindowscontext.cpp b/src/plugins/platforms/windows/qwindowscontext.cpp
index f5b0dced93..9757fa5f3f 100644
--- a/src/plugins/platforms/windows/qwindowscontext.cpp
+++ b/src/plugins/platforms/windows/qwindowscontext.cpp
@@ -79,6 +79,7 @@
#include <QtCore/qscopedpointer.h>
#include <QtCore/quuid.h>
#include <QtCore/private/qsystemlibrary_p.h>
+#include <QtCore/private/qwinregistry_p.h>
#include <QtEventDispatcherSupport/private/qwindowsguieventdispatcher_p.h>
@@ -1518,28 +1519,13 @@ QTouchDevice *QWindowsContext::touchDevice() const
d->m_pointerHandler.touchDevice() : d->m_mouseHandler.touchDevice();
}
-static DWORD readDwordRegistrySetting(const wchar_t *regKey, const wchar_t *subKey, DWORD defaultValue)
-{
- DWORD result = defaultValue;
- HKEY handle;
- if (RegOpenKeyEx(HKEY_CURRENT_USER, regKey, 0, KEY_READ, &handle) == ERROR_SUCCESS) {
- DWORD type;
- if (RegQueryValueEx(handle, subKey, nullptr, &type, nullptr, nullptr) == ERROR_SUCCESS
- && type == REG_DWORD) {
- DWORD value;
- DWORD size = sizeof(result);
- if (RegQueryValueEx(handle, subKey, nullptr, nullptr, reinterpret_cast<unsigned char *>(&value), &size) == ERROR_SUCCESS)
- result = value;
- }
- RegCloseKey(handle);
- }
- return result;
-}
-
DWORD QWindowsContext::readAdvancedExplorerSettings(const wchar_t *subKey, DWORD defaultValue)
{
- return readDwordRegistrySetting(L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\Advanced",
- subKey, defaultValue);
+ const auto value =
+ QWinRegistryKey(HKEY_CURRENT_USER,
+ LR"(Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced)")
+ .dwordValue(subKey);
+ return value.second ? value.first : defaultValue;
}
static inline bool isEmptyRect(const RECT &rect)
diff --git a/src/plugins/platforms/windows/qwindowsservices.cpp b/src/plugins/platforms/windows/qwindowsservices.cpp
index b2b1dee232..83b052bb49 100644
--- a/src/plugins/platforms/windows/qwindowsservices.cpp
+++ b/src/plugins/platforms/windows/qwindowsservices.cpp
@@ -45,6 +45,8 @@
#include <QtCore/qdebug.h>
#include <QtCore/qdir.h>
+#include <QtCore/private/qwinregistry_p.h>
+
#include <shlobj.h>
#include <intshcut.h>
@@ -78,35 +80,24 @@ static inline QString mailCommand()
const wchar_t mailUserKey[] = L"Software\\Microsoft\\Windows\\Shell\\Associations\\UrlAssociations\\mailto\\UserChoice";
- wchar_t command[MAX_PATH] = {0};
// Check if user has set preference, otherwise use default.
- HKEY handle;
- QString keyName;
- if (!RegOpenKeyEx(HKEY_CURRENT_USER, mailUserKey, 0, KEY_READ, &handle)) {
- DWORD bufferSize = BufferSize;
- if (!RegQueryValueEx(handle, L"Progid", nullptr, nullptr, reinterpret_cast<unsigned char*>(command), &bufferSize))
- keyName = QString::fromWCharArray(command);
- RegCloseKey(handle);
- }
+ QString keyName = QWinRegistryKey(HKEY_CURRENT_USER, mailUserKey)
+ .stringValue( L"Progid");
const QLatin1String mailto = keyName.isEmpty() ? QLatin1String("mailto") : QLatin1String();
keyName += mailto + QLatin1String("\\Shell\\Open\\Command");
if (debug)
qDebug() << __FUNCTION__ << "keyName=" << keyName;
- command[0] = 0;
- if (!RegOpenKeyExW(HKEY_CLASSES_ROOT, reinterpret_cast<const wchar_t*>(keyName.utf16()), 0, KEY_READ, &handle)) {
- DWORD bufferSize = BufferSize;
- RegQueryValueEx(handle, L"", nullptr, nullptr, reinterpret_cast<unsigned char*>(command), &bufferSize);
- RegCloseKey(handle);
- }
+ const QString command = QWinRegistryKey(HKEY_CLASSES_ROOT, keyName).stringValue(L"");
// QTBUG-57816: As of Windows 10, if there is no mail client installed, an entry like
// "rundll32.exe .. url.dll,MailToProtocolHandler %l" is returned. Launching it
// silently fails or brings up a broken dialog after a long time, so exclude it and
// fall back to ShellExecute() which brings up the URL assocation dialog.
- if (!command[0] || wcsstr(command, L",MailToProtocolHandler") != nullptr)
+ if (command.isEmpty() || command.contains(QLatin1String(",MailToProtocolHandler")))
return QString();
wchar_t expandedCommand[MAX_PATH] = {0};
- return ExpandEnvironmentStrings(command, expandedCommand, MAX_PATH) ?
- QString::fromWCharArray(expandedCommand) : QString::fromWCharArray(command);
+ return ExpandEnvironmentStrings(reinterpret_cast<const wchar_t *>(command.utf16()),
+ expandedCommand, MAX_PATH)
+ ? QString::fromWCharArray(expandedCommand) : command;
}
static inline bool launchMail(const QUrl &url)