diff options
author | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-07-06 17:41:32 +0200 |
---|---|---|
committer | Tor Arne Vestbø <tor.arne.vestbo@qt.io> | 2018-07-08 10:50:34 +0000 |
commit | 012af8abf8760981a262064039ca092bc78e9faf (patch) | |
tree | df2a660c0d9924011a26682fa7d12222750c9533 | |
parent | 573c81da9b031aaf16cda6c3fb69a9adac8d80c6 (diff) |
macOS: Remove unused QNSView member 'currentCustomDragTypes'
Change-Id: Id2e37cc81c24edce37cac2bfa843ee669fd13d98
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 4 | ||||
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview_dragging.mm | 40 |
2 files changed, 18 insertions, 26 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 52ae3ae1ec..cb6bc4c16a 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -123,7 +123,6 @@ QString m_composingText; QPointer<QObject> m_composingFocusObject; bool m_sendKeyEvent; - QStringList *currentCustomDragTypes; bool m_dontOverrideCtrlLMB; bool m_sendUpAsRightButton; Qt::KeyboardModifiers currentWheelModifiers; @@ -153,7 +152,6 @@ m_glContext = nullptr; m_shouldSetGLContextinDrawRect = false; #endif - currentCustomDragTypes = nullptr; m_sendUpAsRightButton = false; m_inputSource = nil; m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self]; @@ -216,8 +214,6 @@ [[NSNotificationCenter defaultCenter] removeObserver:self]; [m_mouseMoveHelper release]; - delete currentCustomDragTypes; - [super dealloc]; } diff --git a/src/plugins/platforms/cocoa/qnsview_dragging.mm b/src/plugins/platforms/cocoa/qnsview_dragging.mm index e61329f169..1c38c5326c 100644 --- a/src/plugins/platforms/cocoa/qnsview_dragging.mm +++ b/src/plugins/platforms/cocoa/qnsview_dragging.mm @@ -44,28 +44,24 @@ -(void)registerDragTypes { QMacAutoReleasePool pool; - QStringList customTypes = qt_mac_enabledDraggedTypes(); - if (currentCustomDragTypes == 0 || *currentCustomDragTypes != customTypes) { - if (currentCustomDragTypes == 0) - currentCustomDragTypes = new QStringList(); - *currentCustomDragTypes = customTypes; - NSString * const mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; - NSMutableArray<NSString *> *supportedTypes = [NSMutableArray<NSString *> arrayWithArray:@[ - NSColorPboardType, - NSFilenamesPboardType, NSStringPboardType, - NSFilenamesPboardType, NSPostScriptPboardType, NSTIFFPboardType, - NSRTFPboardType, NSTabularTextPboardType, NSFontPboardType, - NSRulerPboardType, NSFileContentsPboardType, NSColorPboardType, - NSRTFDPboardType, NSHTMLPboardType, - NSURLPboardType, NSPDFPboardType, NSVCardPboardType, - NSFilesPromisePboardType, NSInkTextPboardType, - NSMultipleTextSelectionPboardType, mimeTypeGeneric]]; - // Add custom types supported by the application. - for (int i = 0; i < customTypes.size(); i++) { - [supportedTypes addObject:customTypes[i].toNSString()]; - } - [self registerForDraggedTypes:supportedTypes]; - } + + NSString * const mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName"; + NSMutableArray<NSString *> *supportedTypes = [NSMutableArray<NSString *> arrayWithArray:@[ + NSColorPboardType, + NSFilenamesPboardType, NSStringPboardType, + NSFilenamesPboardType, NSPostScriptPboardType, NSTIFFPboardType, + NSRTFPboardType, NSTabularTextPboardType, NSFontPboardType, + NSRulerPboardType, NSFileContentsPboardType, NSColorPboardType, + NSRTFDPboardType, NSHTMLPboardType, + NSURLPboardType, NSPDFPboardType, NSVCardPboardType, + NSFilesPromisePboardType, NSInkTextPboardType, + NSMultipleTextSelectionPboardType, mimeTypeGeneric]]; + + // Add custom types supported by the application. + for (const QString &customType : qt_mac_enabledDraggedTypes()) + [supportedTypes addObject:customType.toNSString()]; + + [self registerForDraggedTypes:supportedTypes]; } static QWindow *findEventTargetWindow(QWindow *candidate) |