macOS: Remove unused QNSView member 'currentCustomDragTypes'

Change-Id: Id2e37cc81c24edce37cac2bfa843ee669fd13d98
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
This commit is contained in:
Tor Arne Vestbø 2018-07-06 17:41:32 +02:00
parent 573c81da9b
commit 012af8abf8
2 changed files with 18 additions and 26 deletions

View File

@ -123,7 +123,6 @@
QString m_composingText; QString m_composingText;
QPointer<QObject> m_composingFocusObject; QPointer<QObject> m_composingFocusObject;
bool m_sendKeyEvent; bool m_sendKeyEvent;
QStringList *currentCustomDragTypes;
bool m_dontOverrideCtrlLMB; bool m_dontOverrideCtrlLMB;
bool m_sendUpAsRightButton; bool m_sendUpAsRightButton;
Qt::KeyboardModifiers currentWheelModifiers; Qt::KeyboardModifiers currentWheelModifiers;
@ -153,7 +152,6 @@
m_glContext = nullptr; m_glContext = nullptr;
m_shouldSetGLContextinDrawRect = false; m_shouldSetGLContextinDrawRect = false;
#endif #endif
currentCustomDragTypes = nullptr;
m_sendUpAsRightButton = false; m_sendUpAsRightButton = false;
m_inputSource = nil; m_inputSource = nil;
m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self]; m_mouseMoveHelper = [[QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper) alloc] initWithView:self];
@ -216,8 +214,6 @@
[[NSNotificationCenter defaultCenter] removeObserver:self]; [[NSNotificationCenter defaultCenter] removeObserver:self];
[m_mouseMoveHelper release]; [m_mouseMoveHelper release];
delete currentCustomDragTypes;
[super dealloc]; [super dealloc];
} }

View File

@ -44,11 +44,7 @@
-(void)registerDragTypes -(void)registerDragTypes
{ {
QMacAutoReleasePool pool; 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"; NSString * const mimeTypeGeneric = @"com.trolltech.qt.MimeTypeName";
NSMutableArray<NSString *> *supportedTypes = [NSMutableArray<NSString *> arrayWithArray:@[ NSMutableArray<NSString *> *supportedTypes = [NSMutableArray<NSString *> arrayWithArray:@[
NSColorPboardType, NSColorPboardType,
@ -60,13 +56,13 @@
NSURLPboardType, NSPDFPboardType, NSVCardPboardType, NSURLPboardType, NSPDFPboardType, NSVCardPboardType,
NSFilesPromisePboardType, NSInkTextPboardType, NSFilesPromisePboardType, NSInkTextPboardType,
NSMultipleTextSelectionPboardType, mimeTypeGeneric]]; NSMultipleTextSelectionPboardType, mimeTypeGeneric]];
// Add custom types supported by the application. // Add custom types supported by the application.
for (int i = 0; i < customTypes.size(); i++) { for (const QString &customType : qt_mac_enabledDraggedTypes())
[supportedTypes addObject:customTypes[i].toNSString()]; [supportedTypes addObject:customType.toNSString()];
}
[self registerForDraggedTypes:supportedTypes]; [self registerForDraggedTypes:supportedTypes];
} }
}
static QWindow *findEventTargetWindow(QWindow *candidate) static QWindow *findEventTargetWindow(QWindow *candidate)
{ {