Changeset 338 for trunk/src/gui/kernel


Ignore:
Timestamp:
Nov 22, 2009, 10:43:33 PM (16 years ago)
Author:
Dmitry A. Kuminov
Message:

gui/kernel: mime: Make sure the fallback converter doesn't participate in the conversion if there is a specialized converter that already presented the given MIME type in the clipboard (to avoid unnecessary duplication of representations).

Location:
trunk/src/gui/kernel
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gui/kernel/qmime.h

    r337 r338  
    122122    virtual ~QPMMime();
    123123
     124
     125
     126
     127
     128
     129
     130
    124131    // for converting from Qt
    125     virtual QList<ULONG> formatsForMimeData(const QMimeData *mimeData) const = 0;
     132    virtual QList<> formatsForMimeData(const QMimeData *mimeData) const = 0;
    126133    virtual bool convertFromMimeData(const QMimeData *mimeData, ULONG format,
    127134                                     ULONG &flags, ULONG *data) const = 0;
    128 
    129     typedef QPair<QString, ULONG> MimeCFPair;
    130 
    131135    // for converting to Qt
    132136    virtual QList<MimeCFPair> mimesForFormats(const QList<ULONG> &formats) const = 0;
     
    154158            converter(c), mime(f), format(cf), priority(p) {}
    155159
    156         Match(QPMMime *c, ULONG f, int p) :
    157             converter(c), format(f), priority(p) {}
    158 
    159160        QPMMime *converter;
    160         QString mime; // used by allConvertersFromFormats()
    161         ULONG format; // used by allConvertersFromFormats()/allConvertersFromMimeData()
     161        QString mime;
     162        ULONG format;
    162163        int priority;
    163164    };
  • trunk/src/gui/kernel/qmime_pm.cpp

    r337 r338  
    204204
    205205/*!
    206     \fn QList<ULONG> QPMMime::formatsForMimeData(const QMimeData *mimeData) const
     206    \fn QList<> QPMMime::formatsForMimeData(const QMimeData *mimeData) const
    207207
    208208    Returns a list of ULONG values representing the different OS/2 PM
     
    210210    precedence (the most suitable format goes first), or an empty list if
    211211    neither of the mime types provided by \a mimeData is supported by this
    212     converter.
     212    converter. Note that each item in the returned list is actually a pair
     213    consisting of the mime type name and the corresponding format identifier.
    213214
    214215    All subclasses must reimplement this pure virtual function.
     
    250251    of \a formats, in order of precedence (the most suitable mime type comes
    251252    first), or an empty list if neither of the \a formats is supported by this
    252     converter. Note that each pair in the returned list consists of the mime
    253     type name and the corresponding format identifier.
     253    converter. Note that each