Cocoa: Correct mime handler prioritization.
According to the documentation recently added mime type converters should take precedence over previously added converters. Make it so. Task-number: QTBUG-25951 Change-Id: Ic23ca7cbb93a98711d762b1ef0e0dd2aa1ceaeda Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
This commit is contained in:
parent
add16725a3
commit
0b68fc019b
@ -68,7 +68,10 @@ Q_GLOBAL_STATIC(QStringList, globalDraggedTypesList)
|
|||||||
|
|
||||||
void qt_mac_addToGlobalMimeList(QMacPasteboardMime *macMime)
|
void qt_mac_addToGlobalMimeList(QMacPasteboardMime *macMime)
|
||||||
{
|
{
|
||||||
globalMimeList()->append(macMime);
|
// globalMimeList is in decreasing priority order. Recently added
|
||||||
|
// converters take prioity over previously added converters: prepend
|
||||||
|
// to the list.
|
||||||
|
globalMimeList()->prepend(macMime);
|
||||||
}
|
}
|
||||||
|
|
||||||
void qt_mac_removeFromGlobalMimeList(QMacPasteboardMime *macMime)
|
void qt_mac_removeFromGlobalMimeList(QMacPasteboardMime *macMime)
|
||||||
@ -810,6 +813,10 @@ QList<QByteArray> QMacPasteboardMimeVCard::convertFromMime(const QString &mime,
|
|||||||
void QMacPasteboardMime::initializeMimeTypes()
|
void QMacPasteboardMime::initializeMimeTypes()
|
||||||
{
|
{
|
||||||
if (globalMimeList()->isEmpty()) {
|
if (globalMimeList()->isEmpty()) {
|
||||||
|
// Create QMacPasteboardMimeAny first to put it at the end of globalMimeList
|
||||||
|
// with lowest priority. (the constructor prepends to the list)
|
||||||
|
new QMacPasteboardMimeAny;
|
||||||
|
|
||||||
//standard types that we wrap
|
//standard types that we wrap
|
||||||
new QMacPasteboardMimeTiff;
|
new QMacPasteboardMimeTiff;
|
||||||
new QMacPasteboardMimeUnicodeText;
|
new QMacPasteboardMimeUnicodeText;
|
||||||
@ -819,8 +826,6 @@ void QMacPasteboardMime::initializeMimeTypes()
|
|||||||
new QMacPasteboardMimeUrl;
|
new QMacPasteboardMimeUrl;
|
||||||
new QMacPasteboardMimeTypeName;
|
new QMacPasteboardMimeTypeName;
|
||||||
new QMacPasteboardMimeVCard;
|
new QMacPasteboardMimeVCard;
|
||||||
//make sure our "non-standard" types are always last! --Sam
|
|
||||||
new QMacPasteboardMimeAny;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user