Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/src/gui/image/qimagereader.cpp

    r651 r769  
    264264    }
    265265
    266     if (!handler && !testFormat.isEmpty() && autoDetectImageFormat && !ignoresFormatAndExtension) {
     266    if (!handler && !testFormat.isEmpty() && !ignoresFormatAndExtension) {
    267267        // check if any plugin supports the format (they are not allowed to
    268268        // read from the device yet).
    269269        const qint64 pos = device ? device->pos() : 0;
    270         for (int i = 0; i < keys.size(); ++i) {
    271             if (i != suffixPluginIndex) {
    272                 QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
    273                 if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
     270
     271        if (autoDetectImageFormat) {
     272            for (int i = 0; i < keys.size(); ++i) {
     273                if (i != suffixPluginIndex) {
     274                    QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(keys.at(i)));
     275                    if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
    274276#ifdef QIMAGEREADER_DEBUG
    275                     qDebug() << "QImageReader::createReadHandler: the" << keys.at(i) << "plugin can read this format";
    276 #endif
    277                     handler = plugin->create(device, testFormat);
    278                     break;
     277                        qDebug() << "QImageReader::createReadHandler: the" << keys.at(i) << "plugin can read this format";
     278#endif
     279                        handler = plugin->create(device, testFormat);
     280                        break;
     281                    }
    279282                }
     283            }
     284        } else {
     285            QImageIOPlugin *plugin = qobject_cast<QImageIOPlugin *>(l->instance(QLatin1String(testFormat)));
     286            if (plugin && plugin->capabilities(device, testFormat) & QImageIOPlugin::CanRead) {
     287#ifdef QIMAGEREADER_DEBUG
     288                qDebug() << "QImageReader::createReadHandler: the" << testFormat << "plugin can read this format";
     289#endif
     290                handler = plugin->create(device, testFormat);
    280291            }
    281292        }
     
    283294            device->seek(pos);
    284295    }
     296
    285297#endif // QT_NO_LIBRARY
    286298
Note: See TracChangeset for help on using the changeset viewer.