summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qmacclipboard.mm
Commit message (Collapse)AuthorAgeFilesLines
* Clean up QUtiMimeConverter APIVolker Hilsheimer2023-02-081-2/+2
| | | | | | | | | | | | | Based on header review comments, make the internal constructor private and declare classes that need it as friends. QFlag-ify the HandlerScope enum, as it is a list of flags, and adjust code accordingly. Pick-to: 6.5 Change-Id: I1d8843265e49e696d463e9eea8306f4dbae75c78 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Reintroduce converter APIs for supporting native clipboard formatsVolker Hilsheimer2022-11-161-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Qt 5, QWin(dows)Mime and QMacMime lived in the respective Extras modules, which were removed and partially folded into the relevant modules in Qt. QWindowsMime and QMacMime continued to provide the abstraction for implementing built-in support for native clipboard formats and UTIs within Qt, but only as private APIs. After the recent clean up of those APIs and respective infrastructure, we can now bring them back as public converter interfaces. Application developers can subclass those and instantiate an instance of their implementation to add support for platform or application specific data formats. These interfaces are not in the QNativeInterface namespace, as applications don't call into Windows or macOS using those interfaces. I.e. there is no class on which an application would call auto *converter= nativeInterface<QWindowsMimeConverter>(); Also, since applications override those converter types, we do want to guarantee binary and source compatibility. [ChangeLog][QtGui][QWindowsMimeConverter] Reintroduced to allow applications to add support for conversion from and to Windows-native clipboard formats to MIME-encoded data. [ChangeLog][QtGui][QUtiMimeConverter] Reintroduced to allow applications to add support for conversion from and to clipboard data on macOS and iOS to MIME-encoded data. Fixes: QTBUG-93632 Change-Id: Iebd909c3970015d203f59d5ab15e306b3d312f6e Reviewed-by: Yuhang Zhao <2546789017@qq.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QMacMime::canConvert a non-virtual helper for other virtualsVolker Hilsheimer2022-11-091-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | Implementors are expected to return whether the converter can convert both ways between a mime and a uti. However, this is implied in the mimeForUti and utiForMime functions, and almost all converter implemented canConvert by returning mimeForUti(uti) == mime. A notable exception is the QMacMimeTypeName implementation, which can only convert from from mime to uti using hard-coded special format names and dummy data to provide place holders for drag'n'drop operations that originate in Qt. That converter returned always false from canConvert, but mapped the special "application/x-qt-mime-type-name" mime type to the special "com.trolltech.qt.MimeTypeName" uti. Since nobody ever requests data as "com.trolltech.qt.MimeTypeName", we still always ignore that converter. The uti is then special-cased in the QMacClipboard code. Lower-level code where only mime type or UTI are known can still call the virtuals directly and check whether the returned string is empty, which indicates that the converter does not support the conversion. As a drive-by, fix coding style and variable naming. Change-Id: I3d5d60faa82f8b31d9873c9da0097a308b9eeb50 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: clean up clipboard codeVolker Hilsheimer2022-11-071-97/+52
| | | | | | | | | | | | | | Replace flavor with uti, remove unused parameters, remove unused hasOSFlavor function. Hide QMacMimeData as an implementation detail, it is generally undefined behavior to cast an object to a type it is not an instance of (even if related and without new data members). Apply const, fix coding style. Task-number: QTBUG-93632 Change-Id: I3bc05a72bc47c78958f26211211e734387fbb024 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* QMacMime API cleanup: use uti instead of flavorVolker Hilsheimer2022-11-071-24/+24
| | | | | | | | Update documentation. Task-number: QTBUG-93632 Change-Id: I69a57608ba2a06211e89fcf511bc582509c00dc4 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Standardize QMacMime and QWindowsMimeVolker Hilsheimer2022-11-071-3/+3
| | | | | | | | | Make name of virtual functions explicit, following the QWindowsMime API. Task-number: QTBUG-93632 Change-Id: I7ada2b1aa86bc6e28b47383a32ab9cbaf9ad93e5 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Make QMacMime's handler scope type-safeVolker Hilsheimer2022-11-071-13/+13
| | | | | | | | | | | | | | | | | | The value indicates for which systems the handler is relevant, e.g. clipboard and/or drag'n'drop. Rename the enum from "MimeType", which is something else already, to "HandlerScope". Make the enum a scoped enum to avoid implicit conversion to uchar, and to allow for better value names. Use the type in APIs and only convert to uchar when needed. Make respective arguments default to both DnD and clipboard implicitly, instead of explicitly interpreting an invalid zero-value as a default value. Task-number: QTBUG-93632 Change-Id: I85ab982f6c9fe78ea4d030dd0b0791c8ab866f67 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Rename QMacInternalPasteboardMime to QMacMimeVolker Hilsheimer2022-11-071-12/+12
| | | | | | | | | | | | | | | We want to make it public, and there is no need for "pasteboard" since it also coveres drag'n'drop. Add a default constructor that defaults to supporting both clipboard and drag'n'drop, and clean up the code by using that constructor where applicable. Historical note: the converter interface was called QMacMime up to Qt 4.2, when due to macOS changes it had to be replaced by QMacPasteboardMime. Task-number: QTBUG-93632 Change-Id: Id9712300039375aa6394598b104827e6f5d6c948 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Fix spelling of converterVolker Hilsheimer2022-11-041-4/+4
| | | | | | | Primarily in the Cocoa clipboard code. Change-Id: I39fede6144be5a0007a94e2ac2464892c958732f Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Clean up QMacMimeRegistry: remove convertorVolker Hilsheimer2022-11-031-6/+4
| | | | | | | | | | | It's not called anywhere, we always get all convertors and iterate over them to find the best match for the relevant context. Change those loops to use ranged for. Task-number: QTBUG-93632 Change-Id: Icb450ca56310a0acab881899234ac647792ce0c9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* Clean up QMacInternalPasteboardMime: remove convertorNameVolker Hilsheimer2022-11-031-7/+7
| | | | | | | | | | | | The function was primarily called to generate debug output. The only other usage was to identify the Rtf converter so that we can avoid that we convert outgoing HTML to RTF. This is just as easily (and more accurately) done by skipping any converter that converts HTML to RTF. Task-number: QTBUG-93632 Change-Id: Ibe5bdece982399e2d9823f6df67393d1f81501fe Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Refactor: split QMacMime registry and virtual interfaceVolker Hilsheimer2022-11-031-5/+7
| | | | | | | | | | | | | | | | The logic for registration of converter implementations is only used internally through static functions. Move those, and related global functions, to a QMacMimeRegistry namespace. Reduce the QMacInternalPasteboardMime to the abstract interface for converting between native and Qt clipboard data. Historically, mime converters can have different "types"; make that API type-safe. Task-number: QTBUG-93632 Change-Id: I0e16fefa350398b693486199fe10357fd84abcd6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMacPasteboard: check QGuiApplication is alive for a promise containing QPixmapTimur Pocheptsov2022-09-141-1/+11
| | | | | | | | | | Otherwise, when platform integration is deleted, it triggers resolving promises after the global instance of QGuiApplication is dead and QPixmap in turn calls qFatal, crashing the exiting app. Fixes: QTBUG-106472 Change-Id: Ie706d030214c33abdbc8fff86cc2eddd0c632f1b Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Move QMacAutoReleasePool from qglobal.h to qcore_mac_p.hSona Kurazyan2022-09-011-0/+1
| | | | | | | | And include qcore_mac_p.h where needed. Task-number: QTBUG-99313 Change-Id: Idb1b005f1b5938e8cf329ae06ffaf0d249874db2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Use SPDX license identifiersLucie Gérard2022-05-161-38/+2
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Plugins: use _L1 for for creating Latin-1 string literalsSona Kurazyan2022-05-041-6/+8
| | | | | | | | | As a drive-by, fix qsizetype -> int narrowing conversion warnings for the touched lines. Task-number: QTBUG-98434 Change-Id: I7fadd3cf27ad099028d70f05956303e3af62c0f5 Reviewed-by: Marc Mutz <marc.mutz@qt.io>
* qcocoa: Fix typos in source code commentsJonas Kvinge2021-10-121-1/+1
| | | | | | Pick-to: 6.2 5.15 Change-Id: Ide20e1d133891890a7673c8403ea91b489baa8f6 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* cocoa: move DEBUG_PASTEBOARD into logging categoryLiang Qi2021-05-051-62/+19
| | | | | | Pick-to: 5.15 6.1 Change-Id: I8f49c030588122adff3c0eab4189bfa7e6aeff09 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Make QPointer comparisons hidden friendsAllan Sandfeld Jensen2020-10-231-1/+1
| | | | | | | Reduces ADL noise. Change-Id: Id0aa4b32b7bb6d70ed9106b949452d895d9060a9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Cleanup API of QMimeDataLars Knoll2020-09-211-3/+3
| | | | | | | | | | | | | Do not use QVariant::Type anymore, instead use QMetaType For some reason, this pushed the qvariant autotest over the limit where MSVC requires the /bigobj flag, so add that one. [ChangeLog][QtCore][QMimeData] The signature of the virtual retrieveData() function has changed and now takes a QMetaType instead of a QVariant::Type. Change-Id: Ib46773bd731ee2177b1ef74d8162d744be7017ef Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* macOS: Clean up headersTor Arne Vestbø2020-06-051-0/+2
| | | | | | | | | | | | | | The headers are now C++ clean and can be used outside of Objective-C code. All includes of Objective-C frameworks have been moved to the implementation files. Header guards have been added in the few places they were missing. All includes are now done via #include, instead of sometimes using the #import variant. Change-Id: Ibb0a9c0bcfefbda4347737212e40e300a3184982 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Merge remote-tracking branch 'origin/5.15' into devQt Forward Merge Bot2020-04-221-8/+8
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/widgets/qabstractbutton.cpp src/widgets/widgets/qbuttongroup.cpp src/widgets/widgets/qbuttongroup.h src/widgets/widgets/qsplashscreen.cpp tests/auto/widgets/widgets/qbuttongroup/tst_qbuttongroup.cpp tests/benchmarks/opengl/main.cpp Needed update: src/plugins/platforms/cocoa/CMakeLists.txt Change-Id: I7be4baebb63844ec2b3e0de859ca9de1bc730bb5
| * macOS: Clean up header includes to use quotes or brackets as appropriateTor Arne Vestbø2020-04-151-8/+8
| | | | | | | | | | | | | | | | The includes can be sorted and unified even more, but that's left for another rainy day. Change-Id: I4d5670d6d8389f69d2631b83b8f421d1f685a0f9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | macOS: Fix or ignore deprecated API in 10.14Tor Arne Vestbø2020-03-271-1/+1
|/ | | | | | | Fixes: QTBUG-82128 Change-Id: I11abfcf7f245a7a25733625b50e207b07abba289 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* macOS: support copying lazily provided data to the clipboardVolker Hilsheimer2019-12-101-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | Using always EagerRequest type forces the application to provide the data at copy or drag-begin time, even though the data might never be requested (pasted or dropped into another application). For data that is expensive to generate, this is wasteful, and on other platforms Qt uses the functionality provided by the native clipboard to allow for on-demand retrieval of data. Changing the request type to LazyRequest for the cocoa clipboard works, but then we need to make sure that we resolve all promises at shutdown time so that the data is available (which is what the end user expects). Commit ad0d2f463a0905c4705660d96e8a514539c51d36 disabled this for lazy requests to prevent crashes when using drag'n'drop, where the QMacPasteboard object is short-lived and stack allocated. We definitely don't need to worry about lazy data that is not yet retrieved at the end of a drag'n'drop operation, so limit the fix from the previous commit to the drag'n'drop scenario. [ChangeLog][QtGui][QClipboard] Support lazily provided copying of data to the clipboard on macOS Change-Id: Id2203999024a0d9d854d6933d39077cc4af925d0 Fixes: QTBUG-76263 Reviewed-by: Tomi Korpipää <tomi.korpipaa@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* macOS: Better document plain-text code-path in QMacPasteboard::retrieveDataTor Arne Vestbø2019-05-151-7/+6
| | | | | | | | | | | | | | | | | | | Due to PasteboardCopyItemFlavorData converting newlines to '\r' for some UTIs we have traditionally had to shortcut these UTIs via NSStringPboardType instead of the mime converters such as QMacPasteboardMimeUnicodeText. Let's explain this a bit better for future generations. Note that public.utf8-plain-text doesn't seem to have this problem anymore, but it's left in for now to not cause any regressions due to behavior change. Change-Id: I7dce80828865c6323ed308780b8ca07b7a3e7c17 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
* macOS: Remove broken UTF-16 handling in QMacPasteboard::retrieveDataTor Arne Vestbø2019-05-151-2/+0
| | | | | | | | | | | | | | | | | | | | | The logic seems to be to prefer public.utf16-plain-text over the UTI reported by the mime converter's flavorFor, but this doesn't make sense for two reasons: 1. If the converter reports a UTI from flavorFor, we should respect that as the preferred UTI. QMacPasteboardMimeUnicodeText already reports public.utf16-plain-text as expected. 2. We don't know if the converter supports the public.utf16-plain-text UTI, which is the case for QMacPasteboardMimeTraditionalMacPlainText for example. The result is that we fail to retrieve any data. The reason we haven't been seeing this issue is that the code path above using qt_mac_get_pasteboardString will in most cases succeed and return early. Change-Id: I0b7e0d09a97389a229e7a945f17fef74ad5c2fc0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* Merge remote-tracking branch 'origin/5.11' into 5.12Qt Forward Merge Bot2018-11-271-5/+23
|\ | | | | | | Change-Id: I12bcee17e349edd0dd4fd08da76361d1ffb1a727
| * Fix hang in QMacPasteboard::formats()Andrew Smolko2018-11-221-5/+23
| | | | | | | | | | | | | | | | PasteboardGetItemCount() can return -1 as result to unsigned variable, so the further loop will iterate "forever". Return early to avoid hang. Change-Id: Ie91dba1c193d04513f0496d20bd0b6b0b5b6c151 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | Cocoa QPA: Clean up 0 as pointerGabriel de Dietrich2018-04-191-7/+7
|/ | | | | | | | We use nil for Objective-C null pointers and nullptr everywhere else, including CoreFoundation and similar opaque types. Change-Id: Id75c59413dec54bf4d8e83cf7ed0ff7f3d8bb480 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* QMacPasteBoard - protect against dangling pointersTimur Pocheptsov2017-03-221-0/+12
| | | | | | | | | | | | | | | | In QMacPasteboard we use converters from QMacInternalPasteboardMime, which has essentially a global QList of available converters. QMacInternalPasteboardMime and derived classes register/unregister their instances in this list (in ctors/dtors) and then QMacPasteboard is using converters from this list. Unfortunately, when we're un-registering converter (and this means we delete those objects) we do not remove dangling pointers from our pasteboard objects. Apparently, this problem can be seen only when working with macextras (thus having an access to this private API in client's code). Task-number: QTBUG-54832 Change-Id: Ie3aef4aaca8ef6c80544dc58821cf43fc26f84a1 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* Replace QCFString::to(CF/NS/Q)String usage with QString methodsTor Arne Vestbø2016-10-061-8/+8
| | | | | | | | Slims down QCFString and leaves only one implementation of converting back and forth between CF/NS strings and QStrings. Change-Id: I068568ffa25e6f4f6d6c99dcf47078b7a8e70e10 Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* Merge remote-tracking branch 'origin/5.6' into 5.7Edward Welbourne2016-07-261-13/+6
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qtemporarydir.cpp One side encapsulated a repeated piece of #if-ery in a local define; the other added to the #if-ery. Made its addition to the other's. src/corelib/kernel/qeventdispatcher_unix_p.h One side moved some members into a struct; this collided with a #undef check that neither side now has. Discarded the #undef part. src/gui/opengl/qopengltexturehelper_p.h 5.7 deleted a bunch of methods; not clear why merge got confused. src/tools/moc/moc.cpp One added a name to the copyright header; another changed its URL. Change-Id: I9e9032b819f030d67f1915445acf2793e98713fa
| * Cocoa integration - fix a crash in QMacPasteboardTimur Pocheptsov2016-07-251-13/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMacPasteboard's dtor skips LazyRequest promises and this leaves pasteboard manager in broken state, since we release the pasteboard itself of the next step in destructor. As a result, not only Qt's app doing D & D (and thus via QCocoaDrag creating a stack-allocated QMacPasteboard) can die suddenly when somebody inspects a pasteboard, this 'somebody' ... can also die amazingly. So now we DO resolve promises using PasteboardResolvePromises (but we also preserve the original intent of not providing or providing empty data for lazy requests). Task-number: QTBUG-54663 Task-number: QTBUG-54832 Change-Id: I3ce90bd0a012dd3cbb30c93b2b17dce9473acb28 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
* | Updated license headersJani Heikkinen2016-01-151-14/+20
|/ | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Add shared implementation of a NSAutoreleasePool wrapper to qglobalTor Arne Vestbø2015-05-271-2/+1
| | | | | | | | | | | We have at least 5 different (but equal) implementations of a wrapper in Qt, and some code uses explicit NSAutoreleasePools. Having a shared implementation lets us clean up things a bit and makes it easier to reason about which pools are actually needed. Change-Id: I2fd8eefc3ae7308595ef9899b7820206268362a5 Reviewed-by: Tim Blechmann <tim@klingt.org> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Fixed license headersJani Heikkinen2015-02-171-1/+1
| | | | | Change-Id: Ibebe1318d1c2de97601aa07269705c87737083ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update copyright headersJani Heikkinen2015-02-111-22/+14
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Cocoa: Delay QMimeData requests for DnD events.Morten Johan Sørvig2014-10-221-12/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We were delaying the conversion from Qt to OS X types, but not the data request to the application. Introduce "Eager" and "Lazy" pasteboard promises: Eager promises request the application data immediately and can continue to use the existing commit-promises- on-app-exit logic. Eager promises are the default type and will be used for copy/paste. Lazy promises delay requesting the data from the application for as long as possible, specifically until when promiseKeeper() is called. Lazy promises are used for drag-and-drop and are not committed on application exit. This brings OS X DnD behavior in line with the Windows behavior. [ChangeLog][OS X] Drag-and-drop QMimeData requests are now delayed until drop time. Task-number: QTBUG-31301 Change-Id: I8ddbba41593251f4c0c49c29492dce990066e20d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@theqtcompany.com>
* Don't use QStringLiteral in comparisonsMarc Mutz2014-10-091-1/+1
| | | | | | | | | | | | | | For QLatin1String, operator== is overloaded, so comparing to a latin-1 (C) string literal is efficient, since strlen() is comparatively fast. OTOH, QStringLiteral, when not using RVO, litters the code with QString dtor calls, which are not inline. Worse, absent lambdas, it even allocates memory. So, just compare using QLatin1String instead. Change-Id: I7af3bf3a67c55dae33ffaf9922d004fa168a3f9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Cocoa: Support pasting rich text to Qt appsMorten Johan Sørvig2014-04-051-0/+5
| | | | | | | | | | | | | | | | Native Mac OS X apps uses Rtf as the rich text format while Qt uses html. Add QMacPasteboardMimeRtfText which supports converting from public.rtf to text/html (but not the other way around, since we want to keep posting our html as html). The QMacInternalPasteboardMime API does not support the concept of a one-way handler. Skip the Rtf handler in QMacPasteboard::setMimeData(). Task-number: QTBUG-37188 Change-Id: Ibe29997a038bbb64da24b961e84a5f60133074e0 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Cocoa: remove qmacmime includes where not neededRichard Moe Gustavsen2014-03-061-1/+0
| | | | | | Change-Id: Id20df8b80f3064ac0d193124fb790a075a89e53c Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Fix static builds on Mac.Morten Johan Sørvig2013-12-181-10/+10
| | | | | | | | | | | | | QMacPasteboardMime is a public class in Qt 4. Qt 5 has two copies, one public QtMacExtras and an internal one in the cocoa plugin. This causes a symbol collision when building statically. Rename the internal copy to QMacInternalPasteboardMime. Task-number: QTBUG-35310 Change-Id: I891787b451a0b342ed85aa7196e606bc11623e21 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Fix compiler warnings.Erik Verbruggen2013-11-261-3/+4
| | | | | | | | | | | | | | As seen with Xcode 5.0.2. qmacclipboard.mm:108:30: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast] promiseKeeper(paste, (PasteboardItemID)promise.itemId, flavor, this); ^ qmacclipboard.mm:316:56: warning: cast to 'void *' from smaller integer type 'int' [-Wint-to-void-pointer-cast] PasteboardPutItemFlavor(paste, (PasteboardItemID)itemID, QCFString(flavor), 0, kPasteboardFlavorNoFlags); ^ Change-Id: I94b8ea2ff32d606d4cab28981b26c2ef516035dc Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Fix minor typos in docs, printed messages & commentsSze Howe Koh2013-01-281-1/+1
| | | | | | | Missing apostrophes Change-Id: I3ef5e9d494fb7a37f8e6075f24cd3a274e572c23 Reviewed-by: Jerome Pasion <jerome.pasion@digia.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Cocoa: fix memory leaksTeemu Katajisto2012-11-061-1/+4
| | | | | Change-Id: I2e805aa64c65b90d33924ea4a8671735dee581fd Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Reduce QtWidgets dependencies in the Cocoa plugin.Morten Johan Sorvig2012-06-081-1/+1
| | | | | | | | | | | | | | | | | | | | | b8246f08 added the new menus implementation which removes one of the major QtWidget dependencies. Continuing on the path to QtWidget-freedom this commit removes the following: - qmenu_mac.h/mm. Not used. - FORMS += filedialog.ui. Not used. - qt_strippedText from qaction.cpp. Duplicate. - Misc stray includes. What is left should be the dependencies needed by the print engine implementation. These will be handled at a later time. Change-Id: I0cead4cdaddcebd402d30c6112f3e889d0f28740 Conflicts: Reviewed-by: James Turner <james.turner@kdab.com> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Add QMacPasteboardMime::count(QMimeData*).Morten Johan Sorvig2012-05-241-8/+2
| | | | | | | | | | | | As QTBUG-25076 points out, the ### comment indicates that we want to add virtual function to QMacPasteboardMime. The default implementation returns 1. Reimplement for QMacPastebardMimeUrl and return the url count. Change-Id: Ie300574eab9991af625986805d2b030914291cc0 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>