From b8a03411784803c07ecc1f769860756d6fdc04cd Mon Sep 17 00:00:00 2001 From: Timur Pocheptsov Date: Mon, 21 Sep 2020 13:38:02 +0200 Subject: QCocoaDrag::maybeDragMultipleItems - fix erroneous size check MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Due to somewhat inverted logic introduced by the 8481a9fc974a1f1dd44a, testing number of items in a pasteboard happens _before_ we fill it, which is wrong and useless. As a result, maybeDragMultipleItems will prevent the single item drag. Pick-to: 5.15 Task-number: QTCREATORBUG-24665 Task-number: QTBUG-86786 Change-Id: Ia4be9fc56677575bb363cbb8b1adbea59e6c3b0b Reviewed-by: Tor Arne Vestbø --- src/plugins/platforms/cocoa/qcocoadrag.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/plugins/platforms') diff --git a/src/plugins/platforms/cocoa/qcocoadrag.mm b/src/plugins/platforms/cocoa/qcocoadrag.mm index a27f8aaf87..d56f30b063 100644 --- a/src/plugins/platforms/cocoa/qcocoadrag.mm +++ b/src/plugins/platforms/cocoa/qcocoadrag.mm @@ -186,7 +186,7 @@ bool QCocoaDrag::maybeDragMultipleItems() const auto &qtUrls = m_drag->mimeData()->urls(); NSPasteboard *dragBoard = [NSPasteboard pasteboardWithName:NSPasteboardNameDrag]; - if (int(dragBoard.pasteboardItems.count) == 1 && qtUrls.size() <= 1) { + if (qtUrls.size() <= 1) { // Good old -dragImage: works perfectly for this ... return false; } -- cgit v1.2.3